Skip to content

"Nodes in mesh" is not valid JSON #416

@tobymurray

Description

@tobymurray

Tried in Meshtastic version 2.0.5 and 2.0.9

Example:

$ meshtastic --port /dev/ttyUSB0 --info
<...snip...>
Nodes in mesh:  {'num': 2885175728, 'user': {'id': '<REDACTED>', 'longName': 'ttgo 1.1', 'shortName': 't1', 'macaddr': '24:62:ab:f8:49:b0', 'hwModel': 'TBEAM'}, 'position': {'latitudeI': <REDACTED>, 'longitudeI': -<REDACTED>, 'altitude': <REDACTED>, 'time': 1673813417, 'latitude': <REDACTED>, 'longitude': <REDACTED>}, 'lastHeard': 1673813630, 'deviceMetrics': {}}  {'num': 546312913, 'user': {'id': '<REDACTED>', 'longName': 'RAK4631', 'shortName': 'RK46', 'macaddr': 'f1:fc:20:90:12:d1', 'hwModel': 'RAK4631'}, 'position': {'latitudeI': <REDACTED>, 'longitudeI': <REDACTED>, 'altitude': <REDACTED>, 'latitude': <REDACTED>, 'longitude': <REDACTED>}, 'snr': 11.25, 'lastHeard': 1673813406, 'deviceMetrics': {'batteryLevel': 60, 'voltage': 3.829}, 'lastReceived': {'from': 546312913, 'to': 4294967295, 'id': 1849607190, 'rxTime': 1673813406, 'rxSnr': 11.25, 'hopLimit': 3, 'rxRssi': -73, 'fromId': '!<REDACTED>', 'toId': '^all'}, 'hopLimit': 3}
<...snip...>

The rest of the value outputs of --info are valid JSON. Are the nodes intentionally invalid?

Two changes would have to be made around here, making the overall nodes an array and I'm guessing use something like the existing MessageToJson to format the node info itself as JSON (single quotes instead of double).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions