Hi -
I am stuck and pretty sure I a being stupid and doing something quite obvious wrong. would appreciate some help
void End_Point_Data() {
if (Particle.connected() == false) {
Serial.println("Modem is disconnected");
digitalWrite(LDO_EN, HIGH);
Serial.println("LDO Enabled");
delay(10);
Cellular.on();
waitUntil(Cellular.isOn);
Serial.println("Modem is ON");
Particle.connect();
waitUntil(Particle.connected);
Serial.println("PArticle is Connected to Cloud");
Particle.subscribe("hook-response/get_data", myHandler, MY_DEVICES);
Particle.syncTime(); //*sync to current time to the particle cloud*/
delay(100);
String data = String(10); // Get some data
Particle.publish("get_data", data, PRIVATE); // Trigger the integration
Serial.println("Trigger webhook...");
}
delay(250);
Particle.disconnect(CloudDisconnectOptions().graceful(true).timeout(5000)); // Use only in SEMI_AUTOMATIC mode
waitUntil(Particle.disconnected);
Cellular.off();
waitUntil(Cellular.isOff);
delay(10);
digitalWrite(LDO_EN, LOW);
Serial.print("LDO Disconnected");
delay(1000);
EPD();
}
Device starts in Semi_Automatic mode and Threads are enabled. I was expecting to devise to see it is not connect, then connect, do some stuff and then disconnect.
As it stands, it starts up, run the loop which is calling void End_Point_Data()
which in turns updates an EPD display. After this, there is a 5min timer, after this expires the function runs again. This second time though, it gets to waitUntil(Cellular.isOn);
but then stops there and status leds breaths dark blue.
Regards, Friedl.