Hello,
I need my boron to wake up frequently (every 1-2 hours) and send out data. Is this the best approach in terms of saving battery and re-establishing cellular connection?
SYSTEM_MODE(MANUAL);
void sleep(){
Serial.println(); // for formatting
Serial.println(“going to sleep”);
Serial.println("\n");
SystemSleepConfiguration config;
config.mode(SystemSleepMode::STOP)
.gpio(WKP, RISING)
.duration(60min);
System.sleep(config);
}
doInternetStuff(){
// do inerternet stuff
sleep();
}
void cellular(int humidity, int temperature, int fourInchMoisture, int eightInchMoisture,int solar){
//Cellular.off();
Cellular.on();
delay(2500); //give cellular module time to initialize
Cellular.connect();
delay(1000);
while(Cellular.connecting()){
Serial.println(“attempting lte connection…”);
delay(1000);
for (int counter = 0; counter < 30; counter++) {
Serial.println(“attempting cellular connection…”);
delay(1000);
if(Cellular.ready()){
Serial.println(“successfully obtained cellular connection”);
Serial.println(); //for formatting
doInternetStuff();
}
else {
//
}
}
Serial.println(“lte connection taking too long…going to sleep to conserve battery”);
}
sleep()
}
Any help is appreciated!