Skip to content

Commit

Permalink
Change order of logging and parsing fromRadioBytes, and add a bit mor…
Browse files Browse the repository at this point in the history
…e traceback logging at that point
  • Loading branch information
ianmcorvidae committed Sep 29, 2024
1 parent 6e1217c commit bbd6d6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion meshtastic/mesh_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sys
import threading
import time
import traceback
from datetime import datetime
from decimal import Decimal
from typing import Any, Callable, Dict, List, Optional, Union
Expand Down Expand Up @@ -1023,10 +1024,17 @@ def _handleFromRadio(self, fromRadioBytes):
Called by subclasses."""
fromRadio = mesh_pb2.FromRadio()
fromRadio.ParseFromString(fromRadioBytes)
logging.debug(
f"in mesh_interface.py _handleFromRadio() fromRadioBytes: {fromRadioBytes}"
)
try:
fromRadio.ParseFromString(fromRadioBytes)
except Exception as ex:
logging.error(
f"Error while parsing FromRadio bytes:{fromRadioBytes} {ex}"
)
traceback.print_exc()
raise ex
asDict = google.protobuf.json_format.MessageToDict(fromRadio)
logging.debug(f"Received from radio: {fromRadio}")
if fromRadio.HasField("my_info"):
Expand Down

0 comments on commit bbd6d6a

Please sign in to comment.