I have a very simple application running on two 2G global electrons, one has a 3rd party sim and the other a particle sim. The firmware sleeps and is woken on a rising edge on D1, it should then publish an event, blink the onboard led and then go back to sleep. (code is below, keep alive and cellular credentials setup are obviously omitted from the device with the particle sim)
Directly after reset everything functions perfectly but after being left for a minute the device wakes, blinks the onboard led but doesn’t publish an event. The onboard RGB LED breathes cyan for approximately 30 seconds before the device goes back to sleep without publishing the event. Seems like it is timing out and giving up.
I can’t get my head around how why it would start being unable to publish over time with no change to the firmware. It’s also worth noting that the same firmware previously worked perfectly for weeks so must be a new issue.
If I hit reset on the device it publishes the events perfectly again, but only for a minute before the problem reappears.
Device is running whatever the most recent firmware is. (updated with the cli but it doesn’t give you a version number)
#include "Particle.h"
int boardLed = D7;
int sensor = D1;
STARTUP(cellular_credentials_set("vodafone", "", "", NULL));
void setup() {
Particle.keepAlive(120);
pinMode(boardLed,OUTPUT);
pinMode(sensor,INPUT_PULLDOWN);
}
void loop() {
System.sleep(D1,RISING,SLEEP_NETWORK_STANDBY);
if (digitalRead(sensor)==HIGH) {
String status = "PinHigh";
Particle.connect();
Particle.publish("googledocs", "{\"status\":\"" + status +"\"}", PRIVATE);
digitalWrite(boardLed,HIGH);
delay(100);
digitalWrite(boardLed,LOW);
delay(100);
}
}