[SOLVED] ESP8266 crashes on WiFi.disconnect()
Posted: Sat Jan 29, 2022 4:38 pm
Hello,
This is an example that I use to work with "ESP-NOW" WiFi mode. Obviously, there are several ESP8266 communicating each other.
I am experimenting with them for a few weeks and they were working OK.
Today one of them started crashing when reaching
Indeed it does. No crashes but no ESP-NOW connection too.
My guess for the root cause is:
- Wifi needs to write something to Flash in one WiFi function for the sake of other function to read.
- Maybe Flash is damaged somehow and therefore write/read fails and crashes.
My questions:
- How to check this idea?
- Is there better idea or direction to solve the crash problem? Still ESP-NOW communication needed, however I don't have anything to store in the Flash.
Thank you.
This is an example that I use to work with "ESP-NOW" WiFi mode. Obviously, there are several ESP8266 communicating each other.
I am experimenting with them for a few weeks and they were working OK.
Today one of them started crashing when reaching
Code: Select all
line in the code. Here I found that adding WiFi.disconnect();
Code: Select all
before WiFi.persistent(false);
Code: Select all
solves the crash problem.WiFi.disconnect();
Indeed it does. No crashes but no ESP-NOW connection too.
My guess for the root cause is:
- Wifi needs to write something to Flash in one WiFi function for the sake of other function to read.
- Maybe Flash is damaged somehow and therefore write/read fails and crashes.
My questions:
- How to check this idea?
- Is there better idea or direction to solve the crash problem? Still ESP-NOW communication needed, however I don't have anything to store in the Flash.
Thank you.