What does "wifi failed to initialize" mean?

2017-04-27 11:08:07 +12:00 [Exit Code] imp restarted, reason: wifi failed to initialize

Been getting this at intermittent intervals since the OS upgraded on a few of my devices 12 hours ago. Is this a reclassified error message that was previously reported as something else?

I believe it means what it says - the wifi chip failed to bootstrap and so the imp restarted tried again, and succeeded that time. Release 36 boots the wifi on a background thread, so it’s possible something has changed here which our system testing didn’t show, especially if it’s a very low percentage impact.

Am looking across the installed base at percentages of this report and filing a bug…

Looked across all devices and it’s pretty much just your devices seeing this. Could you file a ticket with your device code so we can look at it? My suspicion is that there’s something you’re doing (maybe with wifi scanning & connect attempts) that’s provoking this, so we need to work out how to replicate it to design a test.

Hi Hugo,

I’ve got a bit to add to this.

I’ve previously filed a bug report on a problem we had connecting to wifi while doing something with SPIFlash. While reproducing that (on OS 36) I had seen this “wifi failed to initialize” thing once or twice, so they might be related.

Yesterday, some odd data in the backend made me take a look at the logs for a production device. It was running code that we have not previously had these problems with, and still on OS release 34.11. The logs showed the device crashing with this error twice, less than an hour apart, and I believe that I would have seen more had I started the logs earlier. There’s not much else in the logs so I don’t know if they’ll help you diagnose, and I don’t know how to reproduce it. We also saw erratic battery voltage readings ranging between 4 and 5 volts over a short period of time (seemingly around the same time as the errors), which might be relevant. I’m not aware of this issue effecting any other devices.

Let me know if you want logs or a device id or anything.

Thanks,

Jaye

Erratic battery voltage can certainly cause issues, as bringing wifi up results in current peaks. This could absolutely cause a transient issue which is logged by the MCU and reported when the wifi finally does come up ok. The MCU is happier at lower voltages than WiFi is.

We do not see this issue as widespread, so unless you have a repeatable test case there’s not much I can add here.

Okay, thanks Hugo. I guess it was bad batteries or something