From 08b2d9180502226a82a87dbc153e91f45b468ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:14:42 +0100 Subject: [PATCH 01/24] plan: audit 2026-11-19, full, on b015593 (13 findings open) Co-Authored-By: Claude Opus 5.5 --- audits/2026-11-19-audit.md | 127 +++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 audits/2026-11-19-audit.md diff --git a/audits/2026-11-19-audit.md b/audits/2026-11-19-audit.md new file mode 100644 index 00000000..62a0e2ab --- /dev/null +++ b/audits/2026-11-19-audit.md @@ -0,0 +1,127 @@ +# Audit Report — 2026-11-19 + +Audited commit: b015593debedb10daefb64cd59726661532b0947 — branch `master` (merge of PR #89) + +Mode: full + +Plugin rbd 0.16.0. Agents: `audit-traceability`, `audit-coherence`, plus a Markdown documentation pass requested by the user (all tracked `.md` files except `audits/` and `hardware/tinysensor/review/`, checked against the v3.0 KiCad netlist, `emitter/platformio.ini`, the CI workflow, the code and the OpenSCAD models). All three returned valid output. `audits/exclusions.yml` holds 7 exclusions; the entries they cover are not repeated. + +30 raw entries (9 traceability/coherence, 21 documentation) merged into 13 findings and 6 info items. + +## Summary + +| # | Finding | Status | +|---|---------|--------| +| 1 | TECH-HAL-004 says JP6 has a default 1-2 bridge; on v3.0 it is delivered open, and 2-3 wires PA5 to SDO | open | +| 2 | PLAT-POWER-007 is validated for every board but only v3.0 was checked; v2.2 boards are in service | open | +| 3 | The TECH-HAL-004 architecture row omits the PA5 DIDR0 input-buffer disable | open | +| 4 | WIRING.md / VARIANTE_LM35.md: analog input and JP3 described backwards (R4 is not in series, JP3 closed bypasses C3) | open | +| 5 | README.md and CLAUDE.md call the environment protocol "Oregon Scientific v3"; frames are Oregon v2.1 | open | +| 6 | CLAUDE.md says "No pre-push hook" and lists fewer prefixes than README | open | +| 7 | Receiver production board: wiring and enclosure docs say Pro Micro, requirements and architecture say Pro Mini | open | +| 8 | WIRING.md says v2.2 boards share the same connectors | open | +| 9 | Environment, test and CI lists are stale (mushroom, native_cycle_oregon_divider, test_main_cycle, main() description) | open | +| 10 | v2.2-only notes not marked as such (debugWIRE board, remove BME280 to flash, merged branch, J3 drill) | open | +| 11 | BACKLOG.md statuses and references are stale (R8, R19, superseded 2026-11-06 list, R13 line numbers) | open | +| 12 | Module wiring tables lack wire end types and lengths (CLAUDE.md convention) | open | +| 13 | enclosing/README.md shield.3mf objects column incomplete | open | + +## Findings + +### Finding 1 +**Type:** Coherence — precision (C2) +**Requirement:** TECH-HAL-004 +**Issue:** The text says PA5 (MISO) only reaches the ISP header J6 and "pad 3 of the BME280 address jumper JP6 (open with the default 1–2 bridge)". On v3.0, JP6 is delivered open and one side is bridged at assembly (WIRING.md Jumpers table, BOM.md); with 2-3, PA5 is wired to the sensor SDO. PLAT-POWER-003 already allows for that. The reason given for leaving PA5 without a pull-up assumes the 1-2 bridge. +**Status:** open + +### Finding 2 +**Type:** Coherence — precision (C2) +**Requirement:** PLAT-POWER-007 +**Issue:** The requirement states a rule for every board ("Every sensor board pulls its sensor buses … up with external resistors") but its own text says only the v3.0 schematic was checked. The mushroom runs a cut v2.2 board; no doc records which pull-ups a v2.2 board has or which rail they go to, so a v2.2 board cannot be judged against it. Either limit the scope to v3.0 or record the v2.2 pull-ups and rail. +**Status:** open + +### Finding 3 +**Type:** Coherence — architecture coherence (C5) +**Requirement:** TECH-HAL-004 +**Issue:** The `docs/architecture.md` traceability row lists the power reduction, `PORTA = 0` and the PB2/PB3 pull-ups, but not the PA5 digital input buffer disable (`DIDR0` bit `ADC5D`) that the requirement now includes. +**Status:** open + +### Finding 4 +**Type:** Documentation — wrong +**Files:** hardware/tinysensor/WIRING.md:19 and :36, hardware/tinysensor/VARIANTE_LM35.md:117 +**Issue:** "AIN (PA0, through R4 75 Ω)": in the netlist, J7.2, R4.1 and U1.13 are one net (`/Analog_sensor`), so PA0 is direct and R4 runs from PA0 to C3/JP3. "JP3 closed: 1 µF from PA0 to GND, RC filter with R4" is the opposite: JP3 closed shorts C3 and leaves R4 from PA0 to GND (LDR, negative LM35); the R4 + C3 filter exists only with JP3 open. README.md:129 and :134 describe it correctly. +**Status:** open + +### Finding 5 +**Type:** Documentation — wrong +**Files:** README.md:32, CLAUDE.md:45 +**Issue:** "Oregon Scientific v3": the frames use the Oregon v2.1 layout (lib/oregon/Oregon_v3.h, docs/architecture.md, FUNC-OREGON-*). Suggested: "Oregon Scientific v2.1 (class `OregonV3`)". +**Status:** open + +### Finding 6 +**Type:** Documentation — wrong +**File:** CLAUDE.md:136 +**Issue:** "No pre-push hook": the rbd plugin's pre-push hook checks commit prefixes (README.md:75, `.rbd/config.yml` `extra_commit_prefixes`). README also lists `fix:`/`chore:`, CLAUDE.md does not. +**Status:** open + +### Finding 7 +**Type:** Documentation — cross-document contradiction +**Files:** hardware/receiver/WIRING.md:5-7, enclosing/receiver/README.md:3 vs docs/environments.md:61-62, docs/architecture.md:107 and :173, CONF-DECODE-003 +**Issue:** The wiring and enclosure docs build the receiver on a Pro Micro (`promicro`); the requirement, architecture and environments say the Pro Micro is a breadboard prototype and the production receiver is the Pro Mini. Needs a decision, then one side aligned. +**Status:** open + +### Finding 8 +**Type:** Documentation — wrong +**File:** hardware/tinysensor/WIRING.md:5 +**Issue:** "v2.2 boards share the same connectors": v2.2 has the "I2C"/"I2C_SPI" footprints instead of J3/J14, a screw-terminal J13 and no Q1 (BACKLOG.md, REWORK_v2.2.md). +**Status:** open + +### Finding 9 +**Type:** Documentation — stale (and CI coverage) +**Files:** CLAUDE.md:10-11, :30, :60; README.md:48, :52-53, :60; .github/workflows/main.yml:45, :62 +**Issue:** +- the board environment lists leave out `mushroom` (platformio.ini default_envs); +- the native cycle list leaves out `native_cycle_oregon_divider`; +- "CI runs … a build of every board", but the CI matrix has no `mushroom` and does not test `native_cycle_oregon_divider`; +- "Run all native tests: `-e native_debug`" while `test_main_cycle` is ignored there and runs only in `native_cycle_*`; +- "`main()` is a single `while(1)` loop": the cycle is `runCycle(Hal*)`, `main` loops on it (TECH-MAIN-001). + +Fix the docs, and either add both environments to CI (a `conf(CONF-…)` change) or say they are not built there. +**Status:** open + +### Finding 10 +**Type:** Documentation — stale (v2.2-only notes) +**Files:** docs/debugging.md:89, :145-148; CLAUDE.md:65; hardware/tinysensor/REWORK_v2.2.md:76; enclosing/mushroom/README.md:59 +**Issue:** +- "Remove the BME280 before flashing": true for v2.2 only; v3.0 isolates the ISP lines with R9/R10; +- "production boards are not designed for debugWIRE": v3.0 meets the constraints (R5 10 k, no capacitor on RESET), only v2.2 and earlier need the dedicated board; +- "the sleep fix is on branch `hw/schematic-upgrade`": merged long ago (PR #47), flash master; +- J3 holes "Ø0.95": v3.0 drills are 1.05 mm. +**Status:** open + +### Finding 11 +**Type:** Documentation — stale +**File:** hardware/tinysensor/BACKLOG.md:22, :27, :33, :92-100, :108, :111 +**Issue:** R8 still shows as open (handled by C1 220 µF low-leakage, :126); R19 has no status (handled by R9/R10, :123); the 2026-11-06 "Fixed" list still states superseded facts (BT1, "R9 10 kΩ on RESET", C8, C6 0805, M2.5 holes, MH5) without marking; R13 cites old `platformio.ini` line numbers. +**Status:** open + +### Finding 12 +**Type:** Documentation — convention (CLAUDE.md wire rules) +**Files:** hardware/tinysensor/WIRING.md:64-115, hardware/tinysensor/REWORK_v2.2.md:46-50 +**Issue:** The module wiring tables (J2, J1, J3, J5, J7) give a colour only, with no end types and no length; the REWORK W7–W9 table has colour and length but no end types. +**Status:** open + +### Finding 13 +**Type:** Documentation — minor +**File:** enclosing/README.md:29 +**Issue:** The shield.3mf objects column omits "Assiette"; "4 plates" reads as four Orca plates while the project has two (update_3mf.py: `("Abri", [...]), ("Assiettes", ["Assiette"] * 4)`). +**Status:** open + +## Info (no action required) + +- **T1, verified without a test** (inspection, bench, build or CI, stated in each description): CONF-BUILD-003, 007, 011, 014, CONF-DECODE-002..004, FUNC-SENSOR-001, PLAT-POWER-001, 003, 005, 006, 007, PLAT-DECODE-003..005, TECH-HAL-001, 003, 004, 007, TECH-SENSOR-002, TECH-DECODE-003, 005. TECH-DECODE-004 is now tested (`test_luxunit`). No requirement uses the formal `**Verification:**` field yet. +- **T1, bench checks pending:** FUNC-SENSOR-001, TECH-HAL-004, PLAT-POWER-007. +- **T3:** CONF-BUILD-014, CONF-DECODE-002..004, PLAT-POWER-006, PLAT-DECODE-003..005, TECH-HAL-004, TECH-HAL-007 have implementation commits without a test commit, as expected from their verification. Since audit 3, every new requirement has a test and implementation pair. +- **T5:** every validated requirement has an architecture row; draft (FUNC-SENSOR-002, TECH-SENSOR-001, TECH-SERIAL-002) and deprecated (FUNC-X10-003) rows are marked. +- **C3 (info):** CONF-BUILD-002 is validated and describes the DS18B20 selection, while FUNC-SENSOR-002 and TECH-SENSOR-001 are draft; it does not list them as dependencies. +- **Checks with no finding:** T2 (only the TECH-SENSOR-001 tags, excluded by DRAFT-TAG-DS18B20-001), T4 (covered by HIST-PREFIX-001 / SESSION-PREFIX-001), T6a (all 151 test functions tagged), T6b (47 untagged-GWT functions, within TEST-GWT-001), T7, T8 (all requirement IDs linked), no dependency cycle, no broken Markdown link or anchor (REWORK_v2.2.md:58 points to the external Tars project on purpose), BOM.md matches the schematic. From 7a3160097935e71baca60c02c39fa7532acbd811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:47:57 +0100 Subject: [PATCH 02/24] hw: WIRING analog input and JP3 match the netlist, v2.2 differences, wire end types and lengths Audit 2026-11-19 findings 4, 8, 12 (and 10 for REWORK_v2.2: sleep fix is on master). Co-Authored-By: Claude Opus 5.5 --- hardware/tinysensor/REWORK_v2.2.md | 12 +++--- hardware/tinysensor/VARIANTE_LM35.md | 2 +- hardware/tinysensor/WIRING.md | 63 ++++++++++++++-------------- 3 files changed, 39 insertions(+), 38 deletions(-) diff --git a/hardware/tinysensor/REWORK_v2.2.md b/hardware/tinysensor/REWORK_v2.2.md index d52bc88d..e9221a96 100644 --- a/hardware/tinysensor/REWORK_v2.2.md +++ b/hardware/tinysensor/REWORK_v2.2.md @@ -43,11 +43,11 @@ The x = 147 and y = 87 lines cut the ground plane (B.Cu) and two +BATT tracks (F The module planned for J2 ("0.9–3.3 V to 3.3 V") is a boost. With an 18650 at 4.2 V, these modules usually let the input voltage through (≈ 3.9 V), while the BME280 is rated 3.6 V max. It is replaced by the **TPS63020** 3.3 V buck-boost module in stock from the Tars project (26.7 × 17.7 × 1.6 mm, too big for the J2 spot). It is wired: -| Wire | Colour | TPS63020 module | Board | Length | -|---|---|---|---|---| -| W7 | red | VIN | J2 pad 1, +BATT (149.53 ; 57.25) | ~40 mm | -| W8 | black | GND | J2 pad 2, GND (152.07 ; 57.25) | ~40 mm | -| W9 | white | VOUT 3.3 V | J2 pad 3, VCC (154.61 ; 57.25) | ~40 mm | +| Wire | Colour | TPS63020 module | Board | Ends (module / board) | Length | +|---|---|---|---|---|---| +| W7 | red | VIN | J2 pad 1, +BATT (149.53 ; 57.25) | soldered / soldered | ~40 mm | +| W8 | black | GND | J2 pad 2, GND (152.07 ; 57.25) | soldered / soldered | ~40 mm | +| W9 | white | VOUT 3.3 V | J2 pad 3, VCC (154.61 ; 57.25) | soldered / soldered | ~40 mm | - On the module: **EN tied to VIN**, and **PS/SYNC tied to GND** (power-save mode). Otherwise it stays in PWM and draws a few mA. - The module lies flat on top of the board, on double-sided foam tape, checking that no solder joint runs under it. There is plenty of room under the cap. The mushroom model does not plan its spot yet: to add. @@ -73,4 +73,4 @@ It is replaced by the **TPS63020** 3.3 V buck-boost module in stock from the Tar ## Firmware -The sleep fix (R3, R4) is on branch `hw/schematic-upgrade`: flash that version. +The sleep fix (R3, R4) was merged into `master` (PR #47): flash the current `master`. diff --git a/hardware/tinysensor/VARIANTE_LM35.md b/hardware/tinysensor/VARIANTE_LM35.md index ac10f241..cb3738af 100644 --- a/hardware/tinysensor/VARIANTE_LM35.md +++ b/hardware/tinysensor/VARIANTE_LM35.md @@ -38,7 +38,7 @@ Check it on the maker's datasheet. | LM35 | Wired to | |---|---| | +Vs | 5 V module VOUT | -| Vout | J7 pin 2 (analog input, PA0 through R4 75 Ω) | +| Vout | J7 pin 2 (analog input PA0; leave JP3 open: closed, R4 75 Ω would load Vout to GND) | | GND | board GND (J2 pin 2, or J7 pin 3 if JP4 is soldered 2-3) | 5 V module GND: board GND. diff --git a/hardware/tinysensor/WIRING.md b/hardware/tinysensor/WIRING.md index f2fa7244..ad904798 100644 --- a/hardware/tinysensor/WIRING.md +++ b/hardware/tinysensor/WIRING.md @@ -2,7 +2,7 @@ This is the **tinySensor emitter** board (ATtiny84A, `hardware/tinysensor/`). The 433 MHz receiver with OLED is documented separately in [`hardware/receiver/WIRING.md`](../receiver/WIRING.md). -Pin numbers come from the v3.0 schematic (`tinysensor.kicad_sch`, [PDF export](tinysensor_schematic.pdf), netlist exported with `kicad-cli`). v2.2 boards share the same connectors, with the defects and the fixes listed in [`REWORK_v2.2.md`](REWORK_v2.2.md). Build flags per sensor unit: [`docs/environments.md`](../../docs/environments.md). Parts list: [`BOM.md`](BOM.md). +Pin numbers come from the v3.0 schematic (`tinysensor.kicad_sch`, [PDF export](tinysensor_schematic.pdf), netlist exported with `kicad-cli`). v2.2 boards differ: "I2C" / "I2C_SPI" footprints instead of J3/J14, a screw-terminal J13 and no Q1; their defects and fixes are in [`REWORK_v2.2.md`](REWORK_v2.2.md). Build flags per sensor unit: [`docs/environments.md`](../../docs/environments.md). Parts list: [`BOM.md`](BOM.md). ![tinySensor connectors and modules](wiring.svg) @@ -16,7 +16,7 @@ Pin numbers come from the v3.0 schematic (`tinysensor.kicad_sch`, [PDF export](t | J3 | I2C 1 (BME280) | SENSOR_VCC | GND | SCL (PA4 through R9 330 Ω) | 4 SDA (PA6 through R10 330 Ω), 5 n.c., 6 SDO (JP6) | | J14 | I2C 2 | same as J3 | | | | | J5 | OneWire | SENSOR_VCC | GND | DQ (PA3) | | -| J7 | Analog sensor | SENSOR_VCC | AIN (PA0, through R4 75 Ω) | GND with JP4 2-3 | | +| J7 | Analog sensor | SENSOR_VCC | AIN (PA0, direct; R4 75 Ω from PA0 to C3/JP3) | GND with JP4 2-3 | | | J8 | EXT. INT0 | PB2 | GND | | | | J4 | Digital out | PA7 | GND | | | | J6 | ISP | MISO (PA5) | VCC | SCK (PA4, straight) | 4 MOSI (PA6, straight), 5 RESET, 6 GND | @@ -33,7 +33,8 @@ SENSOR_VCC is PA2: J3, J14, J5 and J7 are powered only while the firmware measur | | 1-2 | J3/J14 pin 6 = GND: BME280 in I2C at 0x76, the firmware address | | | 2-3 | pin 6 = MISO, for a sensor in SPI | | JP4 Analog ref | 2-3 | J7 pin 3 = GND (normal use) | -| JP3 | closed | 1 µF from PA0 to GND: RC filter with R4 on the analog input | +| JP3 | open | R4 75 Ω + C3 1 µF from PA0 to GND: RC filter on the analog input (TMP36, positive LM35) | +| | closed | C3 bypassed: R4 from PA0 to GND, as load or reference resistor (LDR, negative LM35) | | JP1 LED | closed | LED D1 on PB1. Leave open on battery to save power. | ## On-board parts (no extra part needed) @@ -61,11 +62,11 @@ Never fit two sources together: they are in parallel and charge each other. ### 3.3 V module on J2 -| Module pin | J2 pin | Colour | -|---|---|---| -| VIN | 1 +BATT | red | -| GND | 2 GND | black | -| VOUT | 3 VCC | white | +| Module pin | J2 pin | Colour | Ends (module / board) | Length | +|---|---|---|---|---| +| VIN | 1 +BATT | red | soldered / Dupont (F) | per build | +| GND | 2 GND | black | soldered / Dupont (F) | per build | +| VOUT | 3 VCC | white | soldered / Dupont (F) | per build | - 18650 (up to 4.2 V) with a BME280 (3.6 V max): **TPS63020 buck-boost**. Tie EN to VIN and PS/SYNC to GND (power-save mode, otherwise it idles at a few mA). Check: 3.20–3.40 V on VCC at 3.7 V and 4.2 V in, idle current < 0.1 mA. - 2×AA/AAA: a 3.3 V boost module, or no module and JP2 closed. @@ -73,24 +74,24 @@ Never fit two sources together: they are in parallel and charge each other. ### Radio on J1 -| Module pin | J1 pin | Colour | -|---|---|---| -| GND | 1 | blue | -| VCC | 2 | white | -| DATA | 3 (PB0) | green | +| Module pin | J1 pin | Colour | Ends (module / board) | Length | +|---|---|---|---|---| +| GND | 1 | blue | Dupont (F) / Dupont (F) | per build | +| VCC | 2 | white | Dupont (F) / Dupont (F) | per build | +| DATA | 3 (PB0) | green | Dupont (F) / Dupont (F) | per build | Module pin orders differ (an FS1000A is DATA/VCC/GND): match the pins by name, not by position. Antenna: 17.3 cm straight wire (λ/4 at 433.92 MHz) on the module ANT pad. In the wall box the module lies flat (J1 pins bent 90°, module over J5/J8, antenna along the wall); standing, the box must be 7.8 mm deeper (`radio_flat = false`). ### BME280 / BMP280 on J3 (or J14) -| Breakout pin | J3 pin | Colour | -|---|---|---| -| VIN | 1 SENSOR_VCC | white | -| GND | 2 GND | blue | -| SCL | 3 SCL | yellow | -| SDA | 4 SDA | green | -| CSB | 5 n.c. | — | -| SDO | 6 SDO (JP6) | green, 1 ring | +| Breakout pin | J3 pin | Colour | Ends (breakout / board) | Length | +|---|---|---|---|---| +| VIN | 1 SENSOR_VCC | white | Dupont (F) / JST-EH (F) | per build | +| GND | 2 GND | blue | Dupont (F) / JST-EH (F) | per build | +| SCL | 3 SCL | yellow | Dupont (F) / JST-EH (F) | per build | +| SDA | 4 SDA | green | Dupont (F) / JST-EH (F) | per build | +| CSB | 5 n.c. | — | — | — | +| SDO | 6 SDO (JP6) | green, 1 ring | Dupont (F) / JST-EH (F) | per build | - Mushroom: no wire, the breakout's 6-pin male header plugs into a 6-way 2.54 mm female header soldered under the board in J3. - CSB is not connected on the board: the breakout must pull it up (≈ 10 kΩ to VIN), otherwise the sensor starts in SPI. Check with a meter; if it is missing, add 10 kΩ from CSB to VIN on the breakout. The working v2.2 mushroom board has such a 10 kΩ on CSB. @@ -98,21 +99,21 @@ Module pin orders differ (an FS1000A is DATA/VCC/GND): match the pins by name, n ### DS18B20 on J5 -| DS18B20 pin (TO-92, flat face, legs down, left to right) | J5 pin | Colour | -|---|---|---| -| GND | 2 GND | blue | -| DQ | 3 DQ (PA3) | green | -| VDD | 1 SENSOR_VCC | white | +| DS18B20 pin (TO-92, flat face, legs down, left to right) | J5 pin | Colour | Ends (sensor / board) | Length | +|---|---|---|---|---| +| GND | 2 GND | blue | soldered / Dupont (F) | per build | +| DQ | 3 DQ (PA3) | green | soldered / Dupont (F) | per build | +| VDD | 1 SENSOR_VCC | white | soldered / Dupont (F) | per build | The sensor order (GND, DQ, VDD) is not the J5 order (VCC, GND, DQ): cross the wires. Pull-up R6 is on the board. ### Analog sensor on J7 -| Sensor pin | J7 pin | Colour | -|---|---|---| -| +Vs | 1 SENSOR_VCC | white | -| Vout | 2 AIN (PA0) | brown | -| GND | 3 (JP4 2-3) | blue | +| Sensor pin | J7 pin | Colour | Ends (sensor / board) | Length | +|---|---|---|---|---| +| +Vs | 1 SENSOR_VCC | white | soldered / Dupont (F) | per build | +| Vout | 2 AIN (PA0) | brown | soldered / Dupont (F) | per build | +| GND | 3 (JP4 2-3) | blue | soldered / Dupont (F) | per build | A TMP36 runs from SENSOR_VCC. An LM35 needs 4 V minimum: on 2×AA/AAA, power it from a 5 V boost switched by PB2 on J8, see [`VARIANTE_LM35.md`](VARIANTE_LM35.md) (`USE_SWITCHED_5V`). From af78a1507d4e1a72f808d6c45f751570a86d9e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:47:57 +0100 Subject: [PATCH 03/24] hw: BACKLOG statuses (R8 done, R19 in progress), superseded 2026-11-06 items marked, R13 refs by env Audit 2026-11-19 finding 11. Co-Authored-By: Claude Opus 5.5 --- hardware/tinysensor/BACKLOG.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hardware/tinysensor/BACKLOG.md b/hardware/tinysensor/BACKLOG.md index 9236a580..d3abdb34 100644 --- a/hardware/tinysensor/BACKLOG.md +++ b/hardware/tinysensor/BACKLOG.md @@ -19,18 +19,18 @@ Full reports, ERC/DRC and images: `review/2026-11-06/`. Rework of the already-bu | R5 | ✅ v3.0 (Major) | LED | D1 is fitted backwards (anode on GND, cathode towards R1/PB1), and the PCB footprint matches that mistake. The firmware drives PB1 high to light it, so the LED never lights. | Flip D1 in the schematic and the PCB. | S | | R6 | ✅ v3.0 (Major) | Sync | The schematic is no longer the reference. Commit c8df224 added I2C and I2C_SPI (6-pin JST-EH), JP5, JP6 and the BH-18650 holder in the PCB only. J3, J11, J12 and MH3 are missing from the PCB, and MH1 is duplicated there. Two unconnected pads remain: JP6 to MISO, and I2C.6 to the GND zone. The 18650 − pole seems to have no net. | Carry these items into the schematic, then run "Update PCB from Schematic" until parity is clean. Check the 18650. | M | | R7 | ✅ v3.0 (Minor) | MCU | RESET has no external pull-up: only the weak internal one and a button. | 10 k to VCC, no capacitor, to stay debugWIRE compatible. | S | -| R8 | Minor | Power | The global decoupling (2 × 10 µF) is weak for a CR2032, whose internal resistance is 10–20 Ω, against the radio current peak. | 100–470 µF low-leakage for the CR2032 versions. | S | +| R8 | ✅ v3.0 (Minor) | Power | The global decoupling (2 × 10 µF) is weak for a CR2032, whose internal resistance is 10–20 Ω, against the radio current peak. | 100–470 µF low-leakage for the CR2032 versions. ✅ v3.0: C1 220 µF low-leakage for a CR2032 (2026-11-18). | S | | R9 | ✅ v3.0 (Minor) | Power | JP2 "DIRECT Vcc" shorts the DC-DC input to its output if J2 is fitted. | Note "JP2 closed ⇒ J2 not fitted". The firmware must then use `BATTERY_IS_VCC`. | S | | R10 | Question | Power | The J2 DC-DC module has no enable pin. Its quiescent current (often 10–100 µA) probably exceeds the sleeping ATtiny's. | **Decided (2026-11-07):** TPS63020 buck-boost module (Tars stock), wired to the J2 pads as in `REWORK_v2.2.md`. ◐ v3.0: J2 becomes a 1×03 header (1 +BATT, 2 GND, 3 VCC) on the same pads; v3.0 choice (2026-11-07): 2 AA or AAA cells on J13 and a 3.3 V boost module (in stock) on J2. A boost does not regulate if Vin > 3.3 V: with an 18650 (BT1), the TPS63020 buck-boost is needed. Without BME280 (DS18B20 on J5 or 3-pin analog sensor on J7, both up to 5.5 V), an 18650 with a boost is fine. v3.0 silkscreen: "18650: TPS63020, or boost without BME280". Measure its idle current (< 0.1 mA). | M | | R11 | ✅ v3.0 (Question) | I2C | The BME280 CSB pin (J3.5) is floating; if seen low, the sensor goes into SPI. SDO is on GND, hence address 0x76, matching the firmware. | Tie CSB to SENSOR_VCC, or check that the breakout pulls it up. SDO selects the address in I2C (GND = 0x76, the firmware's), and is the data output in SPI: decided, it is an assembly-time choice through JP6 (see P4), with a note on the schematic. Beware: PA5 has no pull-up (`PORTA = 0`, TECH-HAL-004), so SDO wired to MISO (JP6 2-3) in I2C would float and leave the address undefined. | S | | R12 | Question | I2C | The BH1750 (`USE_BH1750`, 0x23, env SOLAR_TEST) does not appear in the schematic. | Document it on the second I2C connector once R6 is done, with ADDR at 0. | S | -| R13 | Question | Power | `USE_CHARGE_PUMP` (`platformio.ini:66`, `:81`) is used by no code and matches no circuit. The TP4056 charger is not in the schematic. | Drop the flag or document the hardware concerned. | S | +| R13 | Question | Power | `USE_CHARGE_PUMP` (`platformio.ini`, envs `S_02` and `S_03`) is used by no code and matches no circuit. The TP4056 charger is not in the schematic. | Drop the flag or document the hardware concerned. | S | | R14 | Question | MCU | The fuses are not recorded, BODLEVEL in particular. The firmware turns the BOD off during sleep. | Record the intended fuses in the repository (BOD 1.8 V at 1 MHz). | S | | R15 | ◐ v3.0 (Minor) | Libraries | `fp-lib-table` points to `battery.pretty` and `Chinese breakouts.pretty`, which are missing. `sym-lib-table` declares a Legacy library that does not exist. J13 uses a footprint removed from KiCad, and J1/J3/J4 removed `Conn_*_Male/Female` symbols. U1 and J6 come from `-rescue.lib`. The file is in KiCad 7 format. | Clean the tables. Use standard symbols and footprints (`ATtiny84A-P`, `AVR-ISP-6`, `Conn_01x0N_Pin/Socket`, `TerminalBlock_Phoenix` 5.08), then "Update Symbols from Library". | S–M | | R16 | ◐ v3.0 (Minor) | Connectors | J1 is wired GND/VCC/DATA, while an FS1000A is DATA/VCC/GND. J5 is wired VCC/GND/DQ, while a TO-92 DS18B20 is GND/DQ/VDD. ISP pad 1 is round, so nothing marks it. | Pin functions on the silkscreen, and a square pad 1 on the ISP. | S | | R17 | ◐ v3.0 (Minor) | Hygiene | Values "4,7k" and "4k7" mixed. JP3 has value "~". C5, a 1 nF ceramic, uses a tantalum footprint, and C6 (0.1 µF) a polarised symbol. The R4 note (75R or 18k) is unclear. A wire dangles at (54.61 ; 120.65). The title block says Rev 2.3, the board v2.2. | Normalise values, switch C5 to `C_Disc`, delete the wire. | S | | R18 | Evolution | v2.3 | Ideas for a v2.3: ATtiny84A-SSU or ATtiny1614 (UPDI, hardware TWI, low-power RTC), OOK emitter for 1.8–3.6 V (STX882, SYN115), nano-power boost with enable, ideal-diode protection, switched divider. | — | L | -| R19 | Major | ISP / I2C | ISP fails while a BME280 is plugged into the I2C connector (seen on the mushroom, 2026-11-16). SCK/MOSI are SCL/SDA, and the R2/R3 pull-ups go to SENSOR_VCC (PA2), unpowered while the MCU is in reset: the programmer's SCK/MOSI back-power the sensor rail through the pull-ups and the sensor's ESD diodes, and sync fails. Workaround: remove the sensor to flash (`docs/debugging.md`). | Isolate the sensor connector from the ISP lines during programming: series resistors (~1 k) on SCL/SDA towards the connector, or a jumper / analog switch; or move the pull-ups to VCC. Check on the bench before choosing. | S–M | +| R19 | ◐ v3.0 (Major) | ISP / I2C | ISP fails while a BME280 is plugged into the I2C connector (seen on the mushroom, 2026-11-16). SCK/MOSI are SCL/SDA, and the R2/R3 pull-ups go to SENSOR_VCC (PA2), unpowered while the MCU is in reset: the programmer's SCK/MOSI back-power the sensor rail through the pull-ups and the sensor's ESD diodes, and sync fails. Workaround: remove the sensor to flash (`docs/debugging.md`). | Isolate the sensor connector from the ISP lines during programming: series resistors (~1 k) on SCL/SDA towards the connector, or a jumper / analog switch; or move the pull-ups to VCC. Check on the bench before choosing. ◐ v3.0: R9/R10 330 Ω in series on SCL/SDA (2026-11-18); bench check pending. | S–M | Not checked: the breakouts' internal pull-ups, the real DC-DC quiescent current, the fuse values. @@ -89,15 +89,15 @@ DRC with schematic parity: 0 footprint errors, 0 unconnected pads. The only rema **Fixed:** - **R5/P10:** D1 rotated. - **R1:** PA1 goes through the R7/R8 1 MΩ divider, with C7 100 nF; the pin reads Vbatt / 2 (see F1). -- **R2:** Q1 (AO3401A) protects against reversal on J13 and BT1. +- **R2:** Q1 (AO3401A) protects against reversal on J13 and BT1. *(superseded 2026-11-18)* - **P1:** the sensor connectors' ground is tied to the plane. -- **P2:** BT1 18650 is wired, its − pole on GND. +- **P2:** BT1 18650 is wired, its − pole on GND. *(superseded 2026-11-18)* - **R6/P3:** J3 and J14 replace the PCB "I2C" and "I2C_SPI" connectors. J11, J12 and JP5 are deleted, and the duplicate MH1 becomes MH3. -- **R11/P4:** JP6 selects SDO (pin 6), with 1-2 = GND by default and 2-3 = MISO. -- **R7:** R9 10 kΩ pull-up on RESET. -- **P13:** C8 100 nF at the radio. -- **P8:** C6 becomes an 0805 on top. -- **P11:** 2.7 mm M2.5 holes. +- **R11/P4:** JP6 selects SDO (pin 6), with 1-2 = GND by default and 2-3 = MISO. *(superseded 2026-11-18)* +- **R7:** R9 10 kΩ pull-up on RESET. *(superseded 2026-11-18)* +- **P13:** C8 100 nF at the radio. *(superseded 2026-11-18)* +- **P8:** C6 becomes an 0805 on top. *(superseded 2026-11-18)* +- **P11:** 2.7 mm M2.5 holes. *(superseded 2026-11-18)* - **P16:** 1.05 mm drills. - **P6:** 0.5 mm between copper and edge. - **P5 (partly):** no ground plane along the cut lines. Two GND bridges cross these strips, and two +BATT tracks still run through them. @@ -105,10 +105,10 @@ DRC with schematic parity: 0 footprint errors, 0 unconnected pads. The only rema - **R15 (partly):** library tables cleaned, and the J13 and BT1 footprints copied into `library/`. **Still open for v3.0:** -- **P7:** ✅ J2 is a 1×03 header (`scripts/v3_j2_header.py`), MH5 stays reachable. +- **P7:** ✅ J2 is a 1×03 header (`scripts/v3_j2_header.py`), MH5 stays reachable. *(superseded 2026-11-18)* - **P12:** J2 and J13 stay close to x = 147. - **P15:** +BATT tracks to widen. -- **R8, R12, R13, R14, R18/P20:** not handled. +- **R12, R13, R14, R18/P20:** not handled (R8 handled 2026-11-18, R19 in progress: see below). - **R16:** square pad 1 on the ISP. - **R17:** R4 note and dangling wire. - **Hygiene:** 28 footprints no longer match their library version, and the inherited (rescue) symbols are to replace. From b45a96634c7bf74baefcd4a61c06b0916fb06111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:47:57 +0100 Subject: [PATCH 04/24] docs: Oregon v2.1, pre-push hook prefixes, env and test lists, v2.2-only flashing and debugWIRE notes, shield.3mf objects Audit 2026-11-19 findings 5, 6, 9 (docs), 10, 13. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 19 ++++++++++--------- README.md | 11 ++++++----- docs/debugging.md | 6 +++--- enclosing/README.md | 2 +- enclosing/mushroom/README.md | 2 +- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0b96df96..fb5d2242 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,8 +7,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co PlatformIO is the build system. The emitter firmware is the PlatformIO project in `emitter/` (`src/`, `include/`, `test/`, `platformio.ini`); `lib/` at the repository root is shared with the receiver `tinyDecoders/`. On this machine `pio` runs as `uvx --from platformio pio`. Run from the repository root: ```bash -# Run all native tests (fast — runs on host, no hardware needed) -pio test -d emitter -e native_debug +# Run all native tests (fast — runs on host, no hardware needed). +# native_debug ignores test_main_cycle, which runs in the native_cycle_* environments. +pio test -d emitter -e native_debug -e native_cycle_oregon -e native_cycle_oregon_vcc -e native_cycle_oregon_divider -e native_cycle_lacrosse -e native_cycle_x10 # Run a single test suite pio test -d emitter -e native_debug -f test_oregon @@ -27,7 +28,7 @@ Paths below without a folder (`src/`, `include/`, `test/`, `platformio.ini`) are ## Architecture -The firmware is entirely build-time configured: every physical sensor unit is a separate PlatformIO environment (`S_02`–`S_05`, `robot`, `devmodule`, `SOLAR_TEST`), each with its own `build_flags` selecting the protocol, sensor type, calibration values, and sleep interval. There is no runtime configuration. +The firmware is entirely build-time configured: every physical sensor unit is a separate PlatformIO environment (`S_02`–`S_05`, `robot`, `devmodule`, `SOLAR_TEST`, `mushroom`), each with its own `build_flags` selecting the protocol, sensor type, calibration values, and sleep interval. There is no runtime configuration. ### HAL abstraction @@ -42,7 +43,7 @@ Protocol encoders receive a `Hal*` at construction and call only HAL methods — | Library | Class | Protocol | Output | |---|---|---|---| -| `lib/oregon` | `OregonV3` | Oregon Scientific v3 | 433 MHz OOK via `RadioGoHigh/Low` | +| `lib/oregon` | `OregonV3` | Oregon Scientific v2.1 (frame layout; the class keeps its old name) | 433 MHz OOK via `RadioGoHigh/Low` | | `lib/LacrosseWS7000` | `LacrosseWS7000` | Lacrosse WS7000 | same | | `lib/x10` | `x10rf` | X10 RF | same — used for battery/analog reporting | | `lib/softSerial` | `SoftSerial` | UART (debug only) | via `SerialWriteBit` | @@ -51,17 +52,17 @@ Protocol encoders receive a `Hal*` at construction and call only HAL methods — ### Test approach -Tests run on the host (`-e native_debug`, `-DNATIVE`). The test harness instantiates `TestHal_` and passes it to the encoder under test. Protocol correctness is verified by checking the `Orders` vector against expected character sequences — e.g., a zero bit must produce `{'H','D','L','P','H','D'}`. This verifies timing ordering without hardware. +Tests run on the host (`-e native_debug` and the `native_cycle_*` environments, `-DNATIVE`). The test harness instantiates `TestHal_` and passes it to the encoder under test. Protocol correctness is verified by checking the `Orders` vector against expected character sequences — e.g., a zero bit must produce `{'H','D','L','P','H','D'}`. This verifies timing ordering without hardware. -Test suites: `test_oregon`, `test_lacrosseWS7000`, `test_x10`, `test_conversionTools`, `test_analogFiltering`, `test_power`, `test_led`, `test_softSerial`, `test_ds18b20`, `test_x10_hal`, `test_environment`, `test_main_cycle`. +Test suites: `test_oregon`, `test_lacrosseWS7000`, `test_x10`, `test_conversionTools`, `test_analogFiltering`, `test_power`, `test_led`, `test_softSerial`, `test_ds18b20`, `test_x10_hal`, `test_environment`, `test_main_cycle` (only in `native_cycle_*`). ### `src/main.cpp` -`main()` is a single `while(1)` loop: power on sensors → `ReadEnvironment()` fills a `Measurements` (`include/Measurements.h`) → X10 meters → luminosity → environment frame → power off → hibernate. The environment protocol is a build-time alias, `EnvironmentEncoder` (`include/EnvironmentEncoder.h`), loaded with `ApplyMeasurements()` — no virtual call. Luminosity (`LightSensor`, BH1750) always goes out through a dedicated Lacrosse encoder. Sensor selection stays via `#ifdef` (`USE_BMP280` / `USE_BME280` / `USE_DS18B20` / `USE_BH1750`); wrappers (`BMx280`, `Ds18b20`, `LightSensor`) take a `Hal*` and stub out on native builds. Details: `docs/architecture.md`, section *Main loop structure*. +`main()` loops on `runCycle(&hal)`; one cycle: power on sensors → `ReadEnvironment()` fills a `Measurements` (`include/Measurements.h`) → X10 meters → luminosity → environment frame → power off → hibernate. The environment protocol is a build-time alias, `EnvironmentEncoder` (`include/EnvironmentEncoder.h`), loaded with `ApplyMeasurements()` — no virtual call. Luminosity (`LightSensor`, BH1750) always goes out through a dedicated Lacrosse encoder. Sensor selection stays via `#ifdef` (`USE_BMP280` / `USE_BME280` / `USE_DS18B20` / `USE_BH1750`); wrappers (`BMx280`, `Ds18b20`, `LightSensor`) take a `Hal*` and stub out on native builds. Details: `docs/architecture.md`, section *Main loop structure*. ### Debugging -Step-debugging uses PlatformIO + AVaRICE + AVR Dragon over debugWIRE (the legacy Atmel Studio tree was removed). Toolchain, DWEN fuse procedure and hardware constraints (dedicated debug board) are in [`docs/debugging.md`](docs/debugging.md). +Step-debugging uses PlatformIO + AVaRICE + AVR Dragon over debugWIRE (the legacy Atmel Studio tree was removed). Toolchain, DWEN fuse procedure and hardware constraints (v3.0 meets them with R5 10 kΩ and no RESET capacitor; v2.2 and earlier need a dedicated debug board) are in [`docs/debugging.md`](docs/debugging.md). ### RBD workflow @@ -133,7 +134,7 @@ Current-limiting and pull resistors sit **at the board end**, never at the LED o Strip EXIF/GPS from every image before committing: `python3 ~/.claude/skills/hardware-change/scripts/strip_exif.py ` (`--check` to verify). ### Commits -No pre-push hook; prefixes are the RBD ones above plus `hw:` for hardware (`enclosing/`, `hardware/`) and `docs:` for doc-only commits. Make granular commits, one per area, and push after each. +The rbd plugin's pre-push hook (a Claude Code hook on `git push`) checks the prefixes. It accepts the RBD ones above (`req()`…`arch()` must cite a validated ID), `plan:`, `hw:` for hardware (`enclosing/`, `hardware/`, from `.rbd/config.yml` `extra_commit_prefixes`), `docs:` for doc-only commits, and `fix:`, `chore:`, `style:`, `refactor:`. Make granular commits, one per area, and push after each. ## Modeling diff --git a/README.md b/README.md index 0dad895f..f7536fb9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Large part of the code, especially wireless encoders, are unit-tested. * "one pin" emitters. Tested with low-cost 433 MHz emitters. ## Wireless protocols -* Environment frame (temperature, humidity, pressure): Oregon Scientific v3 **or** Lacrosse WS7000, at most one per build. A build without either sends no environment frame. +* Environment frame (temperature, humidity, pressure): Oregon Scientific v2.1 (class `OregonV3`) **or** Lacrosse WS7000, at most one per build. A build without either sends no environment frame. * Luminosity: always a dedicated Lacrosse WS7000 frame (Oregon has no light frame), so `LACROSSE_ID` is required whenever the BH1750 is fitted. * Battery level and analog input: optional X10 RFXmeter frames, not sent when the battery is low. @@ -45,19 +45,20 @@ Various libraries are used here, and some where tweaked to remove any Arduino de ## Development -The firmware is built with [PlatformIO](https://platformio.org/) and configured entirely at build time: each physical sensor is one PlatformIO environment (`S_02`…`S_05`, `robot`, `devmodule`, `SOLAR_TEST`) whose `build_flags` select protocol, sensors and calibration. See [docs/environments.md](docs/environments.md) to calibrate or add a board. +The firmware is built with [PlatformIO](https://platformio.org/) and configured entirely at build time: each physical sensor is one PlatformIO environment (`S_02`…`S_05`, `robot`, `devmodule`, `SOLAR_TEST`, `mushroom`) whose `build_flags` select protocol, sensors and calibration. See [docs/environments.md](docs/environments.md) to calibrate or add a board. ```bash pio test -d emitter -e native_debug # encoder and library unit tests, on the host pio test -d emitter -e native_cycle_oregon # one measurement cycle (runCycle) per build variant; - # also native_cycle_oregon_vcc, _lacrosse, _x10 + # also native_cycle_oregon_vcc, _oregon_divider, + # _lacrosse, _x10 pio run -d emitter -e S_02 # firmware for one board pio run -d emitter -e S_02 -t upload # flash it ``` > **Flashing with a BME280 plugged in.** ISP and I2C share the ATtiny84A pins PA4 (SCK / SCL) and PA6 (MOSI / SDA). On **v3.0**, R9 and R10 (330 Ω) sit in series between the MCU and the sensor connectors J3/J14, so the programmer drives SCK and MOSI without the sensor holding them: the board should flash with the BME280 in place (not yet checked on a built board). On **v2.2 and earlier**, unplug the BME280 before flashing, otherwise flashing fails; always wire it through its JST connector, never solder it to the board. -CI runs the native tests, compile-fail checks for invalid flag combinations (`emitter/test/compile_fail/`), sensor-variant checks (`emitter/test/build_variants/`), `clang-format` and a build of every board. +CI runs the native tests (`native_debug` and every `native_cycle_*`), compile-fail checks for invalid flag combinations (`emitter/test/compile_fail/`), sensor-variant checks (`emitter/test/build_variants/`), `clang-format` and a build of every board (including `mushroom`). * Architecture: [docs/architecture.md](docs/architecture.md) * Step debugging over debugWIRE: [docs/debugging.md](docs/debugging.md) @@ -72,7 +73,7 @@ The cycle for each change: 1. **Requirement.** The change is first written as a requirement with an ID such as `FUNC-OREGON-001` (category, domain, number), a status (`validated` or `draft`) and its dependencies. 2. **Tests.** Tests are written next. Each Unity test function carries the ID it verifies on the line above it: `// @req FUNC-OREGON-001`. Requirements that no host test can observe (AVR registers, wiring, bench measurements) say instead how they are verified: by inspection, by a build, or on the bench. 3. **Code.** The code then makes the tests pass. The linter (`clang-format` 18.1.8) and the full native test suite must pass before each commit. -4. **Commit.** Each commit names what it serves: `req(ID):`, `test(ID):`, `feat(ID):`, `tech(ID):`, `conf(ID):` or `arch(ID):`; `plan:` for workflow files; `hw:`, `docs:`, `fix:` or `chore:` outside the code cycle. A pre-push hook rejects a code commit whose ID is missing or not `validated`. +4. **Commit.** Each commit names what it serves: `req(ID):`, `test(ID):`, `feat(ID):`, `tech(ID):`, `perf(ID):`, `ui(ID):`, `conf(ID):` or `arch(ID):`; `plan:` for workflow files; `hw:`, `docs:`, `fix:`, `chore:`, `style:` or `refactor:` outside the code cycle (`hw:` is added in `.rbd/config.yml`, `extra_commit_prefixes`). The rbd plugin's pre-push hook rejects any other prefix, and a code commit whose ID is missing or not `validated`. `git log --grep FUNC-MAIN-001` and `grep -rn FUNC-MAIN-001 emitter/test` show where a requirement was written, tested and implemented. diff --git a/docs/debugging.md b/docs/debugging.md index ced320cd..d2c12eeb 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -21,7 +21,7 @@ Two ways, both over the 6-pin ISP connector: - **USB driver:** PlatformIO's avrdude 6.3 talks to the Dragon through libusb only. With the Atmel/Microchip (Jungo) driver, it fails with `usbdev_open(): did not find any USB device "usb" (0x03eb:0x2107)` and still prints `avrdude done. Thank you.`. Fix once with [Zadig](https://zadig.akeo.ie): *Options → List All Devices*, pick **AVR Dragon** (`03EB 2107`), install **libusb-win32**, replug. Microchip Studio no longer sees the Dragon afterwards (reinstall the Atmel driver from the Device Manager to go back). - **Check the exit code**, not the last line: avrdude ends with `done. Thank you.` even on failure. Under Git Bash its messages only show when stderr is redirected to a file (`2> avrdude.err`). -- **Remove the BME280 (or any I2C sensor) before flashing.** SCK/MOSI are SCL/SDA, and the I2C pull-ups R2/R3 go to SENSOR_VCC (PA2), which is unpowered while the chip is held in reset. Driving SCK/MOSI then back-powers the sensor rail through the pull-ups and the sensor's protection diodes, and the Dragon fails with `ISP activation failed` / `RSP_DEBUGWIRE_SYNC_FAILED`, even with VCC and RESET at 3.3 V and a slow clock (`-B32`). Hardware fix: BACKLOG R19. In the mushroom, this means opening the gill disc for every flash. +- **v2.2 and earlier: remove the BME280 (or any I2C sensor) before flashing.** SCK/MOSI are SCL/SDA, and the I2C pull-ups R2/R3 go to SENSOR_VCC (PA2), which is unpowered while the chip is held in reset. Driving SCK/MOSI then back-powers the sensor rail through the pull-ups and the sensor's protection diodes, and the Dragon fails with `ISP activation failed` / `RSP_DEBUGWIRE_SYNC_FAILED`, even with VCC and RESET at 3.3 V and a slow clock (`-B32`). Hardware fix: BACKLOG R19, R9/R10 330 Ω on v3.0, where the sensor should stay in place (bench check pending). In the v2.2 mushroom board, this means opening the gill disc for every flash. - **Replug the Dragon after a failed sync:** it then answers `sign-on command: status -1` to everything until it is unplugged from USB. - Read before writing: `avrdude -P usb -B8 -pt84 -cdragon_isp -C /avrdude.conf -U lfuse:r:-:h` prints the signature (`0x1e930c`) and Vtarget. If the fuses already read `DF`/`62`/`FF`, flash only (`-U flash:w::i`, verified by default). @@ -75,9 +75,9 @@ If debugWIRE no longer answers: HVSP at 12 V (tolerance ~11.5–12.5 V), support - Fuses and lock bits unreachable during the session. - Chip erase (`-e`) impossible in debugWIRE mode. -## Hardware constraints — dedicated debug board +## Hardware constraints — debug board -Production boards are not designed for debugWIRE. A dedicated debug board is needed with: +v3.0 boards meet these constraints (R5 10 kΩ RESET pull-up, no capacitor on RESET). v2.2 and earlier boards are not designed for debugWIRE: they need a dedicated debug board with: - **/RESET without a capacitor** (the line carries the debugWIRE signal). - **/RESET pull-up ≥ 10 kΩ** (or no external resistor; do not use a lower value). diff --git a/enclosing/README.md b/enclosing/README.md index d172bde0..ef4af8e2 100644 --- a/enclosing/README.md +++ b/enclosing/README.md @@ -26,7 +26,7 @@ Ready-to-slice parts: **one OrcaSlicer project per model**, next to its `.scad`, | Project | Plates | Objects | |---|---|---| | `basic/box.3mf` | Fond extérieur, Fond intérieur, Couvercle | print only one of the two bases: `ext` (cable gland, outdoor) or `int` (vents, indoor) | -| `basic/shield.3mf` | Abri, Assiettes | Chapeau, Fond, Clip (optional); 4 plates | +| `basic/shield.3mf` | Abri, Assiettes | Abri: Chapeau, Fond, Clip (optional); Assiettes: Assiette × 4 | | `basic/stand.3mf` | Mât, Pied | table stand, optional | | `receiver/receiver.3mf` | Pupitre | Coque, Fond | | `mushroom/mushroom.3mf` | Ailettes, Hat, White buttons, Ground, Divers, Foot, Support | Chapeau, Lamelles, Châssis, Pied, Sol, Berceau, Bouchon, Pois | diff --git a/enclosing/mushroom/README.md b/enclosing/mushroom/README.md index 50bc8982..a8e62ba4 100644 --- a/enclosing/mushroom/README.md +++ b/enclosing/mushroom/README.md @@ -56,7 +56,7 @@ The top-view outline is a convex ellipse, `ell_ratio` = minor / major axis (0.8 Printable A4 plan: [`faisceau_champignon.pdf`](faisceau_champignon.pdf) (generated by `python3 harness.py`). Board connectors: [`hardware/tinysensor/WIRING.md`](../../hardware/tinysensor/WIRING.md). -**Sensor, no wire.** The BME280 breakout (6 pins VIN GND SCL SDA CSB SDO, ~15 × 11 mm) plugs its male header straight into a **2.54 mm 1×6 female header** soldered under the board, in the J3 ("I2C 1") footprint (6-pin JST-EH, 2.50 pitch: 0.2 mm cumulated offset over 6 positions, absorbed by the play of the Ø0.95 holes). +**Sensor, no wire.** The BME280 breakout (6 pins VIN GND SCL SDA CSB SDO, ~15 × 11 mm) plugs its male header straight into a **2.54 mm 1×6 female header** soldered under the board, in the J3 ("I2C 1") footprint (6-pin JST-EH, 2.50 pitch: 0.2 mm cumulated offset over 6 positions, absorbed by the play of the Ø1.05 holes of v3.0). - Positions 1-4 = SENSOR_VCC, GND, SCL, SDA = VIN, GND, SCL, SDA. - Position 5 not connected = CSB: the breakout pull-up keeps the I2C mode. From c2419cae57d7700ae87ceb41c8930184e10131bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:52:35 +0100 Subject: [PATCH 05/24] req(TECH-HAL-004): JP6 delivered open (1-2 I2C 0x76, 2-3 SDO to PA5); bench check done on the v2.2 mushroom Audit 2026-11-19 finding 1. User: "les pullups sont sur SENSOR_VCC, le capteur fonctionne". Co-Authored-By: Claude Opus 5.5 --- requirements/technical.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/technical.md b/requirements/technical.md index a5171101..ca99a0c1 100644 --- a/requirements/technical.md +++ b/requirements/technical.md @@ -31,7 +31,7 @@ **Title:** Attiny84aHal constructor disables Timer1, ADC, and analog comparator; no pull-up on PORTA, PA5 digital input buffer off, pull-ups on PB2 and PB3 **Status:** validated **Dependencies:** [PLAT-POWER-007](platform.md#plat-power-007) -**Description:** `Attiny84aHal()` calls `UseLessPowerAsPossible()`, which sets `DDRA`/`DDRB` to 0, sets `PORTA = 0` (no internal pull-up on any PORTA pin) and `PORTB = 0b11111100` (pull-ups on PB2 and PB3, the only other PORTB pins: PB4–PB7 don't exist on the ATtiny84A; PB0 and PB1 are then made outputs for the radio and the LED; with `USE_SWITCHED_5V`, PB2's pull-up is cleared again, [TECH-HAL-007](#tech-hal-007), [PLAT-POWER-006](platform.md#plat-power-006)), disables the analog comparator (`ACSR|=ACD`), disables Timer1 (`PRR|=PRTIM1`), clears `ADCSRA` and disables the ADC (`PRR|=PRADC`). Brownout detection is disabled before each sleep period by `sleep()`, not here ([TECH-HAL-007](#tech-hal-007)). PORTA has no unused pin: PA0/PA1 are analog inputs, PA2 (`SENSOR_VCC`) and PA7 are outputs, and PA3–PA6 are the sensor bus pins, PA3/PA4/PA6 pulled up externally to `SENSOR_VCC` ([PLAT-POWER-007](platform.md#plat-power-007)). PA5 (MISO) only reaches the ISP header J6 and pad 3 of the BME280 address jumper JP6 (open with the default 1–2 bridge), so it has no pull-up at all: the constructor disables its digital input buffer (`DIDR0` bit `ADC5D`, next to `ADC1D` and `ADC2D`), so the floating pin draws no current in the input stage while awake; ISP programming is not affected, since `DIDR0` is cleared by reset. While the MCU is awake with PA2 low (boot and wake before the sensors are powered, after they are powered off before sleep), an internal pull-up on PA3–PA6 would drive current through the external pull-ups into PA2 and back-power the sensors. Verification: AVR only, no native test (`TestHal_` has no registers): inspection and the AVR builds; bench check pending (BME280 still read with the external pull-ups only). +**Description:** `Attiny84aHal()` calls `UseLessPowerAsPossible()`, which sets `DDRA`/`DDRB` to 0, sets `PORTA = 0` (no internal pull-up on any PORTA pin) and `PORTB = 0b11111100` (pull-ups on PB2 and PB3, the only other PORTB pins: PB4–PB7 don't exist on the ATtiny84A; PB0 and PB1 are then made outputs for the radio and the LED; with `USE_SWITCHED_5V`, PB2's pull-up is cleared again, [TECH-HAL-007](#tech-hal-007), [PLAT-POWER-006](platform.md#plat-power-006)), disables the analog comparator (`ACSR|=ACD`), disables Timer1 (`PRR|=PRTIM1`), clears `ADCSRA` and disables the ADC (`PRR|=PRADC`). Brownout detection is disabled before each sleep period by `sleep()`, not here ([TECH-HAL-007](#tech-hal-007)). PORTA has no unused pin: PA0/PA1 are analog inputs, PA2 (`SENSOR_VCC`) and PA7 are outputs, and PA3–PA6 are the sensor bus pins, PA3/PA4/PA6 pulled up externally to `SENSOR_VCC` ([PLAT-POWER-007](platform.md#plat-power-007)). PA5 (MISO) has no pull-up at all. It reaches the ISP header J6 and pad 3 of the BME280 SDO jumper JP6, and reaches the sensor SDO only when JP6 is bridged 2–3. On v3.0, JP6 is delivered open and one side is bridged at assembly: 1–2 ties SDO to GND, which gives I2C address 0x76, the address the firmware reads; 2–3 ties SDO to PA5, for SPI, and in I2C mode SDO would then follow the floating PA5 and the address would be undefined. The constructor disables its digital input buffer (`DIDR0` bit `ADC5D`, next to `ADC1D` and `ADC2D`), so the floating pin draws no current in the input stage while awake; ISP programming is not affected, since `DIDR0` is cleared by reset. While the MCU is awake with PA2 low (boot and wake before the sensors are powered, after they are powered off before sleep), an internal pull-up on PA3–PA6 would drive current through the external pull-ups into PA2 and back-power the sensors. Verification: AVR only, no native test (`TestHal_` has no registers): inspection and the AVR builds; bench check done on 2026-11-19 on the v2.2 mushroom board: the BME280 is read with the external pull-ups only. --- From e5eae5fdb66bc81b41e1de2e247164591c9cf77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:52:35 +0100 Subject: [PATCH 06/24] req(PLAT-POWER-007): v2.2 board checked on the bench (pull-ups to SENSOR_VCC, BME280 reads) Audit 2026-11-19 finding 2. Co-Authored-By: Claude Opus 5.5 --- requirements/platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/platform.md b/requirements/platform.md index cc206a85..4b3f28d4 100644 --- a/requirements/platform.md +++ b/requirements/platform.md @@ -63,7 +63,7 @@ **Status:** validated **Dependencies:** [PLAT-POWER-002](#plat-power-002) **derives_from:** [FUNC-SENSOR-001](functional.md#func-sensor-001) -**Description:** Every board running this firmware has external pull-ups on its sensor buses, to `SENSOR_VCC`, the sensor rail switched by PA2: SCL (PA4) and SDA (PA6) for the I2C bus, and the 1-Wire bus (PA3), which serves the DS18B20. The firmware enables no internal pull-up on these pins ([TECH-HAL-004](technical.md#tech-hal-004)), so a board without them has no working I2C bus. On v3.0 they are three 4.7 kΩ resistors: R3 on SCL, R2 on SDA, R6 on 1-Wire; R3 and R2 sit on the sensor-connector side of the 330 Ω series resistors R9 (SCL) and R10 (SDA), which keep the ISP lines free of the sensor. Both buses are therefore unpowered whenever PA2 is low ([PLAT-POWER-002](#plat-power-002)). Verified by inspection of the v3.0 schematic (`hardware/tinysensor/tinysensor.kicad_sch`); other board revisions are not checked: bench check pending. +**Description:** Every board running this firmware has external pull-ups on its sensor buses, to `SENSOR_VCC`, the sensor rail switched by PA2: SCL (PA4) and SDA (PA6) for the I2C bus, and the 1-Wire bus (PA3), which serves the DS18B20. The firmware enables no internal pull-up on these pins ([TECH-HAL-004](technical.md#tech-hal-004)), so a board without them has no working I2C bus. On v3.0 they are three 4.7 kΩ resistors: R3 on SCL, R2 on SDA, R6 on 1-Wire; R3 and R2 sit on the sensor-connector side of the 330 Ω series resistors R9 (SCL) and R10 (SDA), which keep the ISP lines free of the sensor. Both buses are therefore unpowered whenever PA2 is low ([PLAT-POWER-002](#plat-power-002)). Verified by inspection of the v3.0 schematic (`hardware/tinysensor/tinysensor.kicad_sch`); on the v2.2 board (mushroom), checked on the bench on 2026-11-19: its I2C pull-ups go to `SENSOR_VCC` and the BME280 reads correctly with no internal pull-up (values not recorded). --- From d71affe738c27de398372335ef3f0e842ce7641e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:52:35 +0100 Subject: [PATCH 07/24] req(CONF-DECODE-002): CI artifacts firmware-tinydecoders-promicro and firmware-tinydecoders-promini Audit 2026-11-19 finding 7. User: "c'est la pro micro en prod, sans usb/ftdi"; artifacts: "firmware-tinydecoders-promicro et firmware-tinydecoders-promini". Co-Authored-By: Claude Opus 5.5 --- requirements/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/configuration.md b/requirements/configuration.md index cbd57582..7f1b9f0f 100644 --- a/requirements/configuration.md +++ b/requirements/configuration.md @@ -92,7 +92,7 @@ **Title:** CI and pre-commit cover tinyDecoders: lint, native tests and the promini and promicro builds **Status:** validated **Dependencies:** [CONF-DECODE-003](#conf-decode-003), [CONF-DECODE-004](#conf-decode-004), [TECH-DECODE-001](technical.md#tech-decode-001) -**Description:** The CI (`.github/workflows/main.yml`) lints `tinyDecoders` with the `.rbd/config.yml` linter command (build trees `*/.pio` skipped), runs the `tinyDecoders` native tests, and builds the `promini` and `promicro` environments. It publishes the promini firmware (`.hex`, `.elf`) as `firmware-tinydecoders` and the promicro one as `firmware-tinydecoders-promicro`, and the release waits for these builds. The PlatformIO cache follows changes to `tinyDecoders/platformio.ini`. The pre-commit clang-format hook covers `tinyDecoders/src`, `tinyDecoders/lib` and `tinyDecoders/test`. Verified by a green CI run. +**Description:** The CI (`.github/workflows/main.yml`) lints `tinyDecoders` with the `.rbd/config.yml` linter command (build trees `*/.pio` skipped), runs the `tinyDecoders` native tests, and builds the `promini` and `promicro` environments. It publishes the promicro firmware (`.hex`, `.elf`, production) as `firmware-tinydecoders-promicro` and the promini one as `firmware-tinydecoders-promini`, and the release waits for these builds. The PlatformIO cache follows changes to `tinyDecoders/platformio.ini`. The pre-commit clang-format hook covers `tinyDecoders/src`, `tinyDecoders/lib` and `tinyDecoders/test`. Verified by a green CI run. ### CONF-DECODE-003 **Title:** tinyDecoders promicro environment builds the receiver for the Pro Micro 5 V / 16 MHz breadboard prototype From c7bdcba8ab232b46c0d25c1fe05911062ce6a822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:52:35 +0100 Subject: [PATCH 08/24] req(CONF-DECODE-003): the Pro Micro is the production receiver (powered, flashed and read over its USB) Audit 2026-11-19 finding 7. User: "c'est la pro micro en prod, sans usb/ftdi"; artifacts: "firmware-tinydecoders-promicro et firmware-tinydecoders-promini". Co-Authored-By: Claude Opus 5.5 --- requirements/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/configuration.md b/requirements/configuration.md index 7f1b9f0f..a60676d7 100644 --- a/requirements/configuration.md +++ b/requirements/configuration.md @@ -95,10 +95,10 @@ **Description:** The CI (`.github/workflows/main.yml`) lints `tinyDecoders` with the `.rbd/config.yml` linter command (build trees `*/.pio` skipped), runs the `tinyDecoders` native tests, and builds the `promini` and `promicro` environments. It publishes the promicro firmware (`.hex`, `.elf`, production) as `firmware-tinydecoders-promicro` and the promini one as `firmware-tinydecoders-promini`, and the release waits for these builds. The PlatformIO cache follows changes to `tinyDecoders/platformio.ini`. The pre-commit clang-format hook covers `tinyDecoders/src`, `tinyDecoders/lib` and `tinyDecoders/test`. Verified by a green CI run. ### CONF-DECODE-003 -**Title:** tinyDecoders promicro environment builds the receiver for the Pro Micro 5 V / 16 MHz breadboard prototype +**Title:** tinyDecoders promicro environment builds the production receiver for the Pro Micro 5 V / 16 MHz (ATmega32U4) **Status:** validated **Dependencies:** [FUNC-DECODE-009](functional.md#func-decode-009), [PLAT-DECODE-003](platform.md#plat-decode-003), [PLAT-DECODE-004](platform.md#plat-decode-004), [PLAT-DECODE-005](platform.md#plat-decode-005) -**Description:** The Pro Micro is a breadboard prototype only; the production receiver is the Pro Mini ([CONF-DECODE-004](#conf-decode-004)). `tinyDecoders/platformio.ini` has `[env:promicro]`: `platform = atmelavr`, `board = sparkfun_promicro16`, `framework = arduino`, the default upload (`avr109`, Caterina bootloader over USB) and no `lib_deps`. It builds the same receiver firmware as the Pro Mini (entry point: [TECH-DECODE-005](technical.md#tech-decode-005)); the Arduino core keeps the Pro Micro USB stack running. Verified by `pio run -d tinyDecoders -e promicro`. +**Description:** The production tinyDecoders receiver is a standalone viewer on a Pro Micro 5 V / 16 MHz (ATmega32U4), powered and flashed through its micro-USB. Its native USB needs no USB-serial (FTDI) adapter, and its RFLink lines go out on the USB CDC serial port. Its wiring is in [PLAT-DECODE-003](platform.md#plat-decode-003) to 005. The Pro Mini is the alternative build ([CONF-DECODE-004](#conf-decode-004)). `tinyDecoders/platformio.ini` has `[env:promicro]`: `platform = atmelavr`, `board = sparkfun_promicro16`, `framework = arduino`, the default upload (`avr109`, Caterina bootloader over USB) and no `lib_deps`. It builds the same receiver firmware as the Pro Mini (entry point: [TECH-DECODE-005](technical.md#tech-decode-005)); the Arduino core keeps the Pro Micro USB stack running. Verified by `pio run -d tinyDecoders -e promicro`. ### CONF-DECODE-004 **Title:** tinyDecoders promini environment builds the production receiver for the Pro Mini 5 V / 16 MHz (ATmega328P) From dd3e4bb6ba10348ee46d32b7bb6286732d7a2089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:52:35 +0100 Subject: [PATCH 09/24] req(CONF-DECODE-004): the Pro Mini is the alternative receiver build Audit 2026-11-19 finding 7. User: "c'est la pro micro en prod, sans usb/ftdi"; artifacts: "firmware-tinydecoders-promicro et firmware-tinydecoders-promini". Co-Authored-By: Claude Opus 5.5 --- requirements/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/configuration.md b/requirements/configuration.md index a60676d7..ab3d48b9 100644 --- a/requirements/configuration.md +++ b/requirements/configuration.md @@ -101,7 +101,7 @@ **Description:** The production tinyDecoders receiver is a standalone viewer on a Pro Micro 5 V / 16 MHz (ATmega32U4), powered and flashed through its micro-USB. Its native USB needs no USB-serial (FTDI) adapter, and its RFLink lines go out on the USB CDC serial port. Its wiring is in [PLAT-DECODE-003](platform.md#plat-decode-003) to 005. The Pro Mini is the alternative build ([CONF-DECODE-004](#conf-decode-004)). `tinyDecoders/platformio.ini` has `[env:promicro]`: `platform = atmelavr`, `board = sparkfun_promicro16`, `framework = arduino`, the default upload (`avr109`, Caterina bootloader over USB) and no `lib_deps`. It builds the same receiver firmware as the Pro Mini (entry point: [TECH-DECODE-005](technical.md#tech-decode-005)); the Arduino core keeps the Pro Micro USB stack running. Verified by `pio run -d tinyDecoders -e promicro`. ### CONF-DECODE-004 -**Title:** tinyDecoders promini environment builds the production receiver for the Pro Mini 5 V / 16 MHz (ATmega328P) +**Title:** tinyDecoders promini environment builds the alternative receiver for the Pro Mini 5 V / 16 MHz (ATmega328P) **Status:** validated **Dependencies:** [FUNC-DECODE-007](functional.md#func-decode-007), [FUNC-DECODE-009](functional.md#func-decode-009), [PLAT-DECODE-003](platform.md#plat-decode-003), [PLAT-DECODE-004](platform.md#plat-decode-004), [PLAT-DECODE-005](platform.md#plat-decode-005) -**Description:** The production tinyDecoders receiver is a standalone viewer on an Arduino Pro Mini 5 V / 16 MHz (ATmega328P), fed USB 5 V on its VCC pin, bypassing the onboard regulator; its wiring is in [PLAT-DECODE-003](platform.md#plat-decode-003) to 005. `tinyDecoders/platformio.ini` has `[env:promini]`: `platform = atmelavr`, `board = pro16MHzatmega328`, `framework = arduino`, the default upload (`arduino` protocol through the Pro Mini bootloader, over a USB-serial adapter on the programming header), no `lib_deps`, and `build_flags = -DSERIAL_TX_BUFFER_SIZE=128`: the core default of 64 B leaves 63 free bytes, exactly the longest RFLink line plus `\r\n`, and 128 B leaves room for a second line. It builds the same receiver firmware as the Pro Micro ([CONF-DECODE-003](#conf-decode-003)). Verified by `pio run -d tinyDecoders -e promini`. \ No newline at end of file +**Description:** The alternative tinyDecoders receiver is a standalone viewer on an Arduino Pro Mini 5 V / 16 MHz (ATmega328P), fed USB 5 V on its VCC pin, bypassing the onboard regulator. The production receiver is the Pro Micro ([CONF-DECODE-003](#conf-decode-003)). The Pro Mini has no native USB: flashing it needs a USB-serial adapter on its programming header, and its RFLink lines go out on the debug UART. Its wiring is in [PLAT-DECODE-003](platform.md#plat-decode-003) to 005. `tinyDecoders/platformio.ini` has `[env:promini]`: `platform = atmelavr`, `board = pro16MHzatmega328`, `framework = arduino`, the default upload (`arduino` protocol through the Pro Mini bootloader, over a USB-serial adapter on the programming header), no `lib_deps`, and `build_flags = -DSERIAL_TX_BUFFER_SIZE=128`: the core default of 64 B leaves 63 free bytes, exactly the longest RFLink line plus `\r\n`, and 128 B leaves room for a second line. It builds the same receiver firmware as the Pro Micro ([CONF-DECODE-003](#conf-decode-003)). Verified by `pio run -d tinyDecoders -e promini`. \ No newline at end of file From ae484c6dce82a4abe00465fa813662f99fba28a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:52:35 +0100 Subject: [PATCH 10/24] req(CONF-BUILD-015): CI runs every emitter native env and builds every default board env (adds native_cycle_oregon_divider, mushroom) Audit 2026-11-19 finding 9. Co-Authored-By: Claude Opus 5.5 --- requirements/configuration.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/requirements/configuration.md b/requirements/configuration.md index ab3d48b9..d22ce4f5 100644 --- a/requirements/configuration.md +++ b/requirements/configuration.md @@ -88,6 +88,12 @@ **Dependencies:** [CONF-BUILD-003](#conf-build-003), [CONF-BUILD-005](#conf-build-005), [CONF-BUILD-007](#conf-build-007), [CONF-BUILD-008](#conf-build-008), [CONF-BUILD-012](#conf-build-012), [CONF-BUILD-013](#conf-build-013) **Description:** The `mushroom` board is a cut-down v2.2 with a BME280. Its 18650 is charged by a TP4056, and a 3.3 V buck-boost supplies VCC, so VCC is not the battery voltage and PA1 reads half of it. It sends Oregon temperature and humidity without pressure on channel 3 with rolling code 0x3C. The X10 meter 7 reports the battery through a divider of 2 every 5 minutes. The low-battery threshold is 3000 mV, so the discharge stays tracked down to 3.0 V while the buck-boost keeps VCC steady. The 1.1 V reference is calibrated at 1104 mV (4040 mV measured on J13 against 4026 mV reported). The environment is part of the default build, and the environment docs list it with its battery and threshold. Acceptance: the environment builds. +### CONF-BUILD-015 +**Title:** CI runs every emitter native test environment and builds every emitter board environment +**Status:** validated +**Dependencies:** [CONF-BUILD-014](#conf-build-014), [TECH-MAIN-001](technical.md#tech-main-001) +**Description:** The CI (`.github/workflows/main.yml`) runs `pio test -d emitter` on `native_debug` and on every `native_cycle_*` environment of `emitter/platformio.ini`: `native_cycle_oregon`, `native_cycle_oregon_vcc`, `native_cycle_oregon_divider`, `native_cycle_lacrosse` and `native_cycle_x10`. It builds every environment in `default_envs`: `S_02`, `S_03`, `S_04`, `S_05`, `robot`, `devmodule`, `SOLAR_TEST` and `mushroom`. It publishes each board firmware (`.hex`, `.elf`) as `firmware-`, and the release waits for these builds. Verified by comparing the workflow with `emitter/platformio.ini` and by a green CI run. + ### CONF-DECODE-002 **Title:** CI and pre-commit cover tinyDecoders: lint, native tests and the promini and promicro builds **Status:** validated From 7d2904b208bf81bb8b04085f95da62d535d2b4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:04 +0100 Subject: [PATCH 11/24] arch(TECH-HAL-004): row states the PA5 DIDR0 input-buffer disable Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 9fd54d44..2a09ab91 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Architecture -_Last updated: 2026-11-17 — [FUNC-X10-003](../requirements/functional.md#func-x10-003) (deprecated, x10Switch removed)_ +_Last updated: 2026-11-19 — [TECH-HAL-004](../requirements/technical.md#tech-hal-004) (PA5 input buffer off, JP6 delivered open)_ Emitter firmware paths (`src/`, `include/`, `test/`, `platformio.ini`) are relative to `emitter/`; `lib/` is at the repository root, shared with `tinyDecoders/`. @@ -216,7 +216,7 @@ Every physical board is a separate PlatformIO environment with its own `build_fl | [TECH-HAL-001](../requirements/technical.md#tech-hal-001) | `Hal` / `Attiny84aHal` / `TestHal_` / `OregonV3` / `LacrosseWS7000` / `x10rf` / `SoftSerial` / `Ds18b20` / `LightSensor` / `BMx280` | Encoders and HAL-using wrappers take Hal* at construction; BMx280 (third-party bus driver) takes none; no direct AVR register access except addresses passed to a bus driver | | [TECH-HAL-002](../requirements/technical.md#tech-hal-002) | `TestHal_` | Orders vector char-token recording: H, L, D, P, A, S, W, Q, R, T, U, G, I | | [TECH-HAL-003](../requirements/technical.md#tech-hal-003) | `Hal` | ComputeVccMv and ConvertAnalogValueToMv are non-virtual concrete methods on Hal base | -| [TECH-HAL-004](../requirements/technical.md#tech-hal-004) | `Attiny84aHal` | Constructor power-reduction: disables Timer1, ADC, analog comparator; `PORTA = 0` (no internal pull-up, bus pins rely on the external pull-ups of [PLAT-POWER-007](../requirements/platform.md#plat-power-007)), pull-ups on PB2 and PB3 (PB2 cleared again with `USE_SWITCHED_5V`) | +| [TECH-HAL-004](../requirements/technical.md#tech-hal-004) | `Attiny84aHal` | Constructor power-reduction: disables Timer1, ADC, analog comparator; `PORTA = 0` (no internal pull-up, bus pins rely on the external pull-ups of [PLAT-POWER-007](../requirements/platform.md#plat-power-007)); PA5 digital input buffer off (`DIDR0` bit `ADC5D`: PA5 has no pull-up; JP6 2–3 wires it to the BME280 SDO), pull-ups on PB2 and PB3 (PB2 cleared again with `USE_SWITCHED_5V`) | | [TECH-HAL-005](../requirements/technical.md#tech-hal-005) | `Attiny84aHal` / `TestHal_` | LedOn/LedOff toggle PORTB PB1 on AVR; toggle IsLedOn in TestHal_ | | [TECH-HAL-006](../requirements/technical.md#tech-hal-006) | `main.cpp` / `Attiny84aHal` / `TestHal_` | runCycle calls Init() first, before PowerOnSensors; Init() calls TinyI2C.init() on AVR (USE_I2C); TestHal_ records 'I'; checked in test_main_cycle | | [TECH-FILTER-001](../requirements/technical.md#tech-filter-001) | `AnalogFilter` | Discards first `exclusion` values; accumulates up to `samples`; Get() returns integer floor mean | From 9f20275bcca6033e40a55b222d738714dcd3ba73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:04 +0100 Subject: [PATCH 12/24] arch(PLAT-POWER-007): row records the v2.2 bench check Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 2a09ab91..9eb2f904 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Architecture -_Last updated: 2026-11-19 — [TECH-HAL-004](../requirements/technical.md#tech-hal-004) (PA5 input buffer off, JP6 delivered open)_ +_Last updated: 2026-11-19 — [PLAT-POWER-007](../requirements/platform.md#plat-power-007) (v2.2 checked on the bench)_ Emitter firmware paths (`src/`, `include/`, `test/`, `platformio.ini`) are relative to `emitter/`; `lib/` is at the repository root, shared with `tinyDecoders/`. @@ -258,7 +258,7 @@ Every physical board is a separate PlatformIO environment with its own `build_fl | [PLAT-POWER-004](../requirements/platform.md#plat-power-004) | `main.cpp` | TRANSMIT_WITH_LED macro wraps every Send(): LedOn() before, LedOff() + Delay30ms() after | | [PLAT-POWER-005](../requirements/platform.md#plat-power-005) | `Attiny84aHal` / `platformio.ini` | ATtiny84a at F_CPU = 1 000 000 L; all HAL delay methods calibrated to this frequency | | [PLAT-POWER-006](../requirements/platform.md#plat-power-006) | `Attiny84aHal` | `USE_SWITCHED_5V`: PORTB.2 cleared in constructor; PowerOnSensors() sets DDRB.2 (PB2 low, PNP on), PowerOffSensors() clears it (high impedance) | -| [PLAT-POWER-007](../requirements/platform.md#plat-power-007) | board (`hardware/tinysensor`) | Board requirement, every board; on v3.0: I2C pull-ups R3 (SCL, PA4) / R2 (SDA, PA6), sensor side of the R9/R10 330 Ω series resistors and 1-Wire pull-up R6 (PA3), 4.7 kΩ to SENSOR_VCC (PA2); buses unpowered while PA2 is low. Firmware side: no internal pull-up on these pins ([TECH-HAL-004](../requirements/technical.md#tech-hal-004)); PA3 released after the DS18B20 read ([TECH-SENSOR-001](../requirements/technical.md#tech-sensor-001), draft, not implemented) | +| [PLAT-POWER-007](../requirements/platform.md#plat-power-007) | board (`hardware/tinysensor`) | Board requirement, every board (v2.2 checked on the bench 2026-11-19: pull-ups to SENSOR_VCC); on v3.0: I2C pull-ups R3 (SCL, PA4) / R2 (SDA, PA6), sensor side of the R9/R10 330 Ω series resistors and 1-Wire pull-up R6 (PA3), 4.7 kΩ to SENSOR_VCC (PA2); buses unpowered while PA2 is low. Firmware side: no internal pull-up on these pins ([TECH-HAL-004](../requirements/technical.md#tech-hal-004)); PA3 released after the DS18B20 read ([TECH-SENSOR-001](../requirements/technical.md#tech-sensor-001), draft, not implemented) | | [TECH-HAL-007](../requirements/technical.md#tech-hal-007) | `Attiny84aHal` / `main.cpp` | `Hibernate(s)` → static `sleep(s)` (`s >> 3`, min 1; saves/restores PRR, DDRA, DDRB, PORTA, PORTB; `sleep_bod_disable()` before each `sleep_cpu()`); `PowerOnSensors`/`PowerOffSensors` drive PA2 (and `DDRB.2` with `USE_SWITCHED_5V`); `TRANSMIT_WITH_LED(code)` = `LedOn`, code, `LedOff`, `Delay30ms` | | [TECH-DECODE-001](../requirements/technical.md#tech-decode-001) | `Loopback` (tinyDecoders) | Orders tokens to level/duration pulses with nominal durations (A 400, D 512, P 1024, T 560, U 1120, Q 8960, R 4500, G 40000 µs); native env of tinyDecoders builds repo `lib/` | | [FUNC-DECODE-001](../requirements/functional.md#func-decode-001) | `X10Decoder` (tinyDecoders) | `Feed(high, durationUs)` true on the last bit of a valid RFXmeter frame; windows nominal ±30 % (Q 8960 / R 4500, bit 560 high, 560 or 1680 low); `Address()` = b0, `Value()` = (b4<<16)\|(b2<<8)\|b3 | From 16cbc71cbdbaf0d1f74e2e83ebe6e87ce28c2f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:04 +0100 Subject: [PATCH 13/24] arch(CONF-DECODE-002): row gives the promicro and promini artifact names Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 9eb2f904..e4a015b0 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Architecture -_Last updated: 2026-11-19 — [PLAT-POWER-007](../requirements/platform.md#plat-power-007) (v2.2 checked on the bench)_ +_Last updated: 2026-11-19 — [CONF-DECODE-002](../requirements/configuration.md#conf-decode-002) (artifact names)_ Emitter firmware paths (`src/`, `include/`, `test/`, `platformio.ini`) are relative to `emitter/`; `lib/` is at the repository root, shared with `tinyDecoders/`. @@ -273,7 +273,7 @@ Every physical board is a separate PlatformIO environment with its own `build_fl | [TECH-DECODE-004](../requirements/technical.md#tech-decode-004) | `PageFormatter` / `Font8x16` (tinyDecoders) | `FormatPage(record, alternate, big, top, bottom)`; `ReadGlyph(c, glyph[16])` from a `PROGMEM` table (SSD1306 page byte order, generated by `scripts/gen_font8x16.py`); `ReadBigGlyphPage(c, page, bytes[16])` computed, no table; lux unit cell = `LuxUnit` `'\x01'`, drawn by `ReadBigGlyphPage` as small `lx` | | [TECH-DECODE-002](../requirements/technical.md#tech-decode-002) | `ReceiverHal` / `TestReceiverHal` (tinyDecoders) | `typedef` per MCU (`__AVR_ATmega328P__` or `__AVR_ATmega32U4__` to `AtmegaReceiverHal`, native), `#error` otherwise; `PopPulse`, `NowSeconds`, `DrawChar(page 0–2, col, c)`, `DrawBigChar(col 0–5, c)`, `HasLineOutput`, `WriteLine`; double adds `PushPulse`, `SetNowSeconds`, `Row(page)`, `Big`, `DrawCount`, `Lines`; consumers take `ReceiverHal*` at construction | | [FUNC-DECODE-007](../requirements/functional.md#func-decode-007) | `Receiver` (tinyDecoders) | `Poll()`: pulses to X10, Lacrosse, Oregon decoders, `Update` on true; on new second or frame `Expire` then page `(now / 10) % Count()`, `alternate = (now / 2) % 2`; waiting page `Waiting for data` at page 1 only while the table is empty; source cells drawn big 0–5, then identifier, then second value (positions per [UI-DECODE-001](../requirements/ui.md#ui-decode-001)); layout switch redraws all cells (blank source cells before the waiting text); at most one draw per call | -| [CONF-DECODE-002](../requirements/configuration.md#conf-decode-002) | `.github/workflows/main.yml` / `.pre-commit-config.yaml` | Lint includes `tinyDecoders` (prune `.pio`); `pio test -d tinyDecoders -e native`; `build-tinydecoders` job builds `promini` and `promicro`, artifacts `firmware-tinydecoders` (promini) and `firmware-tinydecoders-promicro`, needed by `release`; pre-commit `files` includes `tinyDecoders/(src\|lib\|test)` | +| [CONF-DECODE-002](../requirements/configuration.md#conf-decode-002) | `.github/workflows/main.yml` / `.pre-commit-config.yaml` | Lint includes `tinyDecoders` (prune `.pio`); `pio test -d tinyDecoders -e native`; `build-tinydecoders` job builds `promini` and `promicro`, artifacts `firmware-tinydecoders-promicro` (production) and `firmware-tinydecoders-promini`, needed by `release`; pre-commit `files` includes `tinyDecoders/(src\|lib\|test)` | | [FUNC-DECODE-008](../requirements/functional.md#func-decode-008) | `RflinkFormatter` (tinyDecoders) | `FormatRflink(decoder, counter, line[64])` per decoder; `20;NN;`; Oregon names `Oregon Temp` (`EA4C`), `Oregon TempHygro` (`1A2D`, `1A3D`), `Oregon BTHR` (`5A5D`); Oregon `ID=(rc<<8)\|ch`, Lacrosse `ID=(type<<8)\|addr`, X10 `ID=addr`; `TEMP` hex with 0x8000 sign, `HUM` decimal, `BARO`/`LUX` hex, `METER` mV decimal (valid BCD only), `BAT=OK/LOW` (Oregon) | | [FUNC-DECODE-009](../requirements/functional.md#func-decode-009) | `Receiver` (tinyDecoders) | When `HasLineOutput`: `FormatRflink` + `WriteLine` after each `SourceTable::Update`; `uint8_t` counter from 0, wrapping; no deduplication | | [FUNC-DECODE-010](../requirements/functional.md#func-decode-010) | `SourceTable` (tinyDecoders) | `Expire(now)` removes records with `now - lastSeenSeconds >= 1800`, keeps first-seen order; LRU replacement when full unchanged; called by `Receiver` before each page computation | From b5c0e0a45e0aff17e68b06600ef76fc8a6f55bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:04 +0100 Subject: [PATCH 14/24] arch(CONF-DECODE-003): the Pro Micro is the production receiver in the architecture and environments docs Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 8 ++++---- docs/environments.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index e4a015b0..1af6ea2b 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Architecture -_Last updated: 2026-11-19 — [CONF-DECODE-002](../requirements/configuration.md#conf-decode-002) (artifact names)_ +_Last updated: 2026-11-19 — [CONF-DECODE-003](../requirements/configuration.md#conf-decode-003) (Pro Micro is the production receiver)_ Emitter firmware paths (`src/`, `include/`, `test/`, `platformio.ini`) are relative to `emitter/`; `lib/` is at the repository root, shared with `tinyDecoders/`. @@ -104,7 +104,7 @@ Design choices: ## tinyDecoders sub-project -`tinyDecoders/` (repository root) is a separate PlatformIO project: a 433 MHz receiver that decodes the frames tinySensors emit and shows them on an OLED; it also writes one RFLink line per frame on `Serial` (a debug UART on the Pro Mini, USB CDC on the Pro Micro). The production receiver is a standalone viewer on a Pro Mini 5 V / 16 MHz (ATmega328P); the Pro Micro (ATmega32U4) is a breadboard prototype. It has its own `platformio.ini`. The dependency goes one way only: tinyDecoders tests build the repository `lib/` encoders and `TestHal_`; the tinySensor firmware never depends on tinyDecoders. +`tinyDecoders/` (repository root) is a separate PlatformIO project: a 433 MHz receiver that decodes the frames tinySensors emit and shows them on an OLED; it also writes one RFLink line per frame on `Serial` (a debug UART on the Pro Mini, USB CDC on the Pro Micro). The production receiver is a standalone viewer on a Pro Micro 5 V / 16 MHz (ATmega32U4), powered, flashed and read over its native USB; the Pro Mini 5 V / 16 MHz (ATmega328P) is the alternative build. It has its own `platformio.ini`. The dependency goes one way only: tinyDecoders tests build the repository `lib/` encoders and `TestHal_`; the tinySensor firmware never depends on tinyDecoders. ```mermaid graph TD @@ -170,7 +170,7 @@ The RFLink line output is selected by the compile-time constant `ReceiverHal::Ha Drawing one cell per `Poll()` (≈ 1 ms of I2C for an 8x16 cell, ≈ 2 ms for a 16x32 cell) keeps the pulse latency well within the 64-pulse ring buffer. -Firmware build: env `promini` of `tinyDecoders/platformio.ini` is the production receiver, a Pro Mini 5 V / 16 MHz (ATmega328P, 2 KB SRAM) with the Arduino framework ([CONF-DECODE-004](../requirements/configuration.md#conf-decode-004)). Env `promicro` builds the Pro Micro 5 V / 16 MHz (ATmega32U4) breadboard prototype ([CONF-DECODE-003](../requirements/configuration.md#conf-decode-003)). Both build the same `src/main.cpp`, the only file in `src/`, so no `build_src_filter`. CI lints `tinyDecoders/`, runs its `native` tests and builds `promini` and `promicro`. The pre-commit clang-format hook covers `tinyDecoders/{src,lib,test}` ([CONF-DECODE-002](../requirements/configuration.md#conf-decode-002)). +Firmware build: env `promicro` of `tinyDecoders/platformio.ini` is the production receiver, a Pro Micro 5 V / 16 MHz (ATmega32U4) with the Arduino framework ([CONF-DECODE-003](../requirements/configuration.md#conf-decode-003)). Env `promini` builds the alternative Pro Mini 5 V / 16 MHz (ATmega328P, 2 KB SRAM), flashed through a USB-serial adapter ([CONF-DECODE-004](../requirements/configuration.md#conf-decode-004)). Both build the same `src/main.cpp`, the only file in `src/`, so no `build_src_filter`. CI lints `tinyDecoders/`, runs its `native` tests and builds `promini` and `promicro`. The pre-commit clang-format hook covers `tinyDecoders/{src,lib,test}` ([CONF-DECODE-002](../requirements/configuration.md#conf-decode-002)). `SourceTable::Update` takes each concrete decoder by `const&` and `FormatPage` takes a `SourceRecord`: no interface is introduced. Decoders and the table are pure value logic with no hardware behind them, already substitutable in tests through loopback pulses, and the project avoids virtual calls (same choice as `EnvironmentEncoder`). RAM: the table is 16 × 18 B = 288 B on AVR (8 on native, `kCapacity` chosen by `AVR`); the 128×32 OLED is written cell by cell from the page texts (6 + 4 + 4 characters), never from a 512 B framebuffer; 16x32 glyphs are doubled on the fly from the 8x16 font, one 16-byte page at a time. @@ -281,6 +281,6 @@ Every physical board is a separate PlatformIO environment with its own `build_fl | [PLAT-DECODE-003](../requirements/platform.md#plat-decode-003) | `AtmegaReceiverHal` (tinyDecoders) | ICP1 = PB0/D8 (ATmega328P) or PD4 (ATmega32U4), input without pull-up (RXB6 at 5 V); Timer1 normal mode, prescaler 8, ICNC1, edge toggled per capture; duration ticks/2, 65535 after a full period; 64-pulse ring, drop when full; overflow adds 32768 µs; atomic reads | | [PLAT-DECODE-004](../requirements/platform.md#plat-decode-004) | `AtmegaReceiverHal` (tinyDecoders) | `Wire` at 400 kHz, SDA/SCL A4/A5 (Pro Mini) or D2/D3 (Pro Micro); SSD1306 0x3C, fixed init sequence, 4 × 128 zero bytes, `AF`; `DrawChar` = pages `page` and `page+1`, column col·8, 8 glyph bytes each; `DrawBigChar` = pages 0–3, column col·16, 16 bytes of `ReadBigGlyphPage` each; no level shifting (OLED module regulated, 5 V I2C) | | [PLAT-DECODE-005](../requirements/platform.md#plat-decode-005) | `AtmegaReceiverHal` (tinyDecoders) | `Serial.begin(57600)`: debug UART TX D1 (Pro Mini, adapter optional) or USB CDC (Pro Micro); `WriteLine` drops the line when `availableForWrite() < len + 2`, else line + `\r\n`; no `operator bool`; input ignored, no banner | -| [CONF-DECODE-003](../requirements/configuration.md#conf-decode-003) | `tinyDecoders/platformio.ini` / `tinyDecoders/src/main.cpp` | env `promicro` (breadboard prototype): `sparkfun_promicro16`, Arduino framework, avr109 upload; shared `src/main.cpp`, no `build_src_filter` | +| [CONF-DECODE-003](../requirements/configuration.md#conf-decode-003) | `tinyDecoders/platformio.ini` / `tinyDecoders/src/main.cpp` | env `promicro` (production): `sparkfun_promicro16`, Arduino framework, avr109 upload; shared `src/main.cpp`, no `build_src_filter` | | [CONF-DECODE-004](../requirements/configuration.md#conf-decode-004) | `tinyDecoders/platformio.ini` / `tinyDecoders/src/main.cpp` | env `promini` (production): `pro16MHzatmega328`, Arduino framework, default `arduino` upload through a USB-serial adapter, no `lib_deps`, `-DSERIAL_TX_BUFFER_SIZE=128`, USB 5 V on VCC; shared `src/main.cpp` | | [TECH-DECODE-005](../requirements/technical.md#tech-decode-005) | `tinyDecoders/src/main.cpp` / `AtmegaReceiverHal` (tinyDecoders) | file-scope `hal` + `receiver`, `setup()` → `Init()`, `loop()` → `Poll()`; `ISR(TIMER1_CAPT_vect)`, `ISR(TIMER1_OVF_vect)`, `ATOMIC_BLOCK` reads; `Wire` at 400 kHz; `Serial.begin(57600)`, `availableForWrite()` guard, no `operator bool` | diff --git a/docs/environments.md b/docs/environments.md index 34229a58..7b352260 100644 --- a/docs/environments.md +++ b/docs/environments.md @@ -58,8 +58,8 @@ The 433 MHz receiver is a separate PlatformIO project (`pio run -d tinyDecoders | Env | Board | Purpose | |-----|-------|---------| -| `promini` | Arduino Pro Mini 5 V / 16 MHz (ATmega328P) | Production receiver, a standalone OLED viewer: RXB6 DATA on D8 (ICP1/PB0), SSD1306 on A4 (SDA) / A5 (SCL), debug UART TX on D1 at 57600 baud. Uploaded with the `arduino` protocol through a USB-serial adapter on the programming header (CONF-DECODE-004) | -| `promicro` | SparkFun Pro Micro 5 V / 16 MHz (ATmega32U4) | Breadboard prototype: RXB6 on pin 4 (ICP1/PD4), SSD1306 on D2 / D3, RFLink lines on USB CDC (CONF-DECODE-003) | +| `promini` | Arduino Pro Mini 5 V / 16 MHz (ATmega328P) | Alternative receiver build, a standalone OLED viewer: RXB6 DATA on D8 (ICP1/PB0), SSD1306 on A4 (SDA) / A5 (SCL), debug UART TX on D1 at 57600 baud. Uploaded with the `arduino` protocol through a USB-serial adapter on the programming header (CONF-DECODE-004) | +| `promicro` | SparkFun Pro Micro 5 V / 16 MHz (ATmega32U4) | Production receiver, a standalone OLED viewer: RXB6 on pin 4 (ICP1/PD4), SSD1306 on D2 / D3, RFLink lines on USB CDC; powered and flashed over its micro-USB (avr109), no USB-serial adapter (CONF-DECODE-003) | | `native` | host | Unity tests of the decoders, `Receiver` and the formatters against the repository encoders | Both boards share `AtmegaReceiverHal` and `src/main.cpp`. From b880c7e241dedf64aadaea319a67139d3e14caad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:04 +0100 Subject: [PATCH 15/24] arch(CONF-DECODE-004): row marks the Pro Mini as the alternative build Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 1af6ea2b..c13e8551 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Architecture -_Last updated: 2026-11-19 — [CONF-DECODE-003](../requirements/configuration.md#conf-decode-003) (Pro Micro is the production receiver)_ +_Last updated: 2026-11-19 — [CONF-DECODE-004](../requirements/configuration.md#conf-decode-004) (Pro Mini alternative build)_ Emitter firmware paths (`src/`, `include/`, `test/`, `platformio.ini`) are relative to `emitter/`; `lib/` is at the repository root, shared with `tinyDecoders/`. @@ -282,5 +282,5 @@ Every physical board is a separate PlatformIO environment with its own `build_fl | [PLAT-DECODE-004](../requirements/platform.md#plat-decode-004) | `AtmegaReceiverHal` (tinyDecoders) | `Wire` at 400 kHz, SDA/SCL A4/A5 (Pro Mini) or D2/D3 (Pro Micro); SSD1306 0x3C, fixed init sequence, 4 × 128 zero bytes, `AF`; `DrawChar` = pages `page` and `page+1`, column col·8, 8 glyph bytes each; `DrawBigChar` = pages 0–3, column col·16, 16 bytes of `ReadBigGlyphPage` each; no level shifting (OLED module regulated, 5 V I2C) | | [PLAT-DECODE-005](../requirements/platform.md#plat-decode-005) | `AtmegaReceiverHal` (tinyDecoders) | `Serial.begin(57600)`: debug UART TX D1 (Pro Mini, adapter optional) or USB CDC (Pro Micro); `WriteLine` drops the line when `availableForWrite() < len + 2`, else line + `\r\n`; no `operator bool`; input ignored, no banner | | [CONF-DECODE-003](../requirements/configuration.md#conf-decode-003) | `tinyDecoders/platformio.ini` / `tinyDecoders/src/main.cpp` | env `promicro` (production): `sparkfun_promicro16`, Arduino framework, avr109 upload; shared `src/main.cpp`, no `build_src_filter` | -| [CONF-DECODE-004](../requirements/configuration.md#conf-decode-004) | `tinyDecoders/platformio.ini` / `tinyDecoders/src/main.cpp` | env `promini` (production): `pro16MHzatmega328`, Arduino framework, default `arduino` upload through a USB-serial adapter, no `lib_deps`, `-DSERIAL_TX_BUFFER_SIZE=128`, USB 5 V on VCC; shared `src/main.cpp` | +| [CONF-DECODE-004](../requirements/configuration.md#conf-decode-004) | `tinyDecoders/platformio.ini` / `tinyDecoders/src/main.cpp` | env `promini` (alternative build): `pro16MHzatmega328`, Arduino framework, default `arduino` upload through a USB-serial adapter, no `lib_deps`, `-DSERIAL_TX_BUFFER_SIZE=128`, USB 5 V on VCC; shared `src/main.cpp` | | [TECH-DECODE-005](../requirements/technical.md#tech-decode-005) | `tinyDecoders/src/main.cpp` / `AtmegaReceiverHal` (tinyDecoders) | file-scope `hal` + `receiver`, `setup()` → `Init()`, `loop()` → `Poll()`; `ISR(TIMER1_CAPT_vect)`, `ISR(TIMER1_OVF_vect)`, `ATOMIC_BLOCK` reads; `Wire` at 400 kHz; `Serial.begin(57600)`, `availableForWrite()` guard, no `operator bool` | From 1cb9aaa32e655b330b2d5542cc96acdca7739843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:14 +0100 Subject: [PATCH 16/24] arch(CONF-BUILD-015): row for the emitter CI coverage Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/architecture.md b/docs/architecture.md index c13e8551..aa0f405c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,6 +1,6 @@ # Architecture -_Last updated: 2026-11-19 — [CONF-DECODE-004](../requirements/configuration.md#conf-decode-004) (Pro Mini alternative build)_ +_Last updated: 2026-11-19 — [CONF-BUILD-015](../requirements/configuration.md#conf-build-015) (emitter CI coverage)_ Emitter firmware paths (`src/`, `include/`, `test/`, `platformio.ini`) are relative to `emitter/`; `lib/` is at the repository root, shared with `tinyDecoders/`. @@ -273,6 +273,7 @@ Every physical board is a separate PlatformIO environment with its own `build_fl | [TECH-DECODE-004](../requirements/technical.md#tech-decode-004) | `PageFormatter` / `Font8x16` (tinyDecoders) | `FormatPage(record, alternate, big, top, bottom)`; `ReadGlyph(c, glyph[16])` from a `PROGMEM` table (SSD1306 page byte order, generated by `scripts/gen_font8x16.py`); `ReadBigGlyphPage(c, page, bytes[16])` computed, no table; lux unit cell = `LuxUnit` `'\x01'`, drawn by `ReadBigGlyphPage` as small `lx` | | [TECH-DECODE-002](../requirements/technical.md#tech-decode-002) | `ReceiverHal` / `TestReceiverHal` (tinyDecoders) | `typedef` per MCU (`__AVR_ATmega328P__` or `__AVR_ATmega32U4__` to `AtmegaReceiverHal`, native), `#error` otherwise; `PopPulse`, `NowSeconds`, `DrawChar(page 0–2, col, c)`, `DrawBigChar(col 0–5, c)`, `HasLineOutput`, `WriteLine`; double adds `PushPulse`, `SetNowSeconds`, `Row(page)`, `Big`, `DrawCount`, `Lines`; consumers take `ReceiverHal*` at construction | | [FUNC-DECODE-007](../requirements/functional.md#func-decode-007) | `Receiver` (tinyDecoders) | `Poll()`: pulses to X10, Lacrosse, Oregon decoders, `Update` on true; on new second or frame `Expire` then page `(now / 10) % Count()`, `alternate = (now / 2) % 2`; waiting page `Waiting for data` at page 1 only while the table is empty; source cells drawn big 0–5, then identifier, then second value (positions per [UI-DECODE-001](../requirements/ui.md#ui-decode-001)); layout switch redraws all cells (blank source cells before the waiting text); at most one draw per call | +| [CONF-BUILD-015](../requirements/configuration.md#conf-build-015) | `.github/workflows/main.yml` | `test-native` runs `native_debug` and all five `native_cycle_*` envs; `build-avr` matrix = `default_envs` (incl. `mushroom`), artifacts `firmware-`, needed by `release` | | [CONF-DECODE-002](../requirements/configuration.md#conf-decode-002) | `.github/workflows/main.yml` / `.pre-commit-config.yaml` | Lint includes `tinyDecoders` (prune `.pio`); `pio test -d tinyDecoders -e native`; `build-tinydecoders` job builds `promini` and `promicro`, artifacts `firmware-tinydecoders-promicro` (production) and `firmware-tinydecoders-promini`, needed by `release`; pre-commit `files` includes `tinyDecoders/(src\|lib\|test)` | | [FUNC-DECODE-008](../requirements/functional.md#func-decode-008) | `RflinkFormatter` (tinyDecoders) | `FormatRflink(decoder, counter, line[64])` per decoder; `20;NN;`; Oregon names `Oregon Temp` (`EA4C`), `Oregon TempHygro` (`1A2D`, `1A3D`), `Oregon BTHR` (`5A5D`); Oregon `ID=(rc<<8)\|ch`, Lacrosse `ID=(type<<8)\|addr`, X10 `ID=addr`; `TEMP` hex with 0x8000 sign, `HUM` decimal, `BARO`/`LUX` hex, `METER` mV decimal (valid BCD only), `BAT=OK/LOW` (Oregon) | | [FUNC-DECODE-009](../requirements/functional.md#func-decode-009) | `Receiver` (tinyDecoders) | When `HasLineOutput`: `FormatRflink` + `WriteLine` after each `SourceTable::Update`; `uint8_t` counter from 0, wrapping; no deduplication | From 0f7c61207316c7d4b1fdd11d037b10d851fdac5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:28 +0100 Subject: [PATCH 17/24] conf(CONF-BUILD-015): CI tests native_cycle_oregon_divider and builds mushroom Co-Authored-By: Claude Opus 5.5 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6dc38d4..10de5581 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: - name: Install PlatformIO Core run: pip install --upgrade platformio - name: Run native tests - run: pio test -d emitter -e native_debug -e native_cycle_oregon -e native_cycle_oregon_vcc -e native_cycle_lacrosse -e native_cycle_x10 + run: pio test -d emitter -e native_debug -e native_cycle_oregon -e native_cycle_oregon_vcc -e native_cycle_oregon_divider -e native_cycle_lacrosse -e native_cycle_x10 - name: Run tinyDecoders native tests run: pio test -d tinyDecoders -e native - name: Compile-fail checks @@ -59,7 +59,7 @@ jobs: strategy: fail-fast: false matrix: - env: [S_02, S_03, S_04, S_05, robot, devmodule, SOLAR_TEST] + env: [S_02, S_03, S_04, S_05, robot, devmodule, SOLAR_TEST, mushroom] steps: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 From 41221199f205ee701eefab5a09c743eb59f1edce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:28 +0100 Subject: [PATCH 18/24] conf(CONF-DECODE-002): tinyDecoders artifacts firmware-tinydecoders-promicro and firmware-tinydecoders-promini The release step no longer special-cases the unsuffixed promini artifact. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10de5581..213b9cd8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,7 @@ jobs: if-no-files-found: error retention-days: 30 - # 433 MHz receiver firmware: promini (production), promicro (prototype) + # 433 MHz receiver firmware: promicro (production), promini (alternative build) build-tinydecoders: name: Build tinyDecoders runs-on: ubuntu-latest @@ -111,7 +111,7 @@ jobs: - name: Upload promini firmware artifact uses: actions/upload-artifact@v7 with: - name: firmware-tinydecoders + name: firmware-tinydecoders-promini path: | tinyDecoders/.pio/build/promini/firmware.hex tinyDecoders/.pio/build/promini/firmware.elf @@ -146,7 +146,6 @@ jobs: mkdir release for d in firmware/*/; do n=$(basename "$d"); n=${n#firmware-} - [ "$n" = tinydecoders ] && n=tinydecoders-promini for f in "$d"*; do cp "$f" "release/$n.${f##*.}"; done done ls release From 4844a49b4b3a4ab75d824fb83788678620607314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:41 +0100 Subject: [PATCH 19/24] conf(CONF-DECODE-003): platformio.ini comments name the Pro Micro production and the Pro Mini alternative Co-Authored-By: Claude Opus 5.5 --- tinyDecoders/platformio.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tinyDecoders/platformio.ini b/tinyDecoders/platformio.ini index 3eb41ed1..45b91312 100644 --- a/tinyDecoders/platformio.ini +++ b/tinyDecoders/platformio.ini @@ -8,9 +8,10 @@ test_framework = unity lib_extra_dirs = ../lib build_flags = -DNATIVE -; Production receiver firmware: Pro Mini 5 V / 16 MHz (ATmega328P), standalone +; Alternative receiver firmware: Pro Mini 5 V / 16 MHz (ATmega328P), standalone ; OLED viewer with RFLink lines on the debug UART (CONF-DECODE-004). Default -; upload: arduino protocol through the Pro Mini bootloader. 128 B serial TX +; upload: arduino protocol through the Pro Mini bootloader, over a USB-serial +; adapter. 128 B serial TX ; buffer: room for two RFLink lines. [env:promini] platform = atmelavr @@ -18,7 +19,7 @@ board = pro16MHzatmega328 framework = arduino build_flags = -DSERIAL_TX_BUFFER_SIZE=128 -; Receiver firmware with RFLink USB output: Pro Micro 5 V / 16 MHz +; Production receiver firmware, RFLink lines on USB: Pro Micro 5 V / 16 MHz ; (ATmega32U4), Arduino framework for the USB CDC stack (CONF-DECODE-003). ; Default upload: avr109 through the Caterina bootloader. Wire is in the core. [env:promicro] From 38cfc74a38793745226005d551afbb926989b9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 16:53:41 +0100 Subject: [PATCH 20/24] plan: audit 2026-11-19, all 13 findings fixed Co-Authored-By: Claude Opus 5.5 --- audits/2026-11-19-audit.md | 59 +++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/audits/2026-11-19-audit.md b/audits/2026-11-19-audit.md index 62a0e2ab..6fcb65c0 100644 --- a/audits/2026-11-19-audit.md +++ b/audits/2026-11-19-audit.md @@ -12,19 +12,26 @@ Plugin rbd 0.16.0. Agents: `audit-traceability`, `audit-coherence`, plus a Markd | # | Finding | Status | |---|---------|--------| -| 1 | TECH-HAL-004 says JP6 has a default 1-2 bridge; on v3.0 it is delivered open, and 2-3 wires PA5 to SDO | open | -| 2 | PLAT-POWER-007 is validated for every board but only v3.0 was checked; v2.2 boards are in service | open | -| 3 | The TECH-HAL-004 architecture row omits the PA5 DIDR0 input-buffer disable | open | -| 4 | WIRING.md / VARIANTE_LM35.md: analog input and JP3 described backwards (R4 is not in series, JP3 closed bypasses C3) | open | -| 5 | README.md and CLAUDE.md call the environment protocol "Oregon Scientific v3"; frames are Oregon v2.1 | open | -| 6 | CLAUDE.md says "No pre-push hook" and lists fewer prefixes than README | open | -| 7 | Receiver production board: wiring and enclosure docs say Pro Micro, requirements and architecture say Pro Mini | open | -| 8 | WIRING.md says v2.2 boards share the same connectors | open | -| 9 | Environment, test and CI lists are stale (mushroom, native_cycle_oregon_divider, test_main_cycle, main() description) | open | -| 10 | v2.2-only notes not marked as such (debugWIRE board, remove BME280 to flash, merged branch, J3 drill) | open | -| 11 | BACKLOG.md statuses and references are stale (R8, R19, superseded 2026-11-06 list, R13 line numbers) | open | -| 12 | Module wiring tables lack wire end types and lengths (CLAUDE.md convention) | open | -| 13 | enclosing/README.md shield.3mf objects column incomplete | open | +| 1 | TECH-HAL-004 says JP6 has a default 1-2 bridge; on v3.0 it is delivered open, and 2-3 wires PA5 to SDO | fixed | +| 2 | PLAT-POWER-007 is validated for every board but only v3.0 was checked; v2.2 boards are in service | fixed | +| 3 | The TECH-HAL-004 architecture row omits the PA5 DIDR0 input-buffer disable | fixed | +| 4 | WIRING.md / VARIANTE_LM35.md: analog input and JP3 described backwards (R4 is not in series, JP3 closed bypasses C3) | fixed | +| 5 | README.md and CLAUDE.md call the environment protocol "Oregon Scientific v3"; frames are Oregon v2.1 | fixed | +| 6 | CLAUDE.md says "No pre-push hook" and lists fewer prefixes than README | fixed | +| 7 | Receiver production board: wiring and enclosure docs say Pro Micro, requirements and architecture say Pro Mini | fixed | +| 8 | WIRING.md says v2.2 boards share the same connectors | fixed | +| 9 | Environment, test and CI lists are stale (mushroom, native_cycle_oregon_divider, test_main_cycle, main() description) | fixed | +| 10 | v2.2-only notes not marked as such (debugWIRE board, remove BME280 to flash, merged branch, J3 drill) | fixed | +| 11 | BACKLOG.md statuses and references are stale (R8, R19, superseded 2026-11-06 list, R13 line numbers) | fixed | +| 12 | Module wiring tables lack wire end types and lengths (CLAUDE.md convention) | fixed | +| 13 | enclosing/README.md shield.3mf objects column incomplete | fixed | + +## Resolution (2026-11-19) + +- 1–3: TECH-HAL-004 (JP6 delivered open; bench check done on the v2.2 mushroom) and PLAT-POWER-007 (v2.2 checked on the bench by the user: pull-ups to SENSOR_VCC, BME280 reads), architecture rows updated. +- 4–6, 8, 10–13: documentation fixed (WIRING analog input and JP3 from the netlist, Oregon v2.1, pre-push hook prefixes, v2.2 differences and v2.2-only notes, BACKLOG statuses, wire end types and lengths, shield.3mf objects). +- 7: decided by the user: the Pro Micro is the production receiver (powered, flashed and read over its USB), the Pro Mini the alternative build; CONF-DECODE-002/003/004, architecture, environments.md, CI artifacts (`firmware-tinydecoders-promicro`, `firmware-tinydecoders-promini`) and platformio.ini comments updated. +- 9: docs fixed; new CONF-BUILD-015, and the CI now tests `native_cycle_oregon_divider` and builds `mushroom`. ## Findings @@ -32,49 +39,49 @@ Plugin rbd 0.16.0. Agents: `audit-traceability`, `audit-coherence`, plus a Markd **Type:** Coherence — precision (C2) **Requirement:** TECH-HAL-004 **Issue:** The text says PA5 (MISO) only reaches the ISP header J6 and "pad 3 of the BME280 address jumper JP6 (open with the default 1–2 bridge)". On v3.0, JP6 is delivered open and one side is bridged at assembly (WIRING.md Jumpers table, BOM.md); with 2-3, PA5 is wired to the sensor SDO. PLAT-POWER-003 already allows for that. The reason given for leaving PA5 without a pull-up assumes the 1-2 bridge. -**Status:** open +**Status:** fixed ### Finding 2 **Type:** Coherence — precision (C2) **Requirement:** PLAT-POWER-007 **Issue:** The requirement states a rule for every board ("Every sensor board pulls its sensor buses … up with external resistors") but its own text says only the v3.0 schematic was checked. The mushroom runs a cut v2.2 board; no doc records which pull-ups a v2.2 board has or which rail they go to, so a v2.2 board cannot be judged against it. Either limit the scope to v3.0 or record the v2.2 pull-ups and rail. -**Status:** open +**Status:** fixed ### Finding 3 **Type:** Coherence — architecture coherence (C5) **Requirement:** TECH-HAL-004 **Issue:** The `docs/architecture.md` traceability row lists the power reduction, `PORTA = 0` and the PB2/PB3 pull-ups, but not the PA5 digital input buffer disable (`DIDR0` bit `ADC5D`) that the requirement now includes. -**Status:** open +**Status:** fixed ### Finding 4 **Type:** Documentation — wrong **Files:** hardware/tinysensor/WIRING.md:19 and :36, hardware/tinysensor/VARIANTE_LM35.md:117 **Issue:** "AIN (PA0, through R4 75 Ω)": in the netlist, J7.2, R4.1 and U1.13 are one net (`/Analog_sensor`), so PA0 is direct and R4 runs from PA0 to C3/JP3. "JP3 closed: 1 µF from PA0 to GND, RC filter with R4" is the opposite: JP3 closed shorts C3 and leaves R4 from PA0 to GND (LDR, negative LM35); the R4 + C3 filter exists only with JP3 open. README.md:129 and :134 describe it correctly. -**Status:** open +**Status:** fixed ### Finding 5 **Type:** Documentation — wrong **Files:** README.md:32, CLAUDE.md:45 **Issue:** "Oregon Scientific v3": the frames use the Oregon v2.1 layout (lib/oregon/Oregon_v3.h, docs/architecture.md, FUNC-OREGON-*). Suggested: "Oregon Scientific v2.1 (class `OregonV3`)". -**Status:** open +**Status:** fixed ### Finding 6 **Type:** Documentation — wrong **File:** CLAUDE.md:136 **Issue:** "No pre-push hook": the rbd plugin's pre-push hook checks commit prefixes (README.md:75, `.rbd/config.yml` `extra_commit_prefixes`). README also lists `fix:`/`chore:`, CLAUDE.md does not. -**Status:** open +**Status:** fixed ### Finding 7 **Type:** Documentation — cross-document contradiction **Files:** hardware/receiver/WIRING.md:5-7, enclosing/receiver/README.md:3 vs docs/environments.md:61-62, docs/architecture.md:107 and :173, CONF-DECODE-003 **Issue:** The wiring and enclosure docs build the receiver on a Pro Micro (`promicro`); the requirement, architecture and environments say the Pro Micro is a breadboard prototype and the production receiver is the Pro Mini. Needs a decision, then one side aligned. -**Status:** open +**Status:** fixed ### Finding 8 **Type:** Documentation — wrong **File:** hardware/tinysensor/WIRING.md:5 **Issue:** "v2.2 boards share the same connectors": v2.2 has the "I2C"/"I2C_SPI" footprints instead of J3/J14, a screw-terminal J13 and no Q1 (BACKLOG.md, REWORK_v2.2.md). -**Status:** open +**Status:** fixed ### Finding 9 **Type:** Documentation — stale (and CI coverage) @@ -87,7 +94,7 @@ Plugin rbd 0.16.0. Agents: `audit-traceability`, `audit-coherence`, plus a Markd - "`main()` is a single `while(1)` loop": the cycle is `runCycle(Hal*)`, `main` loops on it (TECH-MAIN-001). Fix the docs, and either add both environments to CI (a `conf(CONF-…)` change) or say they are not built there. -**Status:** open +**Status:** fixed ### Finding 10 **Type:** Documentation — stale (v2.2-only notes) @@ -97,25 +104,25 @@ Fix the docs, and either add both environments to CI (a `conf(CONF-…)` change) - "production boards are not designed for debugWIRE": v3.0 meets the constraints (R5 10 k, no capacitor on RESET), only v2.2 and earlier need the dedicated board; - "the sleep fix is on branch `hw/schematic-upgrade`": merged long ago (PR #47), flash master; - J3 holes "Ø0.95": v3.0 drills are 1.05 mm. -**Status:** open +**Status:** fixed ### Finding 11 **Type:** Documentation — stale **File:** hardware/tinysensor/BACKLOG.md:22, :27, :33, :92-100, :108, :111 **Issue:** R8 still shows as open (handled by C1 220 µF low-leakage, :126); R19 has no status (handled by R9/R10, :123); the 2026-11-06 "Fixed" list still states superseded facts (BT1, "R9 10 kΩ on RESET", C8, C6 0805, M2.5 holes, MH5) without marking; R13 cites old `platformio.ini` line numbers. -**Status:** open +**Status:** fixed ### Finding 12 **Type:** Documentation — convention (CLAUDE.md wire rules) **Files:** hardware/tinysensor/WIRING.md:64-115, hardware/tinysensor/REWORK_v2.2.md:46-50 **Issue:** The module wiring tables (J2, J1, J3, J5, J7) give a colour only, with no end types and no length; the REWORK W7–W9 table has colour and length but no end types. -**Status:** open +**Status:** fixed ### Finding 13 **Type:** Documentation — minor **File:** enclosing/README.md:29 **Issue:** The shield.3mf objects column omits "Assiette"; "4 plates" reads as four Orca plates while the project has two (update_3mf.py: `("Abri", [...]), ("Assiettes", ["Assiette"] * 4)`). -**Status:** open +**Status:** fixed ## Info (no action required) From 23e0e0151f144eef981c4a926433e6fe3847d424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 17:01:41 +0100 Subject: [PATCH 21/24] req(TECH-HAL-004): bench check still pending (mushroom not reflashed yet), to do with the R9/R10 check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User: "toujours validé, on peut faire ça plus tard, avec la validation des R330 également". Co-Authored-By: Claude Opus 5.5 --- requirements/technical.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/technical.md b/requirements/technical.md index ca99a0c1..126e9328 100644 --- a/requirements/technical.md +++ b/requirements/technical.md @@ -31,7 +31,7 @@ **Title:** Attiny84aHal constructor disables Timer1, ADC, and analog comparator; no pull-up on PORTA, PA5 digital input buffer off, pull-ups on PB2 and PB3 **Status:** validated **Dependencies:** [PLAT-POWER-007](platform.md#plat-power-007) -**Description:** `Attiny84aHal()` calls `UseLessPowerAsPossible()`, which sets `DDRA`/`DDRB` to 0, sets `PORTA = 0` (no internal pull-up on any PORTA pin) and `PORTB = 0b11111100` (pull-ups on PB2 and PB3, the only other PORTB pins: PB4–PB7 don't exist on the ATtiny84A; PB0 and PB1 are then made outputs for the radio and the LED; with `USE_SWITCHED_5V`, PB2's pull-up is cleared again, [TECH-HAL-007](#tech-hal-007), [PLAT-POWER-006](platform.md#plat-power-006)), disables the analog comparator (`ACSR|=ACD`), disables Timer1 (`PRR|=PRTIM1`), clears `ADCSRA` and disables the ADC (`PRR|=PRADC`). Brownout detection is disabled before each sleep period by `sleep()`, not here ([TECH-HAL-007](#tech-hal-007)). PORTA has no unused pin: PA0/PA1 are analog inputs, PA2 (`SENSOR_VCC`) and PA7 are outputs, and PA3–PA6 are the sensor bus pins, PA3/PA4/PA6 pulled up externally to `SENSOR_VCC` ([PLAT-POWER-007](platform.md#plat-power-007)). PA5 (MISO) has no pull-up at all. It reaches the ISP header J6 and pad 3 of the BME280 SDO jumper JP6, and reaches the sensor SDO only when JP6 is bridged 2–3. On v3.0, JP6 is delivered open and one side is bridged at assembly: 1–2 ties SDO to GND, which gives I2C address 0x76, the address the firmware reads; 2–3 ties SDO to PA5, for SPI, and in I2C mode SDO would then follow the floating PA5 and the address would be undefined. The constructor disables its digital input buffer (`DIDR0` bit `ADC5D`, next to `ADC1D` and `ADC2D`), so the floating pin draws no current in the input stage while awake; ISP programming is not affected, since `DIDR0` is cleared by reset. While the MCU is awake with PA2 low (boot and wake before the sensors are powered, after they are powered off before sleep), an internal pull-up on PA3–PA6 would drive current through the external pull-ups into PA2 and back-power the sensors. Verification: AVR only, no native test (`TestHal_` has no registers): inspection and the AVR builds; bench check done on 2026-11-19 on the v2.2 mushroom board: the BME280 is read with the external pull-ups only. +**Description:** `Attiny84aHal()` calls `UseLessPowerAsPossible()`, which sets `DDRA`/`DDRB` to 0, sets `PORTA = 0` (no internal pull-up on any PORTA pin) and `PORTB = 0b11111100` (pull-ups on PB2 and PB3, the only other PORTB pins: PB4–PB7 don't exist on the ATtiny84A; PB0 and PB1 are then made outputs for the radio and the LED; with `USE_SWITCHED_5V`, PB2's pull-up is cleared again, [TECH-HAL-007](#tech-hal-007), [PLAT-POWER-006](platform.md#plat-power-006)), disables the analog comparator (`ACSR|=ACD`), disables Timer1 (`PRR|=PRTIM1`), clears `ADCSRA` and disables the ADC (`PRR|=PRADC`). Brownout detection is disabled before each sleep period by `sleep()`, not here ([TECH-HAL-007](#tech-hal-007)). PORTA has no unused pin: PA0/PA1 are analog inputs, PA2 (`SENSOR_VCC`) and PA7 are outputs, and PA3–PA6 are the sensor bus pins, PA3/PA4/PA6 pulled up externally to `SENSOR_VCC` ([PLAT-POWER-007](platform.md#plat-power-007)). PA5 (MISO) has no pull-up at all. It reaches the ISP header J6 and pad 3 of the BME280 SDO jumper JP6, and reaches the sensor SDO only when JP6 is bridged 2–3. On v3.0, JP6 is delivered open and one side is bridged at assembly: 1–2 ties SDO to GND, which gives I2C address 0x76, the address the firmware reads; 2–3 ties SDO to PA5, for SPI, and in I2C mode SDO would then follow the floating PA5 and the address would be undefined. The constructor disables its digital input buffer (`DIDR0` bit `ADC5D`, next to `ADC1D` and `ADC2D`), so the floating pin draws no current in the input stage while awake; ISP programming is not affected, since `DIDR0` is cleared by reset. While the MCU is awake with PA2 low (boot and wake before the sensors are powered, after they are powered off before sleep), an internal pull-up on PA3–PA6 would drive current through the external pull-ups into PA2 and back-power the sensors. Verification: AVR only, no native test (`TestHal_` has no registers): inspection and the AVR builds; bench check pending: BME280 read with the external pull-ups only, once the mushroom is reflashed with this firmware (to do with the v3.0 R9/R10 330 Ω check). --- From 9644991fba2939e336603c71a40ac1806dca05b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 17:01:41 +0100 Subject: [PATCH 22/24] req(PLAT-POWER-007): v2.2 pull-ups to SENSOR_VCC confirmed, BME280 bench check with this firmware pending Co-Authored-By: Claude Opus 5.5 --- requirements/platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/platform.md b/requirements/platform.md index 4b3f28d4..447ae603 100644 --- a/requirements/platform.md +++ b/requirements/platform.md @@ -63,7 +63,7 @@ **Status:** validated **Dependencies:** [PLAT-POWER-002](#plat-power-002) **derives_from:** [FUNC-SENSOR-001](functional.md#func-sensor-001) -**Description:** Every board running this firmware has external pull-ups on its sensor buses, to `SENSOR_VCC`, the sensor rail switched by PA2: SCL (PA4) and SDA (PA6) for the I2C bus, and the 1-Wire bus (PA3), which serves the DS18B20. The firmware enables no internal pull-up on these pins ([TECH-HAL-004](technical.md#tech-hal-004)), so a board without them has no working I2C bus. On v3.0 they are three 4.7 kΩ resistors: R3 on SCL, R2 on SDA, R6 on 1-Wire; R3 and R2 sit on the sensor-connector side of the 330 Ω series resistors R9 (SCL) and R10 (SDA), which keep the ISP lines free of the sensor. Both buses are therefore unpowered whenever PA2 is low ([PLAT-POWER-002](#plat-power-002)). Verified by inspection of the v3.0 schematic (`hardware/tinysensor/tinysensor.kicad_sch`); on the v2.2 board (mushroom), checked on the bench on 2026-11-19: its I2C pull-ups go to `SENSOR_VCC` and the BME280 reads correctly with no internal pull-up (values not recorded). +**Description:** Every board running this firmware has external pull-ups on its sensor buses, to `SENSOR_VCC`, the sensor rail switched by PA2: SCL (PA4) and SDA (PA6) for the I2C bus, and the 1-Wire bus (PA3), which serves the DS18B20. The firmware enables no internal pull-up on these pins ([TECH-HAL-004](technical.md#tech-hal-004)), so a board without them has no working I2C bus. On v3.0 they are three 4.7 kΩ resistors: R3 on SCL, R2 on SDA, R6 on 1-Wire; R3 and R2 sit on the sensor-connector side of the 330 Ω series resistors R9 (SCL) and R10 (SDA), which keep the ISP lines free of the sensor. Both buses are therefore unpowered whenever PA2 is low ([PLAT-POWER-002](#plat-power-002)). Verified by inspection of the v3.0 schematic (`hardware/tinysensor/tinysensor.kicad_sch`); on the v2.2 board (mushroom), the user checked on 2026-11-19 that its I2C pull-ups go to `SENSOR_VCC` (values not recorded); bench check pending: BME280 read with no internal pull-up once the mushroom runs this firmware. --- From 1bbc93d9b50c43ddda70b6ee0593b7e37d8bc91c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 17:01:41 +0100 Subject: [PATCH 23/24] arch(PLAT-POWER-007): row says the v2.2 bench check is pending Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture.md b/docs/architecture.md index aa0f405c..aa1554f9 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -258,7 +258,7 @@ Every physical board is a separate PlatformIO environment with its own `build_fl | [PLAT-POWER-004](../requirements/platform.md#plat-power-004) | `main.cpp` | TRANSMIT_WITH_LED macro wraps every Send(): LedOn() before, LedOff() + Delay30ms() after | | [PLAT-POWER-005](../requirements/platform.md#plat-power-005) | `Attiny84aHal` / `platformio.ini` | ATtiny84a at F_CPU = 1 000 000 L; all HAL delay methods calibrated to this frequency | | [PLAT-POWER-006](../requirements/platform.md#plat-power-006) | `Attiny84aHal` | `USE_SWITCHED_5V`: PORTB.2 cleared in constructor; PowerOnSensors() sets DDRB.2 (PB2 low, PNP on), PowerOffSensors() clears it (high impedance) | -| [PLAT-POWER-007](../requirements/platform.md#plat-power-007) | board (`hardware/tinysensor`) | Board requirement, every board (v2.2 checked on the bench 2026-11-19: pull-ups to SENSOR_VCC); on v3.0: I2C pull-ups R3 (SCL, PA4) / R2 (SDA, PA6), sensor side of the R9/R10 330 Ω series resistors and 1-Wire pull-up R6 (PA3), 4.7 kΩ to SENSOR_VCC (PA2); buses unpowered while PA2 is low. Firmware side: no internal pull-up on these pins ([TECH-HAL-004](../requirements/technical.md#tech-hal-004)); PA3 released after the DS18B20 read ([TECH-SENSOR-001](../requirements/technical.md#tech-sensor-001), draft, not implemented) | +| [PLAT-POWER-007](../requirements/platform.md#plat-power-007) | board (`hardware/tinysensor`) | Board requirement, every board (v2.2: pull-ups to SENSOR_VCC, BME280 bench check with this firmware pending); on v3.0: I2C pull-ups R3 (SCL, PA4) / R2 (SDA, PA6), sensor side of the R9/R10 330 Ω series resistors and 1-Wire pull-up R6 (PA3), 4.7 kΩ to SENSOR_VCC (PA2); buses unpowered while PA2 is low. Firmware side: no internal pull-up on these pins ([TECH-HAL-004](../requirements/technical.md#tech-hal-004)); PA3 released after the DS18B20 read ([TECH-SENSOR-001](../requirements/technical.md#tech-sensor-001), draft, not implemented) | | [TECH-HAL-007](../requirements/technical.md#tech-hal-007) | `Attiny84aHal` / `main.cpp` | `Hibernate(s)` → static `sleep(s)` (`s >> 3`, min 1; saves/restores PRR, DDRA, DDRB, PORTA, PORTB; `sleep_bod_disable()` before each `sleep_cpu()`); `PowerOnSensors`/`PowerOffSensors` drive PA2 (and `DDRB.2` with `USE_SWITCHED_5V`); `TRANSMIT_WITH_LED(code)` = `LedOn`, code, `LedOff`, `Delay30ms` | | [TECH-DECODE-001](../requirements/technical.md#tech-decode-001) | `Loopback` (tinyDecoders) | Orders tokens to level/duration pulses with nominal durations (A 400, D 512, P 1024, T 560, U 1120, Q 8960, R 4500, G 40000 µs); native env of tinyDecoders builds repo `lib/` | | [FUNC-DECODE-001](../requirements/functional.md#func-decode-001) | `X10Decoder` (tinyDecoders) | `Feed(high, durationUs)` true on the last bit of a valid RFXmeter frame; windows nominal ±30 % (Q 8960 / R 4500, bit 560 high, 560 or 1680 low); `Address()` = b0, `Value()` = (b4<<16)\|(b2<<8)\|b3 | From f28946b37d107e906ebc447375019f543a55c6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Labrosse?= Date: Thu, 19 Nov 2026 17:01:41 +0100 Subject: [PATCH 24/24] plan: audit 2026-11-19 resolution notes the pending bench check Co-Authored-By: Claude Opus 5.5 --- audits/2026-11-19-audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audits/2026-11-19-audit.md b/audits/2026-11-19-audit.md index 6fcb65c0..32eaa1a4 100644 --- a/audits/2026-11-19-audit.md +++ b/audits/2026-11-19-audit.md @@ -28,7 +28,7 @@ Plugin rbd 0.16.0. Agents: `audit-traceability`, `audit-coherence`, plus a Markd ## Resolution (2026-11-19) -- 1–3: TECH-HAL-004 (JP6 delivered open; bench check done on the v2.2 mushroom) and PLAT-POWER-007 (v2.2 checked on the bench by the user: pull-ups to SENSOR_VCC, BME280 reads), architecture rows updated. +- 1–3: TECH-HAL-004 (JP6 delivered open) and PLAT-POWER-007 (v2.2 pull-ups to SENSOR_VCC, confirmed by the user), architecture rows updated. The BME280 bench check with `PORTA = 0` stays pending until the mushroom is reflashed (with the v3.0 R9/R10 check). - 4–6, 8, 10–13: documentation fixed (WIRING analog input and JP3 from the netlist, Oregon v2.1, pre-push hook prefixes, v2.2 differences and v2.2-only notes, BACKLOG statuses, wire end types and lengths, shield.3mf objects). - 7: decided by the user: the Pro Micro is the production receiver (powered, flashed and read over its USB), the Pro Mini the alternative build; CONF-DECODE-002/003/004, architecture, environments.md, CI artifacts (`firmware-tinydecoders-promicro`, `firmware-tinydecoders-promini`) and platformio.ini comments updated. - 9: docs fixed; new CONF-BUILD-015, and the CI now tests `native_cycle_oregon_divider` and builds `mushroom`.