Output of --info "Nodes in mesh" to JSON Format#433
Conversation
caveman99
left a comment
There was a problem hiding this comment.
While the output is valid JSON now, this is a breaking change from previous versions for people that may parse the output of that command manually. Not sure how to proceed with this or if this is even an issue.
I see two options: 1- keep it as it is (see output of PR above) and assume that almost nobody did parse the output so far because it was not valid JSON format 2- revert some modifications of the current PR and provide two different versions of info output :- (this is instantly ready for commit on request) b) optional: an additional machine readable format provided by --json-info (entire info output in valid JSON format) |
This is a fix for #416 "Nodes in mesh" is not valid JSON.
The resulting output will look like this:
Nodes in mesh: {"!fa5a06bc": {"num": 4200203964, "user": {"longName": "Meshtastic 06bc", "shortName": "06bc", "macaddr": "f4:12:fa:5a:06:bc", "hwModel": "TLORA_T3_S3"}, "position": {"time": 1680178890}, "lastHeard": 1680178890, "deviceMetrics": {"batteryLevel": 111, "voltage": 4.46, "channelUtilization": 1.78, "airUtilTx": 0.24416666}}, "!55c58b64": {"num": 1439009636, "user": {"longName": "MUGL-8b64", "shortName": "MUGL", "macaddr": "94:b5:55:c5:8b:64", "hwModel": "TBEAM"}, "snr": 6.0, "lastHeard": 1680178620, "deviceMetrics": {"batteryLevel": 88, "voltage": 4.052, "channelUtilization": 3.3933334, "airUtilTx": 0.45066667}}, "!fa5a0688": {"num": 4200203912, "user": {"longName": "NORD-0688", "shortName": "NORD", "macaddr": "f4:12:fa:5a:06:88", "hwModel": "TLORA_T3_S3"}, "snr": 5.5, "lastHeard": 1680178634, "deviceMetrics": {"batteryLevel": 111, "voltage": 4.247, "channelUtilization": 17.903334, "airUtilTx": 2.858639}}, "!fa5a06f8": {"num": 4200204024, "user": {"longName": "Meshtastic 06f8", "shortName": "06f8", "macaddr": "f4:12:fa:5a:06:f8", "hwModel": "TLORA_T3_S3"}, "snr": 5.75, "lastHeard": 1680178675, "deviceMetrics": {"batteryLevel": 111, "voltage": 4.379, "channelUtilization": 11.0, "airUtilTx": 0.4597778}}}