Electron Global (2G) not connecting (with logs)

Hello all

I am having big problems with getting 2g electrons to connect consistently. I have a simple script running which tries to connect to cloud, and then goes to sleep for 5 mins, wakes up and tries again. It connects about 3 times out of 10, the rest it just times out after my timeout cutoff of 2 mins (I can’t afford more time that this to connect burning through battery!) When it does connect, it connects within about 10 seconds.

Im using standard particle sim and antenna.

This is the debugging output of when its not connecting, this data just continues forever.

HELP! I have 25 units i need to get out of the door this week.

     5.066 AT send       3 "AT\r"
[ ElectronSerialPipe::begin ] = = = = = = = =

[ Modem::powerOn ] = = = = = = = = = = = = = =
     6.386 AT send       4 "AT\r\n"
     6.536 AT read UNK   3 "AT\r"
     6.546 AT read OK    6 "\r\nOK\r\n"
     6.756 AT send       7 "AT E0\r\n"
     6.796 AT read UNK   6 "A\xd4 E0\r"
     6.806 AT read OK    6 "\r\nOK\r\n"
     6.806 AT send      11 "AT+CMEE=2\r\n"
     6.846 AT read OK    6 "\r\nOK\r\n"
     6.846 AT send      19 "AT+CMER=1,0,0,2,1\r\n"
     6.886 AT read OK    6 "\r\nOK\r\n"
     6.886 AT send      15 "AT+IPR=115200\r\n"
     6.926 AT read OK    6 "\r\nOK\r\n"
     7.026 AT send      10 "AT+CPIN?\r\n"
     7.066 AT read ERR  37 "\r\n+CME ERROR: operation not allowed\r\n"
     7.897 AT read  +   14 "\r\n+CIEV: 9,0\r\n"
CIEV matched: 9,0
     8.077 AT send      10 "AT+CPIN?\r\n"
     8.117 AT read  +   16 "\r\n+CPIN: READY\r\n"
     8.127 AT read OK    6 "\r\nOK\r\n"
     8.127 AT send       3 "AT\r"
     8.157 AT read OK    6 "\r\nOK\r\n"

[ Modem::powerOn ] = = = = = = = = = = = = = =
     8.468 AT send       4 "AT\r\n"
     8.498 AT read OK    6 "\r\nOK\r\n"
     8.708 AT send       7 "AT E0\r\n"
     8.748 AT read OK    6 "\r\nOK\r\n"
     8.748 AT send      11 "AT+CMEE=2\r\n"
     8.788 AT read OK    6 "\r\nOK\r\n"
     8.788 AT send      19 "AT+CMER=1,0,0,2,1\r\n"
     8.828 AT read OK    6 "\r\nOK\r\n"
     8.828 AT send      15 "AT+IPR=115200\r\n"
     8.868 AT read OK    6 "\r\nOK\r\n"
     8.968 AT send      10 "AT+CPIN?\r\n"
     9.008 AT read  +   16 "\r\n+CPIN: READY\r\n"
     9.018 AT read OK    6 "\r\nOK\r\n"
0000009018 [system] INFO: Sim Ready
0000009018 [system] INFO: ARM_WLAN_WD 1

[ Modem::init ] = = = = = = = = = = = = = = =
     9.019 AT send       9 "AT+CGSN\r\n"
     9.060 AT read UNK  19 "\r\n353161070769776\r\n"
     9.070 AT read OK    6 "\r\nOK\r\n"
     9.070 AT send       9 "AT+CGMI\r\n"
     9.110 AT read UNK  10 "\r\nu-blox\r\n"
     9.120 AT read OK    6 "\r\nOK\r\n"
     9.120 AT send       9 "AT+CGMM\r\n"
     9.160 AT read UNK  13 "\r\nSARA-G350\r\n"
     9.170 AT read OK    6 "\r\nOK\r\n"
     9.170 AT send       9 "AT+CGMR\r\n"
     9.210 AT read UNK   9 "\r\n08.70\r\n"
     9.220 AT read OK    6 "\r\nOK\r\n"
     9.220 AT send       9 "AT+CCID\r\n"
     9.260 AT read  +   30 "\r\n+CCID: 8934076500002738243\r\n"
     9.270 AT read OK    6 "\r\nOK\r\n"
     9.270 AT send      11 "AT+UPSV=1\r\n"
     9.310 AT read OK    6 "\r\nOK\r\n"
     9.310 AT send      11 "AT+CMGF=1\r\n"
     9.350 AT read OK    6 "\r\nOK\r\n"
     9.350 AT send      13 "AT+CNMI=2,1\r\n"
     9.390 AT read OK    6 "\r\nOK\r\n"
     9.390 AT send       9 "AT+CIMI\r\n"
     9.430 AT read UNK  19 "\r\n214074300564220\r\n"
     9.440 AT read OK    6 "\r\nOK\r\n"

[ Modem::register ] = = = = = = = = = = = = = =
     9.440 AT send      10 "AT+CREG?\r\n"
     9.481 AT read  +   14 "\r\n+CREG: 0,0\r\n"
     9.491 AT read OK    6 "\r\nOK\r\n"
     9.491 AT send      11 "AT+CGREG?\r\n"
     9.531 AT read  +   15 "\r\n+CGREG: 0,2\r\n"
     9.541 AT read OK    6 "\r\nOK\r\n"
     9.541 AT send      12 "AT+CGREG=2\r\n"
     9.581 AT read OK    6 "\r\nOK\r\n"
     9.581 AT send      11 "AT+CREG=2\r\n"
     9.621 AT read OK    6 "\r\nOK\r\n"
     9.621 AT send      10 "AT+CREG?\r\n"
     9.661 AT read  +   14 "\r\n+CREG: 2,0\r\n"
     9.671 AT read OK    6 "\r\nOK\r\n"
     9.671 AT send      11 "AT+CGREG?\r\n"
     9.711 AT read  +   15 "\r\n+CGREG: 2,2\r\n"
     9.721 AT read OK    6 "\r\nOK\r\n"
    24.721 AT send      10 "AT+CREG?\r\n"
    24.721 AT read  +   14 "\r\n+CIEV: 2,3\r\n"
    24.732 AT read  +   14 "\r\n+CIEV: 7,1\r\n"
    24.742 AT read  +   14 "\r\n+CIEV: 3,1\r\n"
    24.752 AT read  +   26 "\r\n+CREG: 5,\"0853\",\"6097\"\r\n"
    24.763 AT read  +   13 "\r\n+CGREG: 0\r\n"
    24.773 AT read  +   14 "\r\n+CIEV: 9,0\r\n"
CIEV matched: 9,0
    24.783 AT read  +   14 "\r\n+CIEV: 9,0\r\n"
CIEV matched: 9,0
    24.793 AT read  +   14 "\r\n+CIEV: 9,0\r\n"
CIEV matched: 9,0
    24.873 AT read  +   28 "\r\n+CREG: 2,5,\"0853\",\"6097\"\r\n"
    24.883 AT read OK    6 "\r\nOK\r\n"
    24.883 AT send      11 "AT+CGREG?\r\n"
    24.923 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    24.933 AT read OK    6 "\r\nOK\r\n"
    24.933 AT send      10 "AT+COPS?\r\n"
    24.973 AT read  +   24 "\r\n+COPS: 0,0,\"O2 - UK\"\r\n"
    24.983 AT read OK    6 "\r\nOK\r\n"
    24.983 AT send       9 "AT+CNUM\r\n"
    25.063 AT read OK    6 "\r\nOK\r\n"
    25.063 AT send       8 "AT+CSQ\r\n"
    25.103 AT read  +   15 "\r\n+CSQ: 18,99\r\n"
    25.113 AT read OK    6 "\r\nOK\r\n"
    40.113 AT send      10 "AT+CREG?\r\n"
    40.113 AT read  +   14 "\r\n+CIEV: 9,0\r\n"
CIEV matched: 9,0
    40.414 AT read  +   28 "\r\n+CREG: 2,5,\"0853\",\"6097\"\r\n"
    40.424 AT read OK    6 "\r\nOK\r\n"
    40.424 AT send      11 "AT+CGREG?\r\n"
    40.464 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    40.474 AT read OK    6 "\r\nOK\r\n"
    40.474 AT send      10 "AT+COPS?\r\n"
    40.514 AT read  +   24 "\r\n+COPS: 0,0,\"O2 - UK\"\r\n"
    40.524 AT read OK    6 "\r\nOK\r\n"
    40.524 AT send       9 "AT+CNUM\r\n"
    40.584 AT read OK    6 "\r\nOK\r\n"
    40.584 AT send       8 "AT+CSQ\r\n"
    40.624 AT read  +   15 "\r\n+CSQ: 19,99\r\n"
    40.634 AT read OK    6 "\r\nOK\r\n"
    55.634 AT send      10 "AT+CREG?\r\n"
    55.954 AT read  +   28 "\r\n+CREG: 2,5,\"0853\",\"6097\"\r\n"
    55.964 AT read OK    6 "\r\nOK\r\n"
    55.964 AT send      11 "AT+CGREG?\r\n"
    56.004 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    56.014 AT read OK    6 "\r\nOK\r\n"
    56.014 AT send      10 "AT+COPS?\r\n"
    56.054 AT read  +   24 "\r\n+COPS: 0,0,\"O2 - UK\"\r\n"
    56.064 AT read OK    6 "\r\nOK\r\n"
    56.064 AT send       9 "AT+CNUM\r\n"
    56.124 AT read OK    6 "\r\nOK\r\n"
    56.124 AT send       8 "AT+CSQ\r\n"
    56.164 AT read  +   15 "\r\n+CSQ: 19,99\r\n"
    56.174 AT read OK    6 "\r\nOK\r\n"
    71.174 AT send      10 "AT+CREG?\r\n"
    71.484 AT read  +   28 "\r\n+CREG: 2,5,\"0853\",\"6097\"\r\n"
    71.494 AT read OK    6 "\r\nOK\r\n"
    71.494 AT send      11 "AT+CGREG?\r\n"
    71.534 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    71.544 AT read OK    6 "\r\nOK\r\n"
    71.544 AT send      10 "AT+COPS?\r\n"
    71.584 AT read  +   24 "\r\n+COPS: 0,0,\"O2 - UK\"\r\n"
    71.595 AT read OK    6 "\r\nOK\r\n"
    71.595 AT send       9 "AT+CNUM\r\n"
    71.655 AT read OK    6 "\r\nOK\r\n"
    71.655 AT send       8 "AT+CSQ\r\n"
    71.695 AT read  +   15 "\r\n+CSQ: 20,99\r\n"
    71.705 AT read OK    6 "\r\nOK\r\n"
    86.705 AT send      10 "AT+CREG?\r\n"
    87.025 AT read  +   28 "\r\n+CREG: 2,5,\"0853\",\"6097\"\r\n"
    87.036 AT read OK    6 "\r\nOK\r\n"
    87.036 AT send      11 "AT+CGREG?\r\n"
    87.076 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    87.086 AT read OK    6 "\r\nOK\r\n"
    87.086 AT send      10 "AT+COPS?\r\n"
    87.126 AT read  +   24 "\r\n+COPS: 0,0,\"O2 - UK\"\r\n"
    87.136 AT read OK    6 "\r\nOK\r\n"
    87.136 AT send       9 "AT+CNUM\r\n"
    87.196 AT read OK    6 "\r\nOK\r\n"
    87.196 AT send       8 "AT+CSQ\r\n"
    87.236 AT read  +   15 "\r\n+CSQ: 20,99\r\n"
    87.246 AT read OK    6 "\r\nOK\r\n"

What system OS version are you running?
If it’s a simple script, can you post it too?
How does the device do when just running tinker or an empty application?
What does the device do in Safe Mode?

It looks like that SIM was rejected by all of the carriers at the time the log was taken.

However, it looks like it finally successfully connected today at 5:17:34 AM EDT (-0400). It appears to have gotten all the way to Particle cloud connected (breathing cyan) at that time.

Running OS 0.7.0

Tinker and safe mode behave the same, very intermittent connection ability

code is …

#include "Particle.h"
#define SERIAL_BAUD 9600

STARTUP(startupconfig());
//SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

void startupconfig() //this happens before setup
{
    System.enableFeature(FEATURE_RESET_INFO);
    System.enableFeature(FEATURE_RETAINED_MEMORY);
    Cellular.setListenTimeout(10);
}
//STATE
String uuid = System.deviceID();

void setup() {
    SerialLogHandler logHandler(LOG_LEVEL_TRACE);
    Serial.begin(SERIAL_BAUD); //debug serial
    delay(5000); // delay to connect to serial
    
    Serial.println("GSM connection attempt");
    Cellular.connect();
    delay(5000);
    
    Serial.println("Connected connection attempt");
    Particle.connect();
    delay(5000);
}

void loop() {
    System.sleep(SLEEP_MODE_SOFTPOWEROFF,120);
}

It seems, when I try a different sim that uses EE, then it connects fine and relatively fast (within 20 seconds)

Are particle sims locked to 02 only in the uk?

Yes, O2 is the only supported carrier in the UK with the Particle SIM card. In most countries there is only one supported carrier. The exception is the United States, where both AT&T and T-Mobile are supported.

just don’t get it as the 02 coverage here is good.

It’s possible that a nearby tower could only have 3G/4G/LTE coverage and not 2G in some cases. Another thing to try is the carrier scan which will show all of the nearby towers and what carriers they support and their signal strengths:

Ok thanks, yes I have verified these findings with standard 2g/3g data dongle.

EE is fine, but 02 won’t connect.

Can i force the electron to choose a particular carrier?

I have this in my notes:

To force a connection to AT&T (“mobile network code” = 310410):

cellular_on(NULL);
cellular_command(NULL, NULL, 100000, “AT+UPSDA=0,4\r\n”);
cellular_command(NULL, NULL, 100000, “AT+COPS=2\r\n”);
cellular_command(NULL, NULL, 1000, “AT+COPS=4,2,“310410”\r\n”);
Particle.connect();

(310260 is tmobile)

Also, see this https://gist.github.com/technobly/bd545861df0478428551200e64a50c63

cheers,
ParticleD

thanks!