Cellular connection not possible until firmware re-flashed [SOLVED]

Hello,

My Electron is connected to an ultrasonic sensor, and runs a simple program to output the distance measured to serial port. It also publishes an event every few seconds, which gets to Particle Cloud, and eventually to a channel on ThingSpeak. So far, so good!

However, if I put the device into Soft Power mode I find that thereafter it can never re-establish cellular connectivity… When ‘woken’ it goes into Looking For Internet mode for a long period, then slowly pulses white (couple of seconds), then slowly pulses blue (couple of seconds). After that it goes back into Looking For Internet mode.

I have found one way to get it to re-establish connectivity, and that is to re-flash the firmware.bin file that I downloaded when going through the device setup/registration process. Once this completes, the device eventually gets into Connected mode.

I can then flash my code again (from VS Code) and the program is running and end-to-end the system is working.

For me this scenario is 100% reproducible, and so I don’t think it is related to power, signal strength, or use of third-party SIM.

I don’t have anything explicit in the code for connectivity, so I assume the mode is AUTOMATIC.

I will continue to trawl the forum, but if anyone can help, it would be appreciated!

Regards
Chris

Other things I’ve tried

  • re-connecting the battery
  • re-flashing just the code (not firmware)

It’s running firmware 1.0.1

You can try Cellular.off() with a 500ms delay before goint to sleep, to see if that helps.
It may be that the cellular modem ends up in some limbo state when you go to sleep the way you do now.

But without seeing your code it’s hard to tell what may cause that.

Hello ScruffR,

Thanks for your reply!

I tried your suggestion with no effect, but then I read further and found that a program must include the APN config when using a 3rd party SIM, otherwise it will use the Particle APN config.

#include “cellular_hal.h”
STARTUP(cellular_credentials_set(APN, USERNAME, PASSWORD, NULL));

When I added that, the code can connect every time!

Woot!