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
{{ message }}
Repository navigation
Commit 8dfa0b5
Browse filesBrowse the repository at this point in the historyBrowse files
Rescue portal fixes from testing on a C3 dev board
- Close the rescue AP before joining the entered network. With a phone
on the AP the WPA handshake kept timing out (reason 15); with the AP
closed it joined in 2 s. The AP reopens after a minute if it fails.
- Save WiFi config to NVS until the erase starts (then RAM only), so a
network entered before the copy to ota_1 survives that reboot.
- Captive portal: DHCP hands out 192.168.4.1 as DNS, every A query
answers 192.168.4.1, every GET serves the page, so phones pop it up.
- Raise the HTTP header limit to 2048: phones got 431 at 512.
- Name the AP espreswitch-<suffix> with the same suffix ESPresense uses
(last three base-MAC bytes, reversed).
- Log the STA disconnect reason and the received password length; join
PMF-capable.
Tested: no WiFi -> AP at 60 s -> form posted -> joined -> copied to
ota_1 -> rejoined from NVS without the portal -> ESPresense at 380 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ddLgHVXMofL5Z725JL3uM
Copy file name to clipboardExpand all lines: AGENTS.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,8 @@ own bootloader and partition table instead of Tasmota's.
18
18
offset 0. It MD5-checks both the download and a read-back of flash, and retries until both match.
19
19
With no saved WiFi it joins `espreswitch`/`espreswitch` (`config.h`; was `switchbota` before v0.4.1).
20
20
If WiFi is down for a minute, the stage also opens an AP `espreswitch-xxxxxx` with a page at
21
-
192.168.4.1 to enter a new network (kept in RAM only: NVS at `0x9000` is inside the erased region).
21
+
192.168.4.1 to enter a new network. WiFi config is saved to NVS until the erase starts, then RAM only
22
+
(`wifi_stop_persisting()`): NVS (`0x9000` or `0xE000`) is inside the erased region.
22
23
The LEDs (GPIO7/8, active low) show the state, one pattern per stuck state (`espressif/main/led.c`).
23
24
Once erased, only the two erased patterns show. The README "What the LEDs mean" table must
24
25
match `led.c`; update both together.
@@ -65,7 +66,7 @@ reads the partition table at runtime, so it tolerates either of the last two lay
65
66
66
67
## Status (2026-10-11)
67
68
68
-
-`v0.4.0` released (stage `app.bin` + `.md5`): payload info from the server, re-checked on every retry; WiFi rescue portal; LED status. CI is green.
69
+
-`v0.4.2` released (stage `app.bin` + `.md5`): payload info from the server, re-checked on every retry; WiFi rescue portal (captive, AP closes before joining, network kept until the erase); LED status. CI is green.
69
70
-`payload.json` pins `esp32c3.factory.bin` from the **ESPresense v5.0.0b1 pre-release** (release asset,
70
71
so it doesn't expire). Writing it ends at `0x174000`, below both `0x220000` (stock) and `0x1E0000` (Tasmota v11 layout).
71
72
-**Tested end-to-end on 2026-10-11** with v0.4.0:
@@ -75,7 +76,10 @@ reads the partition table at runtime, so it tolerates either of the last two lay
75
76
`/version/wocaotech/firmware/WoPlugUS/WoPlugUS_V12.bin`; nothing more until `57 0F 0B`, which installs
76
77
and reboots. The stage was already in `ota_1` (no `/app.bin` copy), wrote the payload first try,
77
78
and the plug came up as ESPresense.
78
-
- Not exercised yet: the rescue portal, the plug's LED patterns, the Tasmota v11 layout.
79
+
- Rescue portal (v0.4.2, C3 dev board, an ESP32-S3 posting the form): AP opened at 60 s; after the
80
+
save the stage closes the AP, then joins (with the AP open, the WPA handshake timed out: reason 15);
81
+
the network survived the reboot into `ota_1` (saved to NVS until the erase); converted at 380 s.
82
+
- Not exercised yet: the plug's LED patterns, the Tasmota v11 layout.
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,15 +158,15 @@ Two different networks are involved, so keep them apart:
158
158
| Network | Created by | What it's for |
159
159
|---|---|---|
160
160
|`espreswitch` (password `espreswitch`) |**You**, on your router or a phone hotspot | A network the plug **joins** if it has no saved WiFi. It must resolve `wohand.com` to the ESPreSwitch server |
161
-
|`espreswitch-xxxxxx` (open; `xxxxxx`is the end of its MAC address) |**The plug**| A rescue network the plug **opens** after a minute without WiFi, so you can give it one |
161
+
|`espreswitch-xxxxxx` (open; `xxxxxx`matches the `espresense-xxxxxx` network it opens once converted) |**The plug**| A rescue network the plug **opens** after a minute without WiFi, so you can give it one |
162
162
163
163
The stage joins the WiFi network saved in the plug (the one you set in the SwitchBot app). Only if the plug has no saved WiFi at all does it join `espreswitch` instead. If it still has no WiFi after a minute, it opens `espreswitch-xxxxxx`:
164
164
165
-
1. Join `espreswitch-xxxxxx` from a phone or laptop and browse to http://192.168.4.1.
165
+
1. Join `espreswitch-xxxxxx` from a phone or laptop. The page should pop up by itself; if not, browse to http://192.168.4.1.
166
166
2. Enter a WiFi network the plug can use. That network has to resolve `wohand.com` to the ESPreSwitch server: your normal LAN with the DNS override, or any network whose DHCP hands out the server's IP as DNS.
167
-
3. The `espreswitch-xxxxxx` network disappears once the plug connects, and the flash carries on.
167
+
3. The `espreswitch-xxxxxx` network closes as soon as you save, while the plug joins your network (one radio can't do both reliably). If the plug can't join, `espreswitch-xxxxxx` comes back in about a minute: reconnect and check the name and password.
168
168
169
-
This works even after the flash is erased, as long as the plug stays powered. The new network is kept in RAM only, so a power cut loses it, but a power cut after the erase means opening the plug anyway.
169
+
This works even after the flash is erased, as long as the plug stays powered. A network entered before the erase is saved, so it survives the plug's own reboot into its second app slot and you only enter it once. A network entered after the erase is kept in RAM only (the saved-settings area is part of what gets erased), but a power cut after the erase means opening the plug anyway.
170
170
171
171
## Updating the payload
172
172
1. Pick an ESPresense build that publishes `esp32c3.factory.bin` (release asset or CI artifact).
0 commit comments