Hi I have product with three devices. As you can see in the following screenshot I released a new firmware version for them.
The problem is that the new version gets never flashed to my devices via air. They devices wake up every hour and successfully connect with the particle cloud -> But they are still on the old firmware even after one day.
Am I doing something wrong here ? Or am I misunderstanding that feature ?
You also need to stay connected long enough for an OTA update to kick in, for that you can check System.updatesPending() to add some extra waiting time before disconnecting.
@Gecko, after having a similar request of another member who seemed to get a true from System.updatesPending() only after being connected for more than 9 sec.
Could you try something like this?
uint32_t ms = millis();
// do whatever needs doing for normal ops
// allow at least 10sec for cloud enumeration to complete
while(millis()-ms < 10000) Particle.process();
// now we should be able to learn if there is an update waiting
if (System.updatesPending())
{ // if update is pending hang around for it a minute - will reboot after update
ms = millis();
while(millis()-ms < 60000) Particle.process();
// if hasn't rebooted before one minute was up go to sleep and try next time again
}
System.sleep(SLEEP_MODE_DEEP, sleepTime);