Skip to content

Database for telemetry readings#9519

Draft
oscgonfer wants to merge 11 commits intomeshtastic:developfrom
oscgonfer:feat/telemetry-db
Draft

Database for telemetry readings#9519
oscgonfer wants to merge 11 commits intomeshtastic:developfrom
oscgonfer:feat/telemetry-db

Conversation

@oscgonfer
Copy link
Contributor

@oscgonfer oscgonfer commented Feb 3, 2026

This is a proof of concept PR to be elaborated further, but featuring a small database for telemetry. The idea is to create something similar to: https://docs.smartcitizen.me/hardware/firmware/?h=flash#flash-storage

The database contains a set of records in memory, ideally (although not working yet) encoded to protobuf and writable to the FS. This would allow to:

  • Retrieve average/min/max readings for telemetry with admin commands
  • Store delivery status, enforcing retries for certain roles (SENSOR) in which telemetry is interesting
  • Serve as a backup ifor storing data to an sd-card later on (with additional flags)

Current implementation relies on a protobuf definition implemented in meshtastic/protobufs#854
This is simply a PoC, not sure it's a good idea. If moving forward, it'd require work on:

  • Make sure writing / reading works to FS.
  • Writing can be done per GROUPS, keeping a separate index for the currently used group, to avoid writing / reading big groups every time.
  • Improvements to recover data from storage to MQTT for certain roles (SENSOR), to avoid gaps in received packets.

This is currently disabled by default and needs: #define MESHTASTIC_EXCLUDE_AIR_QUALITY_DB 0

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Seeed Studio ESP32-S3 (partially)

@github-actions github-actions bot added needs-review Needs human review enhancement New feature or request labels Feb 3, 2026
@oscgonfer oscgonfer marked this pull request as draft February 3, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review Needs human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant