I am having difficulties understanding the semi-automatic mode. I have a electron project that enables the system thread and also enables semi-automatic mode. I used these two options as I want my program to run in offline mode as this is going into a mobile application where the device may roam out of cell coverage and I do not want the application blocked for connection activities.
I call particle.connect() in my setup routine. If after the device is connected to the cloud and I then remove the antenna, it will not reconnect once I re-attach the antenna. It blinks the green LED for a long time, the breathes in Dark blue once or twice, breathes white once or twice, then goes back to flashing green.
I thought maybe if it was not connected to the cloud I would have to reconnect so every 10 seconds I have a task the calls Particle.Connected() and if it returns false I call Particle.connect() again. This did not solve the problem. It will never reconnect.
If you trigger another Particle.connec()while a previous attempt is still running you will knock back the attempt which may prevent a successful connect.
Once you called Particle.connect() give it a timeout periode of up to 5minutes before trying again.
I originally did not have the additional Particle.connect() calls at all and it still would not connect.
After more testing its seems it fails to reconnect if the device is not connected to the cloud after returning from sleep mode. If the LED is blinking green when I enter sleep, when it comes out of sleep it never reconnects.
Is there some sequence I can use to reset the entire modem?
Give 0.7.0-rc.3 a try - 0.6.2 had some issues where the radio module was left in some limbo state when the connection was not fully cut before going to sleep.
Unfortunately that did not help. When the device goes to stop mode when the LED is flashing green and the antenna is disconnected, it will not connect to the cloud anymore until I press the reset button.
step are,
let it connect to cloud
remove antenna
wait for it to blink green
enter stop mode
re-attach antenna
comes out of stop mode
breathes white once,
blinks green for 30 seconds
breathe dark blue once,
breathes white once
then blinks green again for 30 seconds
repeats from breathe dark blue
I even changed the mode back AUTOMATIC (but still use SYSTEM_THREAD(ENABLE) but it does the same thing
Add added code that would do the following if not connected in two minutes
Cellular.off();
Wait One second (non blocking wait)
Cellular.on();
Particle.connect();
But adding this does not fix it. I have to press the reset button for the device to connect to the network again, and it does so in less that 10 seconds.
Is it possible that the system thread is not starting after it comes back from stop mode? Or if tat was the case would the system LED not be changing blinks codes?
This is very interesting and describes what I’m experiencing as well. Except I can replicate it on more than one device.
I have 6 electrons running exactly the same code - I turned them on all at the same time. They get stuck in this same mode that the OP describes where it flashes green, then a very short burst of flashing dark blue, then white, then repeat. Every single one of them…all at the same time. Simply pressing the reset button fixes the issue. I bought these Electrons recently. Hoping it’s not hardware related.
What is interesting is they all fail at the same time! And it’s overnight when I’m using SLEEP_NETWORK_STANDBY. I will wake up in the morning and see that flashing green led on all devices.
One time it happened after the 1 day. The second time it happened after 3 days.
Is this maybe cell network / Particle cloud related, and not firmware version?