Skip to content

Watch a board's lamps under Renode - #792

Open
A13xB0 wants to merge 2 commits into
mainfrom
feat-600-lamps
Open

A13xB0 wants to merge 2 commits into
mainfrom
feat-600-lamps

Conversation

@A13xB0

@A13xB0 A13xB0 commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

For #600. This is the Renode half; the QEMU half needs the fork.

  • Renode side: each declared lamp pin's output is connected back to MeshBenchInputs in the generated platform description (gpio1: 3 -> inputs@35). The peripheral is now an IGPIOReceiver. On a change of level it sends an eight-byte 'L' message (pin, level) over the inputs socket it already holds, and re-sends known levels when the workbench connects.
  • Workbench side: ButtonSender reads the socket back and keeps each lamp's level and change count. They reach NodeStat.Lamps, nodes.stats (lamps, keyed by pin) and the board view.
    • A watched lamp is drawn lit or unlit.
    • Its row says "lit/off, changed N times", or "never driven".
    • An unwatched lamp is still the outline with "no watcher on this pin".
    • engine.LampsWatched is the one rule that decides which.
  • The inputs channel now also opens for a board whose only part is a lamp.

Live test: RAK_4631 v1.17.1 repeater. Both LEDs (pins 35 and 36) change three times at boot and settle off: {"35": {"changes": 3, "lit": false}, "36": {...}}. The repeater build does not flash them on transmit.

Not done:

  • QEMU: mb_lamp.c and the machine wiring in the fork, a release, and a pin bump. ESP32 lamps stay "not modelled" until then.
  • Draining the battery meter as the run goes on, which the issue mentions as a companion change.

Each declared lamp pin's output is connected back to MeshBenchInputs,
which sends an 'L' message with the pin and level over the inputs
socket. The workbench side reads the socket back, keeps each lamp's
level and change count, and they reach NodeStat, nodes.stats and the
board view, which draws a watched lamp lit or unlit.

For #600.

This branch has not been deployed

No deployments
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.

1 participant