Watchdog Woes

dinsfire64
Posts: 1
Joined: Wed Jul 08, 2015 3:33 am

Watchdog Woes

Postby dinsfire64 » Wed Jul 08, 2015 4:28 am

Hey there Espressif.

I've been developing for the ESP8266 since the beginning of this year and I love the platform, but I'm currently having issues with a project I am working on.

I am currently using SDK 1.1.2 as it has the updated PWM module as well as wifi_station_set_hostname, both of which are extremely useful to me.

My project is using the ESP8266 to control an RGB LED strip using PWM from the ESP8266 through some TIP120s. Sending some JSON strings to the device over UDP will cause the strip to fase, pulse, change color, etc based on user input. Everything is very smooth for fading with the introduction of the us timer and I have all the code working properly for that.

Now my issue is with the watchdog timer. I feed the dog through my fading timer slop_wdt_feed() in order to keep it happy while fading. It does a handy job at that, but once the timer is done with the fade, the system is supposed to go back into a waiting state, waiting for another UDP string to kick off another fade. However once the fading is done, the watchdog is unhappy that nothing is feeding it, and it will reset.

Now I have tried disabling the watchdog all together, but that causes issues with the hardware timer later on. The function system_soft_wdt_stop(), even when deployed for a short period of time and brought back with system_soft_wdt_restart(), prevents the system from accepting packets later.

But my main question is how do I convince the dog that I'm not running any more code, but rather I want the control to be given back to the OS? There is some exchange I am missing in this process.

So the structure of my code is that there is a timer scheduled at the end of user_init() to check to see if the connection status is STATION_GOT_IP. Once that is established, the code then sets up an espconn that listens for the UDP packets and sets the callback up. With that simple of a setup, the system causes a wdt reset after the espconn is setup once the watchdog realizes that I'm not running any more code, but waiting on UDP packets.

paritosharya007
Posts: 10
Joined: Sat May 23, 2015 1:24 pm

Re: Watchdog Woes

Postby paritosharya007 » Fri Jul 10, 2015 1:38 pm

Hi dinsfire64,

I am trying to find some sample code for sending and receiving JSON data over UDP but haven't found anything simple and easy to understand (IoT Demo is very complicated and difficult to understand). Can you please share something that I can make use of)?

Looking forward to hear from you!

Paritosh

Who is online

Users browsing this forum: No registered users and 30 guests