-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Wemos D1 mini bricked (no WiFi) after OTA upload - with new wifi credentials #8674
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
Comments
Do you mean the issue happens after update from firmware using Core 2.7.4 to 3.0.2? |
Hm, WiFi.persistent(false); sadly does not help. I tested this bricked ESP with basic WiFi AP sketch and it works fine, so WiFi hardware is still operational. It is madness that no matter what I do, in WiFi STA mode, the bricked ESP is unable to connect, but the new one runs any WiFi STA sketch fine including my sketch, the bricked one can't run any STA sketch successfully. I have no clue what exactly OTA did to mess with Wifi STA connectivity, and how can i fix it, it is more about other 2.7.4 devices that I don't want to brick in the future with OTA. |
That 2.7.4 version in combination with OTA is a nuisance. I found out that I still have 2.7.4 core active on my weekend loghouse Linux box. Didn't know that before I wanted to remotely update some other ESP with some sensors in the loghouse, but updating 2.7.4 over 3.0.2 also causes issues, now ESP is not accessible via OTA anymore but luckily WiFi and my code still work as I haven't messed with credentials in that case. 3.0.2 is awesome and stable for OTA, but getting rid of all that 2.7.4 is a pain with all embedded devices. |
I may have foggy memory about which settings are simply ignoring that flag... Perhaps, one also needs to forcibly disable 'auto{re}connect'; at least one of those causes your previously entered credentials to be stored on flash, which in turn causes a connection attempt to be initiated by SDK with those credentials and without any user interaction required. We do have some preventative actions like disconnect(), but may be simply canceling the previous attempt of connection (or, going through with it during that time) without initiating the new one. |
I browsed the forums and GitHub and I found this below, apparently, it tries to force new credentials that are written in code, but it does not repair the poor bricked esp. const char* ssid = "my_ssid"; void setup() I really have no clue how to check what is wrong with the esp wifi_sta hardware that it does not connect on that bricked esp, because it does work with wifi_ap, so the wifi hardware is not broken right? I assume that It messed something up in the flash when it failed the OTA and that register for wifi_sta is broken and can't be set? Or that I messed it up by setting erase all flash and then it stopped working like described in this post>> #3100 Wifi only works once after erasing flash. I did that erase after failing OTA, not understanding the consequences. Possibly I wish too hard for that esp to work again as I have some working spares, but is there still hope, at least I would like to confirm the root cause forESP in sta mode not connecting. And thanks for all your effort, I appreciate it. |
try to select in Tools menu "Erase flash" to "All flash content" for one upload |
I've also had the same here on some module. I got it somewhat "reproducible" when messing around with the WiFi reconnect code. |
Basic Infos
Platform
Settings in IDE
Problem Description
Wemos D1 mini gets bricked aka unable to connect to WiFi after OTA upload with new SSID and password.
By bricked I really mean, no help to it, by loading new different sketch to it via serial still no WiFi connection, if I take new Wemos it runs the same sketch that bricked the other ESP no problem, it runs Wifi and MQTT fine, but I don't want to brick another one just to prove it.
I tried to Erase all Flash contents but it was no help to the bricked ESP.
I faced the same issue previously about 4 times over the last few years, that changing wifi credentials bricks the ESP after reboot, still, I was always able to recover by serial upload, but not this time.
Why is this an issue, and how should I avoid it, maybe with Wifi Manager Library, I've read about it but don't yet know how to use it. The goal is can change the wifi credentials on ESPs without messing things up, and using serial, why do we have OTA? And yes I do stage updates on test devices first.
How can I get bricked ESP back to life what should I upload to it as it is not dead it talks on serial, receives uploads normally, and runs blink sketch just fine, but not Wifi. The madness is that my Wifi MQTT code runs on new ESP but not on bricked one, is it possible to damage internal ESP wifi hardware with code?
The code below should prove the issue, my code has also MQTT which has nothing to do with the issue.
To prove it just follow these steps:
The issue may not emerge if the code running ESP OTA is on the latest core(aka updating over the latest core version), but that does not mean it is fine, as it still breaks old devices by updating via OTA.
Am I the first poking the thin ice on Arduino OTA, as I have not found much related to the issue on google.
Looking forward to finding the solution.
Cheers Matej
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: