Electron loses cloud connection, won't automatically reconnect

I’m using a bunch of electrons with a 3rd Party SIM (telefonica). The electrons connect fine, (flashing green -> flashing cyan -> breathing cyan).
Then sometimes, after moving around (probably switching cell towers), the electron goes to flashing cyan (no cloud connection). It keeps flashing cyan for a long time, pretty much forever.
The cellular.localIP() shows an IP address assigned to the device.
When I reset the device, it flashes green for less than a minute, then cyan for a few seconds and is then connected again without problems.
I have read all the other threads with similar topics, but none of them describe the same issue. After booting, cloud connectivity works fine, there are no red flashes in between, etc. It is just that after moving around (driving in a car) the cloud connectivity stops occasionally.

To me it seems that the device is not properly detecting any changes in the cell connection and does not reconnect to cloud properly.

I am using
and then
in the setup function.

Is there a way to troubleshoot this?
And also, can I detect these issues in the code and trigger a manual reconnect?


EDIT: Firmware Version is 0.7.0RC3

1 Like

I remedied this issue by using a System.on event handler for cloud_status_connecting which starts a 10 second Timer, which will only be stopped by the cloud_status_connected handler. If it doesn’t reach that point, the timer will expire and the device will be rebooted. This bus/issue is a massive pain.

My devices don’t have a battery connected.
I did not completely resolve the issue, but made it much better with running this code at the beginning of setup:

void setBatOFF() {
	PMIC pmic;
	byte DATA = pmic.readChargeTermRegister();
	DATA &= 0b11000110;