Hi everyone,
Sorry to bother but i’m meeting troubles with my Argon device (3.2.0).
Actually i’m trying to make sleep the device at some part of the day, but I want to keep the network connected. This way I can wake up the device by calling some functions or getting some variables.
However the issue that i’m facing now, is that the device get wake up without respecting the duration time that it should do. And when i’m logging the wake up reasons, i can see it get awake by network whereas i didn’t ask for variables or call any functions.
I first tried to look on google and read the documentation but i didn’t something explaining this behavior.
So if you guys have any ideas why i’m having this issues i’d be so thankful for help.
Here is a part of my code.
Thank’s for your time
SystemSleepConfiguration config_day;
void setup()
{
....
config_day.mode(SystemSleepMode::STOP)
.duration(15min)
.network(NETWORK_INTERFACE_CELLULAR);
System.disableUpdates();
Particle.unsubscribe();
// Cloud methods & variables
....
}
boolean networkReason(SystemSleepResult res)
{
SystemSleepWakeupReason reason = res.wakeupReason();
if (reason == SystemSleepWakeupReason::UNKNOWN)
{
Particle.publish("reason UNKNOWN : ", PRIVATE);
}
else if (reason == SystemSleepWakeupReason::BY_NETWORK)
{
Particle.publish("reason BY_NETWORK : ", PRIVATE);
return true;
}
return false;
}
void loop()
{
...
// myCode...
SystemSleepResult res = System.sleep(config_day);
networkReason(res);
....
}