const system_tick_t TIME_PER_SECOND = 1000;
const system_tick_t TIME_PER_MINUTE = TIME_PER_SECOND * 60;
...
static const system_tick_t IN_PROGRESS_TIMEOUT = 5 * TIME_PER_MINUTE;
static const system_tick_t COMPELTE_TIMEOUT = 10 * TIME_PER_SECOND;
The timeout that is always triggered is the IN_PROGRESS_TIMEOUT
, as per this that I posted a while ago: How to notify application incase of an incoming OTA update? - #37 by damonmaria
So it's waited 5 minutes before sending the spark/device/session/end
event. But I see what you're saying / that's made me think: sending the spark/device/session/end
event may be causing the session to be broken during the processing of that same event? Which causes the error response. Because even tho every Particle.publish("spark/device/session/end", PRIVATE | WITH_ACK)
returns false
it does in fact work (the next connect after reboot has to do a full handshake and correctly pulls down the firmware).
So maybe the solution to my problem is to remove the WITH_ACK
. It's not the end of the world if that event is lost.
Thanks for the heads up. I'll definitely rearrange things.