Interpreting hardware.wakereason()

Getting back to the original purpose of this thread (I have another thread about the out-of-memory issue), I’m still uncomfortable with the behaviour of hardware.wakereason().

I have units that were upgraded with new firmware yesterday. Yet, some of them have reset multiple times since then, reporting 4 (WAKEREASON_NEW_SQUIRREL) on startup, each time. The exact cause of the reset is still moot (but possibly related to the scanwifinetworks() issue). What I can be confident of, is that I had not deployed any new firmware to them in at least 20 hours. Is there a circumstance where WAKEREASON_NEW_SQUIRREL becomes sticky and it continues to override the real wakereason?

@coverdriven, could you provide a device ID for one of the units?

Pleased to confirm that I haven’t seen any out-of-memory or memory-errors for the past 4 days. I’ve removed all calls to imp.scanwifinetworks(), except for when the device is disconnected.

Revisiting the original essence of this issue (which hasn’t really changed),

I have a unit that had a few resets earlier this week. The device disconnected then restarted and the agent reported an Out of Memory error and restarted which triggered a restart of the device. In all, the device restarted 3 times within 10 minutes, each time it reported a hardware wakereason of 4 (WAKEREASON_NEW_SQUIRREL). This is despite getting no new firmware for a few days. I do use wakereason to carry out post-mortems on any failures but it seems that WAKEREASON_NEW_SQUIRREL seems to be used for another undocumented purpose. I do use server.restart() on occasion to force the device to reset. Will this always result in WAKEREASON_NEW_SQUIRREL? If so, wouldn’t it be better if it caused a more distinct wakereason of 2 (WAKEREASON_SW_RESET)?

You’re right, server.restart() seems to cause WAKEREASON_NEW_SQUIRREL. I agree that this is confusing, and I’ve filed a bug report.

Update: improvements to wake reason reporting will be included in impOS 36.

impOS 36 is now available for testing