-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flash failure from Wifi writing credentials #34
Comments
Related issue: esp8266/Arduino#1054 |
That's interesting. It doesn't seem to happen on ESP32. Does that cause the whole board to boot fail? Or does it only corrupt credentials? |
Similar issue seems to be occurred on Wemos D1 Mini when powered via micro-USB port, but works ok on battery. Though |
@Kamilake No, the board resets if you try to access damaged flash, so credentials can no longer be written. Not sure if it can still be read. Otherwise it appears to work fine |
Need to review Wifi.begin() code for different frameworks and see how to start wifi properly without it being re-written, but still being able to read it on begin and write on credentials change. |
On the wl_status_t ESP8266WiFiSTAClass::begin() {
if(!WiFi.enableSTA(true)) {
// enable STA failed
return WL_CONNECT_FAILED;
}
ETS_UART_INTR_DISABLE();
wifi_station_connect();
ETS_UART_INTR_ENABLE();
if(!_useStaticIp) {
wifi_station_dhcpc_start();
}
return status();
}``` |
Can this be closed? Neither esp32 nor esp8266 does any writing to memory when wifi.begin() is called without arguments. (In fact the function does not even reference if persistence is set to true or false in either function.) |
Did we used to use WiFi.begin(SSID, pass)? Or was this open on error, @Vyolex? |
IDK if it used to be different but atm we only call WiFi.begin(SSID, pass) in |
Wifi.begin() writes credentials to flash every time it is called, on some boards this causes the flash to fail quickly, resulting in Wifi.begin() resetting the board.
Calling Wifi.persistent(false) before Wifi.begin() (and potentially other wifi functions) stops the credentials from being written. On boards with failing flash, this will continue working.
The text was updated successfully, but these errors were encountered: