From a6d2ce11cc9ac30b94a0c2471a259377ace655ba Mon Sep 17 00:00:00 2001 From: Ryan Tolboom Date: Wed, 20 Oct 2021 21:38:19 -0400 Subject: [PATCH 1/2] Fixed order of have_tunnel check --- meshtastic/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 3250d83..193ef02 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -511,7 +511,7 @@ def common(): # We assume client is fully connected now onConnected(client) - if args.noproto or (args.tunnel and have_tunnel): # loop until someone presses ctrlc + if args.noproto or (have_tunnel and args.tunnel): # loop until someone presses ctrlc while True: time.sleep(1000) From 8ce025ed5ec2113fe00d7768c0012bc67c3d196e Mon Sep 17 00:00:00 2001 From: Ryan Tolboom Date: Wed, 3 Nov 2021 22:55:32 -0400 Subject: [PATCH 2/2] Added workaround for reserved word 'None' --- bin/regen-protos.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index b188217..9ceb46b 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -5,4 +5,7 @@ protoc -I=proto --python_out meshtastic `ls proto/*.proto` # workaround for import bug in protoc https://github.com/protocolbuffers/protobuf/issues/1491#issuecomment-690618628 -sed -i -E 's/^import.*_pb2/from . \0/' meshtastic/*.py \ No newline at end of file +sed -i -E 's/^import.*_pb2/from . \0/' meshtastic/*.py + +# automate the current workaround (may be related to Meshtastic-protobufs issue #27 https://github.com/meshtastic/Meshtastic-protobufs/issues/27) +sed -i "s/^None = 0/globals()['None'] = 0/" meshtastic/mesh_pb2.py