Closed iz1kga closed 3 years ago
I Had time to look into the code, for what i can understand raw protobuf object cannot be direcly serialized with json.dumps().
So how to serialize meshtastic.SerialInterface().nodes easily?
ok, so, the issue is not an issue, the dict containing a protobuf object cannot be serialized with json.dumps() I solved with a function that recursively strips the key you don't want (in my case "raw").
def stripKey(inDict, keys):
keySet = set(keys)
strippedDict = {}
for key, value in inDict.items():
if key not in keySet:
if isinstance(value, dict):
strippedDict[key] = stripKey(value, keySet)
else:
strippedDict[key] = value
return strippedDict
After some time of execution is not possible to json.Dumps -> meshtastic.SerialInterface().nodes
How to reproduce: execute this code and wait
IMHO it seems that in raw some quotes are missing