Skip to content

Add telemetry component type (rssi, latency, boot_reason) - #332

Open
tyeth wants to merge 7 commits into
v2-displaysfrom
add-telemetry-components
Open

tyeth wants to merge 7 commits into
v2-displaysfrom
add-telemetry-components

Conversation

@tyeth

@tyeth tyeth commented Jun 11, 2026

Copy link
Copy Markdown
Member

Adds a new telemetry class of components: device/host metrics the firmware samples and reports inside a ws.telemetry.Event.

Each telemetry component maps to a ws.telemetry.Type enum value; the broker schedules reporting via ws.telemetry.Add (type, period), and the device maps the enum straight to a reader — no string-name resolution. (Matches the proto enum switch in adafruit/Wippersnapper_Protobuf#215; supersedes the earlier string-name contract from adafruit/Wippersnapper_Protobuf#204.)

What's added

  • components/telemetry/schema.json — component-type schema: telemetryType (enum: TM_RSSI, TM_BOOT_REASON, TM_BOOT_COUNT, TM_LATENCY), valueKind (float/bytes/bool), optional unit, reportOnce, defaultPeriod, plus the common fields.
  • rssi/TM_RSSI, float / dBm, periodic (default 300s).
  • latency/TM_LATENCY, float / ms, periodic. (Renamed from latency_ms; the proto enum dropped the _ms suffix per review.)
  • boot_reason/TM_BOOT_REASON, bytes, report-once (period 0).
  • boot_count/TM_BOOT_COUNT, float, report-once (boot/reset band; a single reading at add time).
  • README: telemetry section documents telemetryType + the enum.

All published: false pending firmware support. Covers the full ws.telemetry.Type set (boot band: boot_reason, boot_count; connectivity/latency band: rssi, latency).

Firmware side

adafruit/Adafruit_Wippersnapper_Arduino#946 consumes the enum; boot_reason is HIL-proven, RSSI plumbing proven.

🤖 Generated with Claude Code

tyeth and others added 2 commits June 11, 2026 19:00
…boot_reason

Adds a new "telemetry" class of components matching adafruit/Adafruit_Wippersnapper_Python#262.
Each telemetry component is a single host/device metric reported as a
ws.telemetry.Event, identified by the name sent in ws.telemetry.Add.

- New components/telemetry/schema.json (telemetryName, valueKind, unit,
  reportOnce, defaultPeriod + common fields)
- rssi (float, dBm, periodic), latency_ms (float, ms, periodic),
  boot_reason (bytes, one-shot / period 0) definitions
- Register telemetry in validate.yml CI matrix and filename regexes

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds telemetry to the repository-structure tree and a "Telemetry" section
under Component Formats, with the field table and rssi / boot_reason examples.

Stacked on top of the telemetry component PR (#332).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread components/telemetry/boot_reason/definition.json
Comment thread components/telemetry/boot_reason/definition.json Outdated
"minLength": 1,
"maxLength": 16
},
"reportOnce": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be included in theAdd message?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in #332

"description": "When true, this metric is reported a single time when added (period 0) rather than on a periodic cadence. Used for one-shot metrics such as boot_reason.",
"type": "boolean"
},
"defaultPeriod": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this redundant? reportOnce already enables a sensor to send a single metric, why would this require a 0 for toggling too? Should be handled by code (dropped if we see reportOnce in the Add payload).

Comment thread components/telemetry/schema.json Outdated
Comment thread components/telemetry/boot_reason/definition.json
tyeth and others added 2 commits July 29, 2026 17:32
docs: document the telemetry component type
…tency

Aligns with the proto enum switch (adafruit/Wippersnapper_Protobuf#215):
telemetry components are now identified by the ws.telemetry.Type enum value
(ws.telemetry.Add.type), not a string name.

- schema.json: telemetryName (string, matched a firmware NAME) -> telemetryType
  (enum: TM_RSSI, TM_BOOT_REASON, TM_LATENCY).
- Rename latency_ms -> latency (TM_LATENCY, dropped the _ms suffix per review);
  unit stays "ms".
- rssi -> TM_RSSI, boot_reason -> TM_BOOT_REASON.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tyeth tyeth changed the title Add telemetry component type (rssi, latency_ms, boot_reason) Add telemetry component type (rssi, latency, boot_reason) Jul 29, 2026
tyeth and others added 3 commits July 29, 2026 17:58
Completes the telemetry set against the ws.telemetry.Type enum: adds the
boot_count metric (TM_BOOT_COUNT, boot/reset band) alongside boot_reason,
rssi, and latency.

- components/telemetry/boot_count/definition.json — float / T_RAW, report-once
  (boot-band metrics report a single reading at add time).
- schema.json: add TM_BOOT_COUNT to the telemetryType enum.
- README: mention boot count.

published:false pending firmware support.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each telemetry component is an abstract metric with no product photo, so add
a simple labeled placeholder image.png (300x225, matching the analog_pin
component's basic image): Wi-Fi RSSI, Broker Latency, Boot Reason, Boot Count.
Updates the README note accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@tyeth tyeth left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this redundant? reportOnce already enables a sensor to send a single metric, why would this require a 0 for toggling too? Should be handled by code (dropped if we see reportOnce in the Add payload).

Dropped in schema, now only OneOf is supported for defaultPeriod or reportOnce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants