Commit graph

759 commits

Author SHA1 Message Date
github-actions[bot]
10de32ac99 chore: bump version to v4.0.3 2026-11-15 11:00:14 +00:00
cjkas
f97135ee72
Merge pull request #133 from SidShaytay/codex/21-lilygo-upstream
Add LILYGO T-Embed CC1101 Plus support
2026-11-15 11:53:11 +01:00
R. Sid Shaytay
60d1872f35
Report a dead radio clearly, retry receive once and drop stale repeats
A frequency scan was accepted when the radio was enabled but had failed its
checks, and the client waited for results that never came. It is now refused
with radioUnavailable: "The radio is disabled" or "The radio did not
respond". Generic boards are unchanged (available() equals config.enabled).

One missed switch into RX after a transmission or scan used to disable the
radio until reboot. startReceive() now goes idle and calls SetRx once more
(RADIO_RX_ATTEMPTS = 2, decided by radioRxOutcome) and gives up only after
that. Repeater frames are dropped while the integrated radio is unavailable
instead of being retried and sent stale later.

Serial output in startReceive(), checkBoardRadio() and BoardProfile moves to
ESP_LOG*, and the per-transmission RF switch readback is gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 18:50:41 -08:00
R. Sid Shaytay
28af01195a
Move the board profile tests into the native Unity suite
The board tests ran through tools/test-board-profile.sh with their own stubs, assert() and a script that copied nine method bodies out of Transceiver.cpp, so they were outside pio test -e native and the coverage report.

Pure decisions now live in units the native env builds: BoardProfile::usesPin is constexpr, RadioReadiness decides register validity, the receive-state outcome (ready, retry or unavailable, with one try today) and whether a queued job may transmit, and ShadeGpioGuard decides whether a shade's outputs touch a board pad. Transceiver and ShadeGpio call them with identical behaviour. New Unity suites cover the generic and LILYGO profiles (reserved pads, startup order, radio bring-up) and the readiness unit; the old harness, its script, CI step and stubs are deleted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 18:47:04 -08:00
R. Sid Shaytay
2b3d556729
Show the fixed radio pins as read-only in the web UI
On the integrated-radio board the firmware replaces any radio pins a client
saves with the board's wiring, yet the web UI let the user edit them and
reported success. The radio settings now carry fixedPins (wire key fx),
sent only where the radio is wired to the board. The web UI disables the six
pin selects, shows "Radio wiring is fixed on this board." and skips the pin
duplicate and boot-pin checks for them. Generic builds do not send the
field, so their behaviour is unchanged, and applyBoardPins() stays as the
safety net for old configs and imports.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 18:41:27 -08:00
R. Sid Shaytay
31eda550b9
Rename the Plus-only LILYGO profile to the T-Embed CC1101 names
The profile was named for the Plus model only, but the standard T-Embed
CC1101 is expected to run the same firmware. Rename the macro to
ESPSOMFY_LILYGO_T_EMBED_CC1101, the PlatformIO environment to
lilygo-t-embed-cc1101, and the release files to
SomfyController.{ino,littlefs,onboard}.lilygo-t-embed-cc1101.*, so later
merges with downstream builds match by name. The matrix entry reads
"LILYGO T-Embed CC1101 / Plus". Behavior and partitions are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 18:35:23 -08:00
R. Sid Shaytay
bfd8c1c7b4 docs: invite testing of expected non-Plus CC1101 compatibility 2026-11-14 18:33:33 -08:00
R. Sid Shaytay
fce6f0cb6e docs: distinguish expected CC1101 compatibility from Plus testing 2026-11-14 18:33:33 -08:00
R. Sid Shaytay
9b75bd61f4 ci: build and publish LILYGO Plus release files 2026-11-14 18:33:33 -08:00
R. Sid Shaytay
d4c13d5134 refactor: centralize shade GPIO initialization and board guards
Use one initialization method for saved configuration and JSON updates. Reject the complete output assignment when any pin belongs to integrated board hardware, retaining separate UI validation and runtime output guards. Exercise production GPIO initialization on generic and Plus profiles.
2026-11-14 18:33:33 -08:00
R. Sid Shaytay
a5afcfacea build: match Plus profile to standard upstream S3 layout 2026-11-14 18:33:33 -08:00
R. Sid Shaytay
fdf840a236 feat: support headless LILYGO T-Embed CC1101 Plus
Configure the integrated radio power, shared SPI selects, RF path and fixed wiring without changing generic boards. Preload output latches for Arduino 3 and publish radio availability only after register and RX checks succeed. Reuse the existing partition table and protect integrated, USB and PSRAM pins across configuration and GPIO output paths.

Exercise production setup, RX and queue admission methods in a hardware-boundary host harness, run it in CI and document the opt-in build. Keep restore policy, security corrections and release tooling outside this board-only change.
2026-11-14 18:33:33 -08:00
cjkas
e873dc8309
Merge pull request #134 from cjkas/dependabot/github_actions/actions-401d4b32a3
build(deps): Bump zizmorcore/zizmor-action from 0.8.0 to 0.8.1 in the actions group
2026-11-11 20:00:31 +01:00
dependabot[bot]
45eede772a
build(deps): Bump zizmorcore/zizmor-action
Bumps the actions group with 1 update: [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `zizmorcore/zizmor-action` from 0.8.0 to 0.8.1
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](53290badfa...45d7276c9c)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.8.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-09 11:23:26 +00:00
cjkas
f17eb4c7bb
Merge pull request #130 from cjkas/docs/readme-maintained-fork
docs(readme): present the repo as the maintained ESPSomfy-RTS
2026-11-01 20:26:23 +01:00
github-actions[bot]
2c6835be40 chore: bump version to v4.0.2 2026-11-01 12:04:18 +00:00
cjkas
89299d83a5 docs(readme): present the repo as the maintained ESPSomfy-RTS
The README opened with a note about watchdog restarts and linked
rstrouse's wiki and HA integration, so visitors were sent back to the
unmaintained project. It now says what the project is, what changed
since rstrouse's version, how to install and upgrade, and links this
repo's wiki and the cjkas HA integration. rstrouse is credited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:03:25 +01:00
cjkas
07bffdec6b
Merge pull request #129 from cjkas/docs/adr-0007-ha-update
docs(adr): 0007 - Home Assistant checks GitHub for releases itself
2026-11-01 12:30:51 +01:00
cjkas
e3ea95c576 docs(adr): 0007 - Home Assistant checks GitHub for releases itself
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:29:29 +01:00
cjkas
97a5c92ee3
Merge pull request #128 from cjkas/dependabot/github_actions/actions-ac47fd3c39
build(deps): Bump the actions group with 7 updates
2026-11-01 11:55:20 +01:00
dependabot[bot]
773ffff91b
build(deps): Bump the actions group with 7 updates
Bumps the actions group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.4.0` | `7.0.1` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5.6.0` | `7.1.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.2` |
| [actions/setup-node](https://github.com/actions/setup-node) | `6.5.0` | `7.1.0` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4.3.0` | `8.0.2` |
| [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) | `3.0.1` | `5.0.0` |
| [actions/deploy-pages](https://github.com/actions/deploy-pages) | `4.0.5` | `5.0.1` |


Updates `actions/checkout` from 4.4.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11d5960a32...3d3c42e5aa)

Updates `actions/setup-python` from 5.6.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](a26af69be9...6d4fd22b20)

Updates `actions/upload-artifact` from 4.6.2 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](ea165f8d65...cf430e030d)

Updates `actions/setup-node` from 6.5.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](249970729c...949feb2413)

Updates `actions/download-artifact` from 4.3.0 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](d3f86a106a...9000827ccb)

Updates `actions/upload-pages-artifact` from 3.0.1 to 5.0.0
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](56afc609e7...fc324d3547)

Updates `actions/deploy-pages` from 4.0.5 to 5.0.1
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](d6db90164a...368f825286)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-pages-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/deploy-pages
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-31 18:45:15 +00:00
cjkas
b6c8124bd4
Merge pull request #127 from cjkas/ci/supply-chain
ci: signed release provenance, pinned dependencies, security scanning
2026-10-31 19:41:51 +01:00
cjkas
787cebdb18 ci: review fixes for the release job and set_version.sh
- set_version.sh: three of its four patterns only matched digits and
  dots, so FW_VERSION and index.js stayed at v4.0.0.beta and index.html
  at ?v=3.0.14d. They now match any version, and the script fails when a
  file doesn't end up with the new one. test/scripts/test_set_version.sh
  covers it and runs with the native tests.
- Release job: each build's files are collected from its own folder,
  with 4 files each and no name in two builds, before they're signed.
  The version bump is made on the release's branch as it is now, not the
  tag, so a merge during the builds doesn't reject the push.
- Scorecard reports to code scanning only: publishing from a fork isn't
  supported, so no badge.
- New workflows renamed to .yaml like build.yaml. SECURITY.md: the routes
  open in Secured mode, and which jobs can write what.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 19:34:14 +01:00
cjkas
b4f3b571cf
Merge pull request #126 from cjkas/chore/drop-rstrouse
chore: name cjkas as the manufacturer in MQTT discovery and SSDP
2026-10-31 13:33:28 +01:00
cjkas
5c57d1a2cd ci: signed release provenance, pinned dependencies, security scanning
- Release files get a SHA256SUMS file and a Sigstore-signed build
  provenance attestation (gh attestation verify).
- The workflows read the repo only. A new release job, which runs no
  build tools, is the only one that can write: it uploads the files with
  gh and pushes the version bump. The third-party release actions are gone.
- Every action is pinned to a commit SHA, esptool and the libraries to
  exact versions. The release tag reaches the shell through env, and
  set_version.sh rejects tags that aren't versions.
- New workflows: CodeQL (C++ via the native build, JS, Python, Actions),
  OpenSSF Scorecard, zizmor. Dependabot moves the action pins.
- SECURITY.md: private reporting, checking a download. README badges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:27:48 +01:00
cjkas
ac7dd4bb98 chore: name cjkas as the manufacturer in MQTT discovery and SSDP
The MQTT discovery device's manufacturer and SSDP's manufacturer, model
URL and manufacturer URL now name this fork, so a click from a UPnP
browser lands on this repo. The SSDP device type stays: the Home
Assistant integration discovers devices by it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:27:45 +01:00
cjkas
8c7a2dee12
Merge pull request #125 from cjkas/ci/coverage
ci: coverage reports for the native and web UI tests
2026-10-31 12:14:39 +01:00
cjkas
bd399db73d ci: coverage reports for the native and web UI tests
A coverage env (the native env with gcov counters) runs the native
tests in CI; gcovr writes the HTML report and a table on the run's
summary page. The web UI tests report coverage with Node's built-in
coverage, and genhtml turns its lcov into HTML. Both reports are run
artifacts, and pushes to main publish them to GitHub Pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 12:07:58 +01:00
cjkas
db73190653
Merge pull request #122 from cjkas/fix/gpio12-strapping
fix: warn of radio pins that can stop the board booting (#34)
2026-10-30 18:04:46 +01:00
cjkas
92e69d599f fix: warn of radio pins that block flashing over USB
GPIO2 on the original ESP32, 46 on the S2/S3 and 8 on the C3/C6 don't stop
a normal boot, but held at the wrong level at reset they keep esptool from
starting the download mode.  The WT32-ETH01 wiring puts TX on GPIO2.

Each warning now says what the pin does and what to do: move it for a pin
that stops the boot, disconnect it to flash for one that only blocks USB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 22:54:11 +01:00
cjkas
658f5eabeb fix: review fixes for the boot pin warnings
- The backup record's fallback RX pin is 35, as the radio's default is.
- BootPins.h, pins.js and Transceiver.cpp say to keep the pins, the radio
  pins checked and the shared RX/TX rule in step.
- index.js reads the chip model through one chipModel().
- BootPins.RADIO is RADIO_PINS; the P4 test builds its config once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 22:44:23 +01:00
cjkas
8a59f51111 fix: warn of radio pins that can stop the board booting (#34)
GPIO12 is a strapping pin on the original ESP32: high at reset, it powers
the flash at 1.8 V. A CC1101 can hold GDO2 high at power-up, so a board
with RX on 12 bootloops after a power cut until EN is pressed. It was the
default RX pin.

- RX defaults to GPIO35 on the original ESP32. Saved settings keep their
  pins.
- The log warns each time the radio starts, and the radio settings show a
  warning, while TX, RX or MISO is on a pin whose level at reset can stop
  the chip booting (src/BootPins.h, data-src/js/pins.js).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 22:29:39 +01:00
github-actions[bot]
a92c7a26f6 chore: bump version to v4.0.1 2026-10-29 21:05:46 +00:00
cjkas
bb7438d37d
Merge pull request #121 from cjkas/feat/esp32p4-build
build: add the ESP32-P4 (#29)
2026-10-29 22:04:00 +01:00
cjkas
cbeb56d336 fix: review fixes for the ESP32-P4 build
- The pre-v3 build is for chips before v2.0, not v3.0: the esp32p4_es
  libraries stop at v1.99.  The CI label and comments say so, and that no
  build runs on v2.x or v3.00.
- A save refuses a clock mode the chip can't use: ProtoSettings takes
  CLKMode 0-ETH_CLOCK_ID_MAX, 0 only on the P4.  Before, 1-3 saved and
  then stopped Ethernet at the next start.  A range of one value reads
  "must be 0".
- Tests for the pin limit (54 taken, 55 refused) and the clock limits.
- The web UI's P4 pins leave out strapping pin 36 too.
- The preset says ESP32-P4-WIFI6-POE-ETH, the board's name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 20:10:36 +01:00
cjkas
dfb003d2f7 build: add the ESP32-P4 (#29)
For boards such as Waveshare's ESP32-P4-WIFI6-POE-ETH: WiFi through the
board's ESP32-C6 on SDIO (esp-hosted), Ethernet on the P4's RMII MAC with
an IP101.  Not tested on a device: no P4 board was at hand.

- platformio.ini: env esp32p4 (esp32-p4_r3, chip v3.01+) and esp32p4es
  (esp32-p4, the esp32p4_es libraries, chips before v2.0).  An image runs
  on one of the two only, so each has its own release files, chip models
  "p4" and "p4es".  Both keep the OTA slot: at level 2 they leave about
  128 KB of it.
- Ethernet clock mode: stored as eth_clock_id_t in the ESP32's numbering
  and translated by name, like the PHY id.  The P4's eth_clock_mode_t is
  the IDF's emac_rmii_clock_mode_t, whose 0 is a deprecated default; only
  clock in (GPIO 50) translates there.
- P4 Ethernet defaults: the Waveshare wiring (IP101 as TLK110, address 1,
  MDC 31, MDIO 52, reset 51), board type 8.  The ESP32's put MDIO on an
  SDIO pin.
- Settings take pins up to GPIO 54, the P4's last, instead of 48.
- Radio defaults: SPI 32/33/27, CSN 46 (the framework's Waveshare
  variant), TX 2, RX 3.
- Web UI: a Waveshare ESP32-P4-ETH preset, the P4's clock mode, pin lists
  up to GPIO 54 without the pins the C6 link, Ethernet, USB and UART0 use.
- CI builds and releases both, with their ELFs; bootloader at 0x2000.
- ADR 0003: amended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 19:41:39 +01:00
cjkas
eadd9b801d
Merge pull request #120 from cjkas/ci/release-elf
ci: attach each board's firmware ELF to releases
2026-10-29 19:39:30 +01:00
cjkas
8600c5e811 ci: attach each board's firmware ELF to releases
A crash log on a release build couldn't be decoded: the release had only
the .bin files, and the ELF was a 5-day CI artifact of other runs.  The
panic in #31 names "ELF file SHA256: f85f409205c11d1b" and no copy of that
file exists.

Each release now gets SomfyController.ino.<chip>.elf.zip, built in the
same job as the .bin it decodes.  Beside the ELF is its .sha256: the .bin
embeds that hash, and the panic prints its first digits, so a log shows
which build it came from.  The bug report form asks for the whole panic
and says how to decode it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:53:45 +01:00
github-actions[bot]
1c66c310bd chore: bump version to v4.0.0 2026-10-29 17:12:26 +00:00
cjkas
ddbe106d8c
Merge pull request #119 from cjkas/test/config-records
test: shades.cfg, backups, rolling codes, firmware update and MQTT discovery
2026-10-29 18:08:20 +01:00
cjkas
afbfac5181 Merge origin/main into test/config-records
Both sides added a helper at the end of test/e2e/test_settings.py
(boot_time here, header on main); both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:02:56 +01:00
cjkas
92cd54f097 fix: review fixes for the shades.cfg records
- A group in a backup from before version 23 has no rolling code, and a
  restore wrote 0 to NVS for it.  It keeps the code NVS has.
- A restore reads each record into one that starts as the shade, group
  or settings it replaces, so what an older version lacks stays as it
  was (the update check below version 20 among them), as before.
- restoreFile and loadFile read the rooms, shades and groups through one
  readModel(); the settings, network and radio are applied by helpers.
- The shade's tilt is forgotten where the shades are written, not in the
  conversion to a record.
- rollingCodeAfterLoad moves to RollingCode.h and its tests to
  test_rollingcode.
- The topics a deleted shade or group clears are one list each
  (MqttTopics.h), tested against what is published.
- e2e: a restore of the shades brings back every shade and group, and
  the README has the rollback check by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:25:07 +01:00
cjkas
b525a800b0 test: e2e firmware update, and restarts told apart by boot time
With --reboot, a restore of the radio alone brings it back as it was:
on a board without Ethernet it read the radio from the wrong place.

--firmware <firmware.bin> updates the device through /updateFirmware and
checks it still runs a minute later, after it marks the update good.

wait_for_restart compared uptimes, so a test run right after another
restart could see more uptime than before and fail.  It compares boot
times, and waits while the device hasn't restarted yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:59:53 +01:00
cjkas
64f166490f test: Home Assistant discovery config on the PC
The config a shade publishes for MQTT discovery moves to MqttDisco, with
11 unit tests: the topics, the device, which way each kind of shade
opens, tilt, tilt only and dry contacts.

A deleted group's retained sunSensor topic was never cleared: unpublish
named it SunSensor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:59:53 +01:00
cjkas
8c59cf4903 test: read and write shades.cfg and backups on the PC
The records move to ConfigRecords, free of the file system and the
shade model, with 33 unit tests: each record's size against the header,
a round trip of each, the layouts of versions 2 to 24, and a real backup
when CONFIG_BACKUP names one.

The tests found, and this fixes:
- A quoted value as long as its field (a hostname of 30 or more
  characters, a full NTP server, MQTT host or time zone) was read short,
  and every value after it shifted.
- A comma in a shade, group or room name shifted the rest of its record.
  Names are read at their fixed width.
- 4.0 boards without Ethernet declared the network record 28 bytes longer
  than they wrote it, so a restore of the radio without the network read
  the radio from the middle of its record.  Records are read and skipped
  to their newline, and backup() measures what it writes.
- A restore cleared rooms beyond the backup's only on load.

A restore now takes the backup's rolling codes even when they are lower
than NVS's; a load still keeps the higher.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:59:52 +01:00
cjkas
6ddf7e5790
Merge pull request #118 from cjkas/feat/esp32c5-build
build: add the ESP32-C5
2026-10-29 16:25:32 +01:00
cjkas
3bb32c31e4 docs: name the C5 among the builds with no OTA slot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 16:21:50 +01:00
cjkas
247944bd2b Merge remote-tracking branch 'origin/main' into feat/esp32c5-build 2026-10-29 16:15:01 +01:00
cjkas
11a7088dd3
Merge pull request #116 from cjkas/feat/usb-only-firmware
feat: say when the firmware is flashed over USB
2026-10-29 16:12:50 +01:00
cjkas
9e8ac88893
Merge pull request #114 from cjkas/feat/esp32c3-build
build: bring back the ESP32-C3 build
2026-10-29 16:11:50 +01:00