-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Properly System.restart() esp32 #2500
Comments
Hm, some answers here are missing. Anyway, I'm watching esp-idf's function |
I'm answering myself. the I found that Therefore I'm closing my issue now. The restart process seems to need more attention by the developer. |
If you'd like to suggest improvements please feel free to open a PR! |
@kmihaylov If it's OK with you we should leave this issue open as it definitely needs a fix. |
Still trying to figure out why the system panics. I was quick to say the Access Point feature of the Basic_Wifi sample was the reason for the panic. Later I found that the panic still occurs, despite the AP feature was turned off. Actually if I use
The panic is missing. One reason to believe this works is that the wifi is stopped before it was fully initialized. I also tried with One way to mitigate this is to change the CONFIG_ESP_SYSTEM_PANIC config variable. https://docs.espressif.com/projects/esp-idf/en/v4.4/esp32/api-guides/fatal-errors.html
(see https://sming.readthedocs.io/en/latest/_inc/Sming/Arch/Esp32/README.html?highlight=menuconfig ) Obviously the default is This is important, otherwise I was unable to properly OTA update my devices. |
My Esp32 code used to do I found that if I try to enable the wifi with See the code below:
This is the modified Basic_Blink (w/ networking enabled). If you comment out the I followed this example: https://github.com/espressif/esp-idf/blob/7c2b137ffe8a91ef0967cd5da1fe330ff5912399/examples/wifi/getting_started/station/main/station_example_main.c And the above mentioned code is the extracted minimum of functions. I thik the system freezes exactly on
The only missing function from this initialization code is I may be wrong to use Ideas for this message: |
I suspect one problem is that when |
I set the However now some overlap occurs:
|
Pretty good bug to bring me the knowledge to make arbitrary partition tables and esp-idf specific options! I managed to make custom partition table and I learned how to change the partition table offset. Unfortunately I don't see any useful information in the debug messages. Here I'll post all the options I changed and all the output. Application code:
I changed the boorloader verbosity level from Also I moved the partition table offset in And here is the output:
The decoded stack:
I'll write again the files containing the Wifi initialization code:
|
@kmihaylov The debugging I was after is actually With your sample, the WDT reset looks like this:
Looks like a semaphore is involved, so probably a deadlock somewhere. Turns out it's the event handling loop, not the networking at all! Sming doesn't use the default event loop but creates its own so that all software timers and queued callbacks run in the Sming thread context. See #2371 for details. It could be that the IDF expects the event loop to be running in a separate thread, still investigating the exact reason. I've opened PR #2543 (work in progress) so you can try |
Hi All, I fixed this issue... (I have no idea whether this issue was fixed or not)
|
Yes, this issue was fixed in #2543 - you can find an explanation of the cause there. |
@mikee47 Thanks. |
Closing as fixed by #2543 |
Hello. When ESP utilizes WiFi it couldn't properly disconnect or restart the device.
I use the Basic_WiFi example and I've added
System.restart(10000);
at the end of theinit()
function.Also the same applies if I try to use
Wifi.disconnect();
orWifiStation.enable(false);
.The text was updated successfully, but these errors were encountered: