Adding product to dashboard causes code to stop running if disableUpdates() was used.
I noticed that some of our photons would spend long stretches being unresponsive. For about 10 seconds the code would run, then for twenty seconds our user code loop() did not seem to execute. No serial output. It appeared to hang between loop calls. During this time the phone LED was breathing cyan. Towards the end of the pause, it would briefly switch to fast flashing cyan. After that it would return to slow breathing cyan, and run user code for a few seconds before the whole process would repeat. Notably, there was no SoS, and user code was not reset to the beginning - it just continued where it left off.
The problematic behavior was stopped when removing that photon from the dashboard, then restarting the device.
We suspect that the problem relates to the following:
-
The dashboard was trying to upgrade to a new version of firmware
-
our code has previously made a call to System.disableUpdates();
Any advice how to fix this? What’s causing the problem?
** additional observations **
Using “lock and flash now” will initiate the problem for a running photon.
Removing the lock will NOT stop the problem for a running photon.
Removing the lock and then restarting the photon will NOT stop the problem.
Removing the device from the dashboard will NOT stop the problem.
Removing the device from the dashboard and then restarting the photon, WILL stop the problem.
“Lock and flash on reset” of a moded version of 5 (with just the version name bumped to 8) while the system is trying to lock and flash on update (5–>8), DOES NOT cause the problem. Presumably, no update, cuz both are listed as version 8.
“Lock and flash on reset” does not cause errors on 5 trying to upgrade to 8, until a reset happens. Then the error happens. Dashboard always persists display of (5–>8). Update never occurs. But error persists.
Programmatically re-enabling updates, does not result in the problem. That is, the following sequence, ends up with an update. So it seems the user blocking problem is only when its actively in disabled mode.
System.disableUpdates()
- connect to wifi and particle
- do some stuff
System.enableUpdates(); - eventually updates
ps. I’m using v0.4.7.