machine.WDT does not appear to work [Sorted]
machine.WDT does not appear to work [Sorted]
I have been chasing random lock-ups for more than a year on the ESP32-WROOM-32 units. Although I was aware that rev 1 chips had been replaced with rev 3 chips I had to move to the SPIRAM variant as I could not get boards with rev 3 chips off Aliexpress. Random lock-ups seemed to disappear and I was only using a S/W WDT.
Recently, I started getting rev 3 chips in the ESP32-WROOM-32 parts so have had another go at using them. Unfortunately, I made another change and that was using machine.WDT instead of a S/W WDT.
Hardly 12 hours of running the new system and total lock-up. I will go back to a S/W WDT, but if there are any hints out there on how to get machine.WDT to reliably re-boot my board I would really appreciate to hear about it.
Recently, I started getting rev 3 chips in the ESP32-WROOM-32 parts so have had another go at using them. Unfortunately, I made another change and that was using machine.WDT instead of a S/W WDT.
Hardly 12 hours of running the new system and total lock-up. I will go back to a S/W WDT, but if there are any hints out there on how to get machine.WDT to reliably re-boot my board I would really appreciate to hear about it.
Last edited by davef on Fri Jul 29, 2022 10:09 am, edited 1 time in total.
Re: machine.WDT does not appear to work
Might be a hardware or ESP-IDF issue.
see e.g. https://esp32.com/viewtopic.php?t=18359 or search for "esp_task_wdt_add".
see e.g. https://esp32.com/viewtopic.php?t=18359 or search for "esp_task_wdt_add".
A few hours of debugging might save you from minutes of reading the documentation!
My repositories: https://github.com/karfas
My repositories: https://github.com/karfas
Re: machine.WDT does not appear to work
Thanks for the comments. There was no suggestions to the poster in the first link. I haven't got the skills to try an "esp_task_wdt_add".
I hoped that just using machine.WDT in the ESP32 port would cover my basic requirement. I run these units off a LM317 5V reg (1.5A capability) usually with 1000uF to handle any surges when the WiFi fires-up. Often I put an extra 1000uF on the 3V3 as well ... but not on this unit.
I have gone back to a S/W WDT on this unit.
I hoped that just using machine.WDT in the ESP32 port would cover my basic requirement. I run these units off a LM317 5V reg (1.5A capability) usually with 1000uF to handle any surges when the WiFi fires-up. Often I put an extra 1000uF on the 3V3 as well ... but not on this unit.
I have gone back to a S/W WDT on this unit.
Re: machine.WDT does not appear to work
esp_task_wdt_init and esp_task_wdt_add are the IDF functions called by the WDT module.
You already used them.
For an application with high availability needs I would use both the SW and the WDT watchdog. In the rare cases when the SW Watchdog doesn't catch a lockup, the WDT thing might be able to fix things.
You already used them.
For an application with high availability needs I would use both the SW and the WDT watchdog. In the rare cases when the SW Watchdog doesn't catch a lockup, the WDT thing might be able to fix things.
A few hours of debugging might save you from minutes of reading the documentation!
My repositories: https://github.com/karfas
My repositories: https://github.com/karfas
Re: machine.WDT does not appear to work
When I read through the docs for esp_task_wdt_add it sounded like I would have the opportunity to add in other watchdog tasks and that's when I was overwhelmed!
If and when the S/W WDT fails and will try both ... that never occurred to me. Thanks.
If and when the S/W WDT fails and will try both ... that never occurred to me. Thanks.
-
- Posts: 144
- Joined: Mon Jul 25, 2022 9:45 pm
Re: machine.WDT does not appear to work
Odd thing is, I just discovered that machine.WDT is not working right on my Pico W as well. I can set up WDT, but apparently feeding WDT never occurs correctly even when I set WDT timeout 60 seconds, and WDT is in a loop to execute once per second. The WDT still fires. If I disable the WDT from ever starting its count down, my Pico W is fine, otherwise it disconnects/resets.
Re: machine.WDT does not appear to work
Something I discovered recently is ... I can only init the system wdt in one file (the file containing your main loop) and only call wdt.feed in that file. So, if I call other files I can not placed any wdt.feed in them.
wdt.feed must be working for me as I am in one second loops 24/7. ESP32-Generic
wdt.feed must be working for me as I am in one second loops 24/7. ESP32-Generic
Re: machine.WDT does not appear to work
That sounds strange. You should be able to use the wdt object created with the call to WDT() at any place in your code. Obviously you have to take care to make it visible at these places, like making it global.
Re: machine.WDT does not appear to work
oops! I think you exposed a knowledge-gap. I have used global twice and didn't realise that it was needed in this context.like making it global
Thanks
-
- Posts: 59
- Joined: Mon Mar 29, 2021 1:36 am
- Location: Brisbane Australia
Re: machine.WDT does not appear to work
@davef, It's likely not needed. I doubt Roberth mean't "global" as a keyword here. I suspect he mean't you need to ensure the wdt() instance is a singleton. I.e. in the function where you have wdt.feed() then the wdt instance does not need to be `global wdt`.