Electron NEVER Going Back Online after ANY Sleep() Function

I have been working with Particle for years, so by no means am I newbie, but this one is driving me nuts. If I use any System.sleep() function, when the Electron comes back awake it stays in the flashing green mode and never reconnects. Below is a simple program that counts 5 seconds then goes to sleep for 30 seconds. My application requires 1 minute measurements, then a one hour publish of the data.

What am I missing?

Thanks!

int count = 0;
SYSTEM_MODE(MANUAL);

void setup()
{
    Serial.begin(9600);
}

void loop()
{               
                Serial.println("Particle Status:");
                Serial.println(Particle.connected());
                if(!Particle.connected()){
                    Serial.println("Particle Not Connected!");
                    Particle.connect();
                    waitUntil(Particle.connected);
                    Serial.println("Particle Connected");
                    // Request hard time sync to negate drift,
                    // and finish cell processes
                    Particle.syncTime();
                    waitUntil(Particle.syncTimeDone);
                }
    count++;
    Serial.println(count);
    delay(1000);
    
    if(count>5){
        Cellular.disconnect();
        Cellular.off();
        while(Cellular.ready()) {
            Particle.process(); // or delay(1); maybe
        }
        System.sleep(SLEEP_MODE_DEEP, 30);
    }
}

What device OS version are you running?
Have you got the LiPo connected?
How long did you run that code before it couldn’t reconnect?

I tested your code with 1.0.1 and my Electron 3G connects just fine.
But if your service provider is not happy with your device permanently reconnecting they may have black listed it.

BTW, when you say “ANY Sleep() Function”, have you tried System.sleep(pin, edge, timeout, SLEEP_NETWORK_STANDBY)
too?

2 Likes

I am using OS 1.0.1

I did try the others as well. Same issues. It may be that during testing we were do 1 to 2 minute sleeps. I can hard reset and it reconnects. Do you have a recommended time we should not go under for sleep modes to prevent this?

I am on AT&T.

And yes on the LiPO