firmware icon indicating copy to clipboard operation
firmware copied to clipboard

Enhancement/telemetry module payload

Open oscgonfer opened this issue 6 months ago • 4 comments

Works on https://github.com/meshtastic/firmware/issues/7047, with tests on-going at the moment. It doesn't add non-present values in the telemetry module.

In addition, it adds a small convention to change battery level to -1 when not present. (To be reviewed based on the discussion in https://github.com/meshtastic/protobufs/pull/706).

Finally, as a side benefit, removing these fields from the payload reduces the size of the payload in many cases.

🤝 Attestations

  • [x] I have tested that my proposed changes behave as described.
  • [x] I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • ...
    • [x] Other (please specify below)
    • [x] Xiao ESP32-S3 + SX1262 (ongoing)

oscgonfer avatar Jun 15 '25 21:06 oscgonfer

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 15 '25 21:06 CLAassistant

The files under src/generated/meshtastic are automatically generated, using protobufs , so can't be edited here.

See: https://github.com/meshtastic/protobufs

I'll fix that! Maybe worth adding that to the .gitignore?

Is this the right approach based on https://github.com/meshtastic/firmware/issues/7047#issuecomment-2974718829 ?

oscgonfer avatar Jun 16 '25 05:06 oscgonfer

@fifieldt fixed the generated files. sorry for that! Note that this goes with https://github.com/meshtastic/protobufs/pull/706

oscgonfer avatar Jun 16 '25 07:06 oscgonfer

Just tested again with the node I have at hand (seeed-xiao-s3), and I confirm the changes work as intended in my test:

device/sck/mesh12/2/json/LongFast/!da741924
{"channel":0,"from":3665041700,"hop_start":3,"hops_away":0,"id":68397858,"payload":{"relative_humidity":55.9199981689453,"temperature":27.4300003051758},"sender":"!da741924","timestamp":1750065519,"to":4294967295,"type":"telemetry"}

oscgonfer avatar Jun 16 '25 09:06 oscgonfer