Imp restarted, reason: wifi error - event handler?

I’m tracking down what I tougth was a bug in my code.
I start a watchdog when the imp gets new code/boots.

However I need to handle this to restart my watchdog & log the issue
2013-11-17 20:38:35 UTC+0: [Exit Code] imp restarted, reason: wifi error
There doesn’t seem to an event handler for this?
Or is this covered by WAKEREASON_SW_RESET via hardware.wakereason()?

Thanks as always

wifi error means, generally, that the wifi chip’s internal processor (which we have no control over) has crashed, and we reboot to get it back up. I suspect it would show as a WAKEREASON_SW_RESET.

The next release (after 27) will recover from this more seamlessly - ie, no reboot.

Thanks for elaborating on that Hugo … that this particular error code is most likely related to the wifi chip. I had come across it occasionally (every day or two?) and thought it had something to do with my network setup. Didn’t really pay much attention to it as the reboot was automatic, and things just went on their way. (I also overlooked the fact that it appeared to be related to one of my devices, yet not others, so that would seem to exonerate the network).

Prompted to look into it further, it appears to happen with one of my development edition devices, but I haven’t yet seen with production devices. (Very limited sample set though). Makes some sense I guess … perhaps they’re just running older version firmware? (Just curious, I’m assuming the wifi chip firmware gets updated with Imp firmware updates?)

Anyway, thanks for the insight on this … good thing to learn.

The firmware versions are identical (development edition is just a different laser etch on the top), and the wifi firmware is part of our firmware releases yes.

Do you have multiple APs in your network? The differences could just be down to physical location and what networks they can hear - including your neighbors’ ones.

Interesting. I do have two APs in my network. The devices I was comparing are in close proximity (and connected) to only one of them. (Perhaps significant though - the one that I observed the occasional wifi errors on is closer to the second router).

So, if I’m correctly putting your comments together, what you’re saying is that the multiple signals can sometimes lead to confusion/crashing of the wifi processor?

Again, really no harm, no foul here … if I wasn’t looking carefully through the log I’d likely never see the “wifi error” entries. The recovery is graceful, and the app just goes about it’s business.

Thanks for clarifying the firmware versions/releases.