Add NODE_KITCHEN (0x11) firmware #66

Merged
rob merged 6 commits from feat/kitchen-node into main 2026-09-22 07:35:09 +00:00
Collaborator

First cut of the kitchen node, matching the previous-generation firmware: one PWM under-cabinet strip (fade in 500 ms, fade out 1000 ms) toggled by one capacitive touch pad, plus a stored touch-enable setting like the lighting node's.

It's a XIAO ESP32-S3 rather than the usual C3, for the touch peripheral the C3 lacks. That surfaced two hardware differences from the lighting node's touch handling (still the only other touch node, on a classic ESP32):

  • Touch direction is a SoC fact (SOC_TOUCH_VERSION_1/_2), not a core version as the code previously assumed — touch_input.cpp and the TouchSensor constructor comment now say so.
  • The S3 core's touchSetCycles maps to different units than the classic ESP32's; main.cpp sets the core's own S3 defaults (500, 0xF) with a note that they want tuning on the bench.

Built node_kitchen, node_lighting, node_bathroom and ran pio test -e native (437 cases) — all green. clang-format -i run over touched files.

No protocol change: the spec already carries the 0x11 row and node_ids.h already lists kitchen.

First cut of the kitchen node, matching the previous-generation firmware: one PWM under-cabinet strip (fade in 500 ms, fade out 1000 ms) toggled by one capacitive touch pad, plus a stored touch-enable setting like the lighting node's. It's a XIAO ESP32-S3 rather than the usual C3, for the touch peripheral the C3 lacks. That surfaced two hardware differences from the lighting node's touch handling (still the only other touch node, on a classic ESP32): - Touch direction is a SoC fact (`SOC_TOUCH_VERSION_1`/`_2`), not a core version as the code previously assumed — `touch_input.cpp` and the `TouchSensor` constructor comment now say so. - The S3 core's `touchSetCycles` maps to different units than the classic ESP32's; `main.cpp` sets the core's own S3 defaults (500, 0xF) with a note that they want tuning on the bench. Built `node_kitchen`, `node_lighting`, `node_bathroom` and ran `pio test -e native` (437 cases) — all green. `clang-format -i` run over touched files. No protocol change: the spec already carries the `0x11` row and `node_ids.h` already lists `kitchen`.
Document the kitchen node in README and CLAUDE.md
All checks were successful
Build and test / build (pull_request) Successful in 4m16s
Build and test / release (pull_request) Has been skipped
36315625ae
Claude left a comment

Reviewed against main (base a11d1ac). Built node_kitchen and ran pio test -e native (437 cases) — both clean, and clang-format --dry-run is clean on the touched files.

main.cpp matches the sibling nodes' pattern closely: endpoint indices, PwmConfig field order (relies correctly on the new frequencyHz/resolutionBits defaults rather than overriding them), the touch setup/enable-gate sequence, and the D7 XIAO bus config all line up with node_bathroom/node_lighting. Verified the pin choices against the XIAO ESP32S3 variant header: D0 is GPIO1/T1 (touch-capable), D1/D7–D10 are free GPIOs — no conflicts. Verified setTouchCycles(500, 0xF) against the Arduino core's own TOUCH_PAD_MEASURE_CYCLE_DEFAULT/TOUCH_PAD_SLEEP_CYCLE_DEFAULT for SOC_TOUCH_VERSION_2 — they match exactly. The touch-polarity fix in touch_input.cpp/touch_sensor.h stays correctly inside the existing #if defined(ARDUINO) / SOC_TOUCH_SENSOR_NUM > 0 guard, doesn't leak into board-agnostic runtime paths, and the corrected constructor comment is accurate. node_ids.h, the spec row and the "Adding a controller" checklist items were all already in place or are now covered by this PR.

One thing worth a look:

  • platformio.ini, [xiao] comment: "Both boards are 4 MB. 1.875 MB an app slot..." is now stale — [env:node_kitchen] overrides board to seeed_xiao_esp32s3, which is an 8 MB part (confirmed against the board json), while [lolin32]/the xiao C3 default are both 4 MB. Not a functional bug: min_spiffs.csv is a fixed 4 MB partition table regardless of chip size, so it still flashes and the 1.875 MB app-slot figure is still correct, it just leaves ~4 MB of the S3's flash unpartitioned. Worth a one-line update to the comment (or a note that the kitchen node has flash to spare) so it doesn't read as "every board here is 4 MB" once a reader hits the S3 override just below it.

Minor/optional: onTouch()'s strip.setOn(!strip.isOn(), 0, can::Origin::Manual, now) duplicates LevelEndpoint::manualToggle(uint32_t), which does exactly this. Not introduced by this PR — node_lighting/main.cpp's onTouch() already does the same longhand thing for its three circuits — so it's an existing convention this branch correctly follows, not a defect. Flagging only in case it's worth adopting manualToggle() across all three call sites in a follow-up.

Nothing else stood out. Scope, comment density and the Origin/lockout usage all look right for this repo's conventions.

Reviewed against `main` (base `a11d1ac`). Built `node_kitchen` and ran `pio test -e native` (437 cases) — both clean, and `clang-format --dry-run` is clean on the touched files. `main.cpp` matches the sibling nodes' pattern closely: endpoint indices, PwmConfig field order (relies correctly on the new `frequencyHz`/`resolutionBits` defaults rather than overriding them), the touch setup/enable-gate sequence, and the D7 XIAO bus config all line up with `node_bathroom`/`node_lighting`. Verified the pin choices against the XIAO ESP32S3 variant header: D0 is GPIO1/T1 (touch-capable), D1/D7–D10 are free GPIOs — no conflicts. Verified `setTouchCycles(500, 0xF)` against the Arduino core's own `TOUCH_PAD_MEASURE_CYCLE_DEFAULT`/`TOUCH_PAD_SLEEP_CYCLE_DEFAULT` for `SOC_TOUCH_VERSION_2` — they match exactly. The touch-polarity fix in `touch_input.cpp`/`touch_sensor.h` stays correctly inside the existing `#if defined(ARDUINO)` / `SOC_TOUCH_SENSOR_NUM > 0` guard, doesn't leak into board-agnostic runtime paths, and the corrected constructor comment is accurate. `node_ids.h`, the spec row and the "Adding a controller" checklist items were all already in place or are now covered by this PR. One thing worth a look: - `platformio.ini`, `[xiao]` comment: "Both boards are 4 MB. 1.875 MB an app slot..." is now stale — `[env:node_kitchen]` overrides `board` to `seeed_xiao_esp32s3`, which is an 8 MB part (confirmed against the board json), while `[lolin32]`/the `xiao` C3 default are both 4 MB. Not a functional bug: `min_spiffs.csv` is a fixed 4 MB partition table regardless of chip size, so it still flashes and the 1.875 MB app-slot figure is still correct, it just leaves ~4 MB of the S3's flash unpartitioned. Worth a one-line update to the comment (or a note that the kitchen node has flash to spare) so it doesn't read as "every board here is 4 MB" once a reader hits the S3 override just below it. Minor/optional: `onTouch()`'s `strip.setOn(!strip.isOn(), 0, can::Origin::Manual, now)` duplicates `LevelEndpoint::manualToggle(uint32_t)`, which does exactly this. Not introduced by this PR — `node_lighting/main.cpp`'s `onTouch()` already does the same longhand thing for its three circuits — so it's an existing convention this branch correctly follows, not a defect. Flagging only in case it's worth adopting `manualToggle()` across all three call sites in a follow-up. Nothing else stood out. Scope, comment density and the `Origin`/lockout usage all look right for this repo's conventions.
Note the kitchen node's flash size exception in the xiao comment
Some checks failed
Build and test / release (pull_request) Has been cancelled
Build and test / build (pull_request) Has been cancelled
80fba7d0c5
Clarify the S3 touch-cycles comment
All checks were successful
Build and test / build (pull_request) Successful in 1m7s
Build and test / release (pull_request) Has been skipped
b7783456a9
Author
Collaborator

Final pass: the touch-cycles comment in src/node_kitchen/main.cpp (b778345) reads cleanly now. Nothing else outstanding — clean.

Final pass: the touch-cycles comment in `src/node_kitchen/main.cpp` (b778345) reads cleanly now. Nothing else outstanding — clean.
Use manualToggle for the touch press
All checks were successful
Build and test / build (pull_request) Successful in 1m3s
Build and test / release (pull_request) Has been skipped
c30c5f67fb
rob merged commit 2a45bdef5d into main 2026-09-22 07:35:09 +00:00
rob deleted branch feat/kitchen-node 2026-09-22 07:35:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rob/CampervanControlSystems!66
No description provided.