I have a USB powered C3V0 (imp002) running as a power and internet monitor. It is reporting wake reasons in the device and MessageManager timeouts from the agent. It’s backed by an old, spare UPS and is monitoring the mains power using a 3V3 power adapter connected to pin1.
It’s doing a pretty good job of letting me know when the internet has disconnected but is doing really badly at telling me why.
Most times it reboots with wakereason WAKEREASON_POWER_RESTORED (11). What does this code mean?
Why is it rebooting at all when my initialisation sequence is:
imp.setsendbuffersize(8096);
cm <- ConnectionManager({ "blinkupBehavior": CM_BLINK_ON_DISCONNECT, "startBehaviour": CM_START_CONNECTED, "stayConnected": true, "errorPolicy": RETURN_ON_ERROR_NO_DISCONNECT });
mm <- MessageManager({ "retryInterval": 10, "messageTimeout": 5, "autoRetry": true, "maxAutoRetries": 0, "connectionManager": cm });
Sounds like a partial brownout, which I believe is what will give you power restored on an 002.
Essentially, the device has lost 3v3 enough that the CPU got reset, but the NVRAM was still preserved. This usually means 3v3 has dropped below about 2.7v, but now lower than about 1.8v (which is where NVRAM gets lost).
It’s happening in two locations, 100km apart. One has a UPS and the other doesn’t (yet). Both devices are C3V0’s with generic USB power supplies. They SEEM to be rebooting after a network outage not a power outage for example this sequence of alarms …
Note the IP address changes. This shows the imp is going offline and coming back on my router’s SIM card backup. Then a couple of minutes later it is falling back to the cable internet. The outages are correct but the boot reason of 11 makes little sense here.
Hmm. Fair point. Though, if the code is still running, it hasn’t re-woken so the wake reason won’t have changed? That’s the reason from the original power on.