Enhancement/telemetry module payload
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)
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 ?
@fifieldt fixed the generated files. sorry for that! Note that this goes with https://github.com/meshtastic/protobufs/pull/706
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"}