You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
board-detect: identify the firmware in the beacon, and build for WROOM + C5
Two halves of the same release.
Beacon identity. The liveness beacon is now "PING FTRP <ver>" rather than a
bare "PING". Detection parses it and matches the magic, instead of treating
any received bytes as proof of a board, which let a board flashed with
something else pass as ours. The version drives a three-way Start Portal
outcome: no magic beacon prompts an install, an older version prompts an
update, current proceeds. A handshake watchdog drops back to that prompt if a
detected board never reaches broadcasting within ~8s, rather than sitting on
"Starting portal..." forever. "Flash Firmware" becomes "Reinstall firmware"
and flashes the image bundled in the fap, so there is no SD file picker, and
the flasher's done screen now says to tap RESET, which the board genuinely
needs because it is still held in the download bootloader.
Boards. The sketch would not compile on the 3.x core at all: onStaIp()
resolved a station MAC through esp_netif_get_sta_list(), which esp-idf 5
removed. On 3.x the assign event carries the MAC directly, so both paths now
sit behind ESP_ARDUINO_VERSION_MAJOR. That unblocks the C5, which only exists
in the 3.x line, and CI compiles S2 and WROOM on the pinned 2.0.17 and the C5
on 3.3.11 so the branch cannot rot. Releases attach one merged image per
board, flashable at 0x0 with no esptool on PATH (tools/merge-image.py, which
the C5 core install would otherwise remove). Async libraries move to the
maintained ESP32Async forks, since the me-no-dev ones do not build on 3.x.
Fixes#1.
Claude-Session: https://claude.ai/code/session_01UraqY8Ld2E3zzGVN636Lw7
Copy file name to clipboardExpand all lines: docs/PROTOCOL.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ All line-oriented. The Flipper parser matches on the leading token.
37
37
|`BYE mac=<AA:BB:...>`| A station left the AP — the Flipper drops it from the live client list. |
38
38
|`IP mac=<AA:BB:...> ip=<ip>`| DHCP assigned a station its IP (MAC resolved from the soft-AP table). Falls back to `IP ip=<ip>` when the MAC can't be resolved; the Flipper then pairs it to the most recent client without an IP. |
39
39
|`CRED ip=<ip>&<field>=<val>&...`| A form was submitted — the client IP plus every submitted field, url-encoded. One line per submission. |
40
-
|`PING`| Liveness beacon, emitted ~every 2s. The Flipper uses it to detect an unplugged board (no `PING`/traffic for 5s ⇒ link lost); it's dropped from the console so it doesn't spam. |
40
+
|`PING FTRP <ver>`| Liveness + identity beacon, emitted ~every 2s. The magic `FTRP` marks the board as running Flytrap firmware (detection keys off *this*, not "any bytes", so a board flashed with something else isn't adopted), and `<ver>` is the wire-protocol version — the Flipper prompts an update when it's behind `FLYTRAP_FW_VERSION`. Also drives unplug detection (no beacon/traffic for 5s ⇒ link lost). Dropped from the console so it doesn't spam. |
41
41
42
42
## Handshake
43
43
@@ -57,15 +57,20 @@ Flipper ESP
57
57
| <---- IP mac=... ip=...(DHCP leases it an address)
58
58
| <---- CRED ip=...&... (a form is submitted)
59
59
| <---- BYE mac=... (the phone leaves)
60
-
| <---- PING (~every 2s, all the while)
60
+
| <---- PING FTRP <ver> (~every 2s, all the while)
61
61
| |
62
62
| stop\n / reset\n ----> | (tear down / reboot)
63
63
```
64
64
65
-
If the ESP emits `STATUS boot` mid-session (it rebooted), the Flipper re-sends
66
-
`sethtml` automatically to recover. If `PING` (and all other traffic) stops for
67
-
5s, the Flipper flags the link as lost and the dashboard shows **Board
68
-
disconnected** until the board returns.
65
+
Before the handshake the Flipper first **detects** the board by waiting for a
0 commit comments