Repository navigation
Optional STA rejoin from the setup fallback - #1150
Conversation
|
what about AP never show up ? it will scan every 2 min and stay in STA mode without beeing configured again ? |
0218de0 to
0ff148b
Compare
|
It stays in setup AP mode the whole time and remains configurable at the setup IP. It scans every 2 minutes only while no client is connected to the AP, so configuring isn't disturbed. If you prefer, I can add a limit, e.g. stop after N attempts or back off to longer intervals. |
New setting ESP_STA_FALLBACK_RETRY (pos 1257, "sta fallback retry" in network/sta, default off). When it is on and the STA connection failed over to the setup AP, ESP3D scans every 2 minutes (while no client is connected to the AP) and restarts the network once the configured SSID is visible again. If that attempt fails it falls back to setup mode as before. Settings saved by older builds read 0xFF at the new position; the default is written at startup when the stored value is not valid.
0ff148b to
bf952da
Compare
|
no need extra settings to keep it simple, but I think it would be good to add an ESP command for it, to disable easily it if necessary and to get the status if connected by serial |
[ESP109] shows or sets the sta fallback retry setting (ON/OFF, admin to set), so it can be turned off without [ESP401]. When the setup fallback starts with the retry on, "Waiting for STA network" is sent to all clients, next to the existing "STA network found, reconnecting". Documented in espXXX.md, Commands.md and authentication.md.
isValidByteSetting() returns true for any value of an on/off setting, so [ESP109]MAYBE stored 255. Only ON and OFF are written now, anything else gets "Invalid parameter". The 0xFF init check for the setting compares the value directly for the same reason.
|
Thanks, makes sense. I've added [ESP109] to show or set the rejoin (ON/OFF, set needs admin), and when the setup fallback starts with the rejoin on it now sends "Waiting for STA network" to all clients (serial included), next to the existing "STA network found, reconnecting". No new settings. Docs updated in espXXX.md, Commands.md and authentication.md. |
|
merged thank you @all-contributors please add @Mainfurr for code enhancement |
|
I've put up a pull request to add @Mainfurr! 🎉 |
If STA can't connect at boot (for example while the router is rebooting) and
sta fallback modeissetup, ESP3D switches to the setup AP and stays there until someone restarts it. This PR adds an opt-in setting so it rejoins on its own once the network is back.Changes
ESP_STA_FALLBACK_RETRY(position 1257, the first free byte afterESP_USB_SERIAL_BAUD_RATE), shown in[ESP400]as "sta fallback retry" under network/sta. It's no/yes with a default of no, so behaviour is unchanged unless it's turned on.WiFiConfig::handle()starts an async scan every 2 minutes (STA_FALLBACK_RETRY_INTERVAL). If the configured SSID shows up, it callsNetConfig::begin(). If that connection fails again, the normal fallback applies.ESP3DSettings::begin()replaces an invalid value there with the default.Testing
esp32-c3andesp8266dev.Limitations