feat(cli): add telemetry and sensors CLI commands#2826
Open
drewmccal wants to merge 1 commit into
Open
Conversation
Adds two read-only CLI commands to the shared CommonCLI, available on any node with a SensorManager (sensor, repeater, etc.): - `telemetry` — queries current telemetry (battery voltage on the SELF channel plus everything querySensors() reports) and prints each channel with its decoded value and unit, e.g. `ch3 Temperature=22.4C`. - `sensors` — lists the active telemetry channels as an inventory (`ch<N> <Type>`) without values. Both decode the CayenneLPP buffer via the shared LPPReader and format floats with StrHelper::ftoa (embedded `%f` is unreliable). Output mirrors the existing `sensor list` convention: an `N items` header, one line per entry, capped to the reply buffer with a `...` truncation marker. This fills the gap where telemetry could previously only be read over the mesh (companion Request Telemetry); it is now inspectable directly over the serial/admin CLI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two read-only CLI commands to the shared
CommonCLI, so telemetry can be inspected directly over the serial / admin CLI instead of only over the mesh (companion Request Telemetry). Available on any node with aSensorManager(sensor, repeater, etc.).telemetry— queries current telemetry (battery voltage on the SELF channel plus everythingquerySensors()reports) and prints each channel with its decoded value and unit:sensors— lists the active telemetry channels as an inventory, without values:Implementation notes
CommonCLI.cppalongside the existingsensor get/set/listcommands.CayenneLPPbuffer via the sharedLPPReader, and formats floats withStrHelper::ftoa(embeddedsprintf("%f")is unreliable).sensor listconvention: anN itemsheader, one line per entry, capped to the reply buffer with a...truncation marker.telemetryqueriesquerySensors()synchronously, the same as a real telemetry request, so it briefly blocks (e.g. ~750 ms per 1-Wire probe) — expected for a manual command.Testing
Tested on hardware (RAK4631) and confirmed working: both
telemetryandsensorsreturn the expected channels/values over the serial CLI, including battery voltage and a 1-Wire temperature probe. Builds clean for bothRAK_4631_sensorandRAK_4631_repeater(the shared-CLI change is verified for non-sensor node types too).🤖 Generated with Claude Code