Particle Electron - Not connecting after being tuned off

Hello,

I´ve been programming my Electron, it works very good, logging temperature every 5 minutes. I´m using the Deep Sleep mode to cut the energy usage. If i turn it off (unplug the battery and USB power) it is not able to connect again, just blinks green “forever”… I´m using a third party SIM (Vodafone in Iceland).

I´m using this example but with DS18b20 instead of DHT22:

Best regards,
Ragnar

It would be more interesting to know what you reattach rather then what you unplug :wink:
Also how long is “forever”? It can take up to five minutes.
How does the device do when you press RESET after a few seconds green blinking?

It is very important that you have the LiPo attached first to make sure the cellular modem can draw enough current to connect.

Hi

I had a similar issue where I had followed the instructions to flash the APN of the 3rd party to the device and then sometimes on powering up again it would not connect. It was as if the APN credentials had been lost.

Since then I have added

#include "cellular_hal.h"
STARTUP(cellular_credentials_set("internet", "", "", NULL));

Where “internet” is my APN - to the beginning of my code and the problem has gone away.

Maybe a similar issue

Cheers
Michael

Hey ScruffR and thank you for a quick response!

I first unplugged the Micro USB charger and the the battery, and when I “turned it on” again I plugged the battery in first and then the USB charger.

It was blinking for hours, I left it like that overnight and when I checked it the day after it was in listening mode (blinking BLUE).

If I reset it, it stars blinking green again.

Hi Michael and thank you for the reply.

That makes sense because if I flash the device with the APN info, it starts working again.
I will try this tomorrow when I arrice at work and will notify you if it works!

Best regards,
Ragnar

cellular_credentials_set() does not permanently store the value in the flash. You must call it in from every program you flash to an Electron with a 3rd party SIM. I can see where it would be confusing because the Wi-Fi credentials are permanently stored in flash, and that setting is extremely sticky, but that’s not the way it works currently for cellular APNs.
https://docs.particle.io/reference/firmware/electron/#setcredentials-

1 Like

The code from @stofmike worked great, now the Electron connects to the 2G without problem in a matter of seconds after being powered up. Thanks alot! :smile: