show debug output as json

This commit is contained in:
geeksville committed 2020-04-28 10:22:12 -07:00
1 parent 1b8df614bf
commit 2b42439fd0
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -1 +1 @@
python3 -m meshtastic --debug "$@"
python3 -m meshtastic "$@"
+3 -1
View File
@@ -1,4 +1,5 @@
import google.protobuf.json_format
import serial
import serial.tools.list_ports
import threading
@@ -97,7 +98,8 @@ class MeshInterface:
Called by subclasses."""
fromRadio = mesh_pb2.FromRadio()
fromRadio.ParseFromString(fromRadioBytes)
logging.debug(f"Received: {fromRadio}")
json = google.protobuf.json_format.MessageToJson(fromRadio)
logging.debug(f"Received: {json}")
if fromRadio.HasField("my_info"):
self.myInfo = fromRadio.my_info
if fromRadio.HasField("radio"):