Watchdog timer

Is there an example out there for a watchdog timer to restart if things get locked up?

We have a timer API but no watchdog system, yet. This feature is on the ToDo list though.
The Timer API is available in the ‘timer’ module. However, if for any reason your Lua VM is stuck the timer will not be triggered anymore.
So with this API you could implement some kind of applicative watchdog, but not a low level watchdog.

Also, if you application exit with a non 0 exit code, then it will be restarted automatically. That can be conveniently be used combined with the timer API.

I hope this can help, until we would provide a proper watchdog API.

Thanks, our main problem is we are running a serial interface application that never fails when on the IDE, but when exported out to the GX, seems to stop running after a random amount of time. Is there a way to either catch where it is locked up when off the IDE or add some kind of wrapper around the serial functions that would allow the application to die gracefully and restart.

Ok, that seems to be a nasty bug. I guess you already loaded your application will log call (module ‘log’) ? And that your application is stuck rather than dead ?
In anycase, if that is a bug me would need to have a look to it. Would you have some code samples you could share that reproduce the bug ?

I have the same problem. Does AAF have an API to implement the watchdog already? Someone Can help me?

Unfortunately we do not have implemented that feature yet (and no short term plan).
Did you have a look at the timer API, so you could implement a soft watchdog in your app? Did you try to debug using the log module (to see where the apps hangs)?