-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Watchdog with System Reset #341
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
The reason is that WDT is disabled for the idle task on CPU1 (Arduino setup/loop). If you want to have all options, you might want to look into using Arduino as IDF component. |
Thanks @me-no-dev, I'll do that. |
I'm sorry guys, I'm a not familiar with programming the ESP32 without using the Arduino IDE, and I don't understand the solution proposed. If I understand what you're saying here it is that:
*I think you're suggesting, but I'm definitely not sure, that you need to switch to programming using Eclipse (the preferred programming environment instead of the Arduino IDE), and use the Arduino code as a component. Hopefully you can set me straight about watchdogs. What I'm finding is that my ESP32 is 'randomnly' halting, or it's gone into an infinite loop, or it's not restarting from deep sleep, and I would like to use a watchdog to at least eliminate one of those alternatives. |
Hi @dmody , @me-no-dev refers to building the code as described here: |
Thank you. I'll read up on that.
…On Mon, Jun 12, 2017 at 5:11 PM, Pete ***@***.***> wrote:
Hi @dmody <https://github.com/dmody> , @me-no-dev
<https://github.com/me-no-dev> refers to building the code as described
here:
https://github.com/espressif/arduino-esp32#using-as-esp-idf-component
You don't need Eclipse for it, any text editor will do.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#341 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARtFwIyOpBrDVY4f_hRWydlX5n6Aeng9ks5sDal4gaJpZM4NMirL>
.
|
when install idf, we can compile with diferent options in espressif. But, how can use if in Arduino.? |
@inforaudio you can not set those when using Arduino stand-alone ;) you can if you use it as IDF component (answer is two positions above your question) |
To All, Same problem, please give us step by step how to make Watchdogs work as use the Arduino code as a component? |
Setup " void esp_int_wdt_init();" OK. But no ideal how to use it in ESP32? a demo prgram code will big help. #include <CurieBLE.h> int ctime=1; void esp_int_wdt_init(); void setup() { // initialize the BLE hardware ----------Above OK , works |
Will we get this for arduino-esp32 or what is the reason why we don't have/get it? |
A WDT demo code will fix all problems. ESP team, please release one. Just like 51 , TI430, ,,, all have WDT demo codes. Thanks |
We have a bigger project finished with ESP32 and now we find it¡¡¡.. @mxwang101 we have problem with your code. Really run it properly? are there a compilation / libraries / nre version where watchdog is enabled?? So complicated is it? We pass 2 days looking for and we are thinking in use other ESP version |
@inforaudio all you need to do is to install IDF, install Arduino as IDF component and run |
how can install Arduino as IDF component? after it?? what can we do.? |
Thanks for your help. We create a idf project (copy hello world example) , void setup(){ void loop(){ try to made a make and have this problem What can i do now? What is the problem? |
hiii |
This issue should not have been closed. It was not properly addressed. None of the explanations given above are complete or seem to work. I think a simple wdt solution in the Arduino IDE environment should be made available. The current solution seems to be if you need the wdt use the IDF. What good is an IOT device that gets deployed and goes dead in 2 days because of some obscure bug. In my opinion if the development team cannot provide a simple wdt solution for the Arduino IDE a very important feature is being ignored. |
Yeah i am so disappointed as well.Development is useless without wdt
…On 16 Nov 2017 11:02 pm, "assegid" ***@***.***> wrote:
This issue should not have been closed. It was not properly addressed.
None of the explanations given above are complete or seem to work. I think
a simple wdt solution in the Arduino IDE environment should be made
available. The current solution seems to be if you need the wdt use the
IDF. What good is an IOT device that gets deployed and goes dead in 2 days
because of some obscure bug. In my opinion if the development team cannot
provide a simple wdt solution for the Arduino IDE a very important feature
is being ignored.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#341 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ad_cUE78gXcCDSvFYQtojKQrLwMOV664ks5s3HiZgaJpZM4NMirL>
.
|
I don't fully understand the implications of this. Does it mean that any Arduino sketch for ESP32 will never be able to automatically reset when stuck? |
For those like me who tripped over this thread as a high-ranking hit on search for "arduino esp watchdog", it does now work. Example here: https://github.com/unixbigot/esp-skeleton |
I can confirm that the current Arduino ESP32 SDK does NOTreset the device after watchdog is triggered. This should be reopened. |
please calm down. There are many reasons why WDT reset is disabled for Core1 (it is enabled on Core0). While enabling it will make all of you happy, it will break many other sketches made to run on the Arduino platform (not ESP32 specifically). You have many options on how to detect that your loop is stuck and reset, since you are knowledgeable enough to know what wathdog is. You can spin a task on Core0, wait X ms to take a semaphore from the Arduino loop, and if you do not, then reset. In the loop, first line you give that semaphore. Done. you can detect the problem and reboot. SPIFFS format triggers WDT, so watch out ;) |
how about I add API to enable WDT on the idle task and on the loop task? will that satisfy? |
API added and WDT reboot enabled in #2248 |
that's really good
…On Fri, Dec 28, 2018, 11:38 PM Me No Dev ***@***.*** wrote:
API added and WDT reboot enabled in #2248
<#2248>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#341 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ad_cUL4TYv69BYfQ896GKA9CsNlK1Bl-ks5u9mU5gaJpZM4NMirL>
.
|
Stupid question, but as far as i understand this will work if called in main loop, and what if the main loop is empty and i'm using tasks ?. In my case when no wifi signal around the test unit for longer time, or interference show up in 2.4ghz that scramble the signal, and that situation persists for a few hours, the task for wifi "hangs" the test unit is not responsive, not communicating with peripheral devices. Is there a demo example how to properly handle the WDT reset using watchdog, if there is no code in loop (and there cannot be the loop must be empty. Or should i just innit in setup and add the feed in one of the tasks to feed the timer, and it should work ? Im kind of a not much experienced person when it comes to programming, but i'm trying hard :) |
According to issue #147, the watchdog functionality of the ESP32 is available to Arduino sketches.
In order to make sure, the sketch is always functional, I want to use the watchdog to reset the chip if it gets stuck somehow. When I call
esp_task_wdt_feed()
once and then block theloop()
thread, nothing happens though.According to the Task watchdog documentation, the watchdog is supposed to issue a warning but not reset the CPU. For Arduino sketches, I may be better to reset the system instead. Is that possible without manipulating the related watchdog registers directly?
The text was updated successfully, but these errors were encountered: