Hi,
My code basically starts, gathers some data, connects to the cloud, sends it and then goes to a timed sleep. After waking up, it restarts (“System.restart();”), and starts the process again.
This is a product device, I am locking new firmware to the device and it says next time it connects it will update automatically. The problem is it only updates when power resetting, meaning I need to disconnect the device from the power source and not resetting with software or the reset button.
Hope someone can help me with a solution.
I believe I need to force a handshake with the cloud.
Thanks.
I just found this today, might be useful: How to force a handshake for OTA updates
Thanks, I’ve tried, perhaps if I send you my code with my routine to sleep you may be able to get what I’m doing wrong. It is not waking up right now actually.
Maybe I should update to 1.2 but I am not sure because it’s a prerelease right now.
Thanks in advance.
if (Particle.connected()){
//waitFor(Time.isValid, 60000);
Particle.process();
//delay(100);
// Here I publish an event
} else {
System.reset();
}
fuel.sleep();
digitalWrite(D7, HIGH);
Particle.publish("spark/device/session/end", "", PRIVATE);
delay(1000);
Particle.disconnect();
Cellular.off();
delay(5000);
digitalWrite(D7, LOW);
System.sleep(D6, RISING, 600); // I never use D6
delay(1000);
System.reset();
I was trying to avoid the prereleased firmware, but I ended up updating to 1.2.
Thanks a lot!