Third Party SIM not working after a couple of minutes

Hi all,

I’ve setup a Tele2 SIM to work with the Electron. Followed all of the processes in https://setup.particle.io/ for a third party SIM and all seems to initially be ok.

Watching on the console, I can see the Particle come online, and then ‘particle.publish()’ a message I asked it to send, and then I wait 5 minutes for the next particle.publish() that I’ve scheduled.

Only problem is, the Particle never gets to the next message! It either goes offline and then reboots (we see the first particle.publish again) or it just hangs - the Particle breathes cyan but we never get any data through the console again.

I’ve tried adjusting the keepalive() values and also set NO_ACK within particle.publish() but this hasn’t fixed it either - we still see the same behaviour.

Could anyone advise?

Thanks

How short of a Keep Alive have you tried?

Also, where you call Particle.keepAlive() matters. You have to call it after you’ve connected. Only in the default automatic with system thread disabled, does it work in setup by itself.

If you have either SEMI_AUTOMATIC or MANUAL mode enabled, or have SYSTEM_THREAD(ENABLED) make sure you wait for Particle.connected() to return true before calling Particle.keepAlive() otherwise the change is ignored.

For some 3rd-party SIMs the keep alive is as small as 30 seconds.

1 Like

@rickkas7 Thanks - it is the first thing in setup(). I’m not using SYSTEM_MODE , so the Particle is therefore connecting to cell the usual (default) way.

@RWB Thanks - I’ve tried keepalives of 60, 120 and 240 seconds. Do you suggest increasing or reducing this length?

The Particle is running 0.6.4 - I’ve tried building to 0.6.4 and 0.6.1 - neither seem to make a difference to the outcome (not sure whether that’s helpful!).

Thanks all.

Definitely reducing:

Hi all,

Update now. Have tried setting keepalive to 60 seconds. The Particle behaves like this:

Green Flashing - Looking for Internet
Breathing Blue - Cellular Not Connected
Breathing White - Cellular Off

…and repeat

That’s a really strange sequence. Could you install the cloud debug firmware. There are instructions at the end for using it with a 3rd-party SIM card.

2 Likes

Hi @rickkas7, super interesting tool, thanks. This is the output:


Serial monitor opened successfully:
deviceID=[HIDDEN THIS]
manufacturer=u-blox
model=SARA-U270
firmware version=23.20
ordering code=SARA-U270-00S-00
IMEI=352253061437819
IMSI=u-blox
ICCID= [HIDDEN THIS - BUT IT MATCHES]
0000021821 [app] INFO: enabling trace logging
attempting to connect to the cellular network...
0000021821 [system] INFO: Sim Ready
0000021821 [system] INFO: Sim Ready
0000021822 [system] INFO: ARM_WLAN_WD 1
0000021822 [system] INFO: ARM_WLAN_WD 1

[ Modem::init ] = = = = = = = = = = = = = = =
    21.822 AT send       9 "AT+CGSN\r\n"
    21.842 AT read UNK  19 "\r\n352253061437819\r\n"
    21.852 AT read OK    6 "\r\nOK\r\n"
    21.852 AT send       9 "AT+CGMI\r\n"
    21.862 AT read UNK  10 "\r\nu-blox\r\n"
    21.872 AT read OK    6 "\r\nOK\r\n"
    21.872 AT send       9 "AT+CGMM\r\n"
    21.882 AT read UNK  13 "\r\nSARA-U270\r\n"
    21.892 AT read OK    6 "\r\nOK\r\n"
    21.892 AT send       9 "AT+CGMR\r\n"
    21.902 AT read UNK   9 "\r\n23.20\r\n"
    21.912 AT read OK    6 "\r\nOK\r\n"
    21.912 AT send       9 "AT+CCID\r\n"
    21.922 AT read  +   31 "\r\n+CCID: [HIDDEN]\r\n"
    21.933 AT read OK    6 "\r\nOK\r\n"
    21.933 AT send      11 "AT+UPSV=1\r\n"
    21.943 AT read OK    6 "\r\nOK\r\n"
    21.943 AT send      11 "AT+CMGF=1\r\n"
    21.953 AT read OK    6 "\r\nOK\r\n"
    21.953 AT send      13 "AT+CNMI=2,1\r\n"
    21.963 AT read OK    6 "\r\nOK\r\n"
    21.963 AT send       9 "AT+CIMI\r\n"
    21.973 AT read UNK  19 "\r\n240075810892591\r\n"
    21.983 AT read OK    6 "\r\nOK\r\n"

[ Modem::register ] = = = = = = = = = = = = = =
    21.983 AT send      10 "AT+CREG?\r\n"
    21.994 AT read  +   32 "\r\n+CREG: 2,5,\"11F9\",\"7CA1DB\",6\r\n"
    22.005 AT read OK    6 "\r\nOK\r\n"
    22.005 AT send      11 "AT+CGREG?\r\n"
    22.015 AT read  +   38 "\r\n+CGREG: 2,5,\"11F9\",\"7CA1DB\",6,\"01\"\r\n"
    22.026 AT read OK    6 "\r\nOK\r\n"
    22.026 AT send      10 "AT+COPS?\r\n"
    22.106 AT read  +   21 "\r\n+COPS: 0,0,\"EE\",2\r\n"
    22.116 AT read OK    6 "\r\nOK\r\n"
    22.116 AT send       9 "AT+CNUM\r\n"
    22.146 AT read OK    6 "\r\nOK\r\n"
    22.146 AT send       8 "AT+CSQ\r\n"
    22.156 AT read  +   14 "\r\n+CSQ: 11,2\r\n"
    22.166 AT read OK    6 "\r\nOK\r\n"

[ Modem::join ] = = = = = = = = = = = = = = = =
    22.166 AT send      12 "AT+CGATT=1\r\n"
    22.177 AT read OK    6 "\r\nOK\r\n"
    22.177 AT send      14 "AT+UPSND=0,8\r\n"
    22.187 AT read  +   17 "\r\n+UPSND: 0,8,0\r\n"
    22.197 AT read OK    6 "\r\nOK\r\n"
    22.197 AT send      23 "AT+UPSD=0,7,\"0.0.0.0\"\r\n"
    22.208 AT read OK    6 "\r\nOK\r\n"
    22.208 AT send      36 "AT+UPSD=0,1,\"spark.telefonica.com\"\r\n"
    22.219 AT read OK    6 "\r\nOK\r\n"
    22.219 AT send      15 "AT+UPSD=0,6,0\r\n"
    22.229 AT read OK    6 "\r\nOK\r\n"
    22.229 AT send      14 "AT+UPSDA=0,3\r\n"
    27.029 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
    27.030 AT send      15 "AT+UPSD=0,6,1\r\n"
    27.040 AT read OK    6 "\r\nOK\r\n"
    27.040 AT send      14 "AT+UPSDA=0,3\r\n"
    27.220 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
    27.221 AT send      15 "AT+UPSD=0,6,2\r\n"
    27.231 AT read OK    6 "\r\nOK\r\n"
    27.231 AT send      14 "AT+UPSDA=0,3\r\n"
    27.441 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
Your modem APN/password/username may be wrong

0000051823 [system] WARN: Resetting WLAN due to WLAN_WD_TO()
0000051823 [system] WARN: Resetting WLAN due to WLAN_WD_TO()

[ Modem::powerOff ] = = = = = = = = = = = = = =
    51.822 AT send      12 "AT+CPWROFF\r\n"
    77.253 AT read OK    6 "\r\nOK\r\n"

[ Modem::powerOn ] = = = = = = = = = = = = = =
    77.563 AT send       4 "AT\r\n"
    78.883 AT send       4 "AT\r\n"
    80.203 AT send       4 "AT\r\n"
    81.523 AT send       4 "AT\r\n"
    81.533 AT read UNK   3 "AT\r"
    81.543 AT read OK    6 "\r\nOK\r\n"
    81.753 AT send       7 "AT E0\r\n"
    81.763 AT read UNK   6 "AT E0\r"
    81.773 AT read OK    6 "\r\nOK\r\n"
    81.773 AT send      11 "AT+CMEE=2\r\n"
    81.783 AT read OK    6 "\r\nOK\r\n"
    81.783 AT send      19 "AT+CMER=1,0,0,2,1\r\n"
    81.794 AT read OK    6 "\r\nOK\r\n"
    81.794 AT send      15 "AT+IPR=115200\r\n"
    81.805 AT read OK    6 "\r\nOK\r\n"
    81.905 AT send      10 "AT+CPIN?\r\n"
    81.915 AT read  +   16 "\r\n+CPIN: READY\r\n"
    81.925 AT read OK    6 "\r\nOK\r\n"
0000081926 [system] INFO: Sim Ready
0000081926 [system] INFO: Sim Ready
0000081926 [system] INFO: ARM_WLAN_WD 1
0000081926 [system] INFO: ARM_WLAN_WD 1

[ Modem::init ] = = = = = = = = = = = = = = =
    81.926 AT send       9 "AT+CGSN\r\n"
    81.947 AT read UNK  19 "\r\n352253061437819\r\n"
    81.957 AT read OK    6 "\r\nOK\r\n"
    81.957 AT send       9 "AT+CGMI\r\n"
    81.967 AT read UNK  10 "\r\nu-blox\r\n"
    81.977 AT read OK    6 "\r\nOK\r\n"
    81.977 AT send       9 "AT+CGMM\r\n"
    81.987 AT read UNK  13 "\r\nSARA-U270\r\n"
    81.997 AT read OK    6 "\r\nOK\r\n"
    81.997 AT send       9 "AT+CGMR\r\n"
    82.007 AT read UNK   9 "\r\n23.20\r\n"
    82.017 AT read OK    6 "\r\nOK\r\n"
    82.017 AT send       9 "AT+CCID\r\n"
    82.027 AT read  +   31 "\r\n+CCID: [HIDDEN]\r\n"
    82.038 AT read OK    6 "\r\nOK\r\n"
    82.038 AT send      11 "AT+UPSV=1\r\n"
    82.048 AT read OK    6 "\r\nOK\r\n"
    82.048 AT send      11 "AT+CMGF=1\r\n"
    82.058 AT read OK    6 "\r\nOK\r\n"
    82.058 AT send      13 "AT+CNMI=2,1\r\n"
    82.068 AT read OK    6 "\r\nOK\r\n"
    82.068 AT send       9 "AT+CIMI\r\n"
    82.078 AT read UNK  19 "\r\n240075810892591\r\n"
    82.088 AT read OK    6 "\r\nOK\r\n"

[ Modem::register ] = = = = = = = = = = = = = =
    82.088 AT send      10 "AT+CREG?\r\n"
    82.099 AT read  +   14 "\r\n+CREG: 0,0\r\n"
    82.109 AT read OK    6 "\r\nOK\r\n"
    82.109 AT send      11 "AT+CGREG?\r\n"
    82.119 AT read  +   15 "\r\n+CGREG: 0,0\r\n"
    82.129 AT read OK    6 "\r\nOK\r\n"
    82.129 AT send      12 "AT+CGREG=2\r\n"
    82.139 AT read OK    6 "\r\nOK\r\n"
    82.139 AT send      11 "AT+CREG=2\r\n"
    82.149 AT read OK    6 "\r\nOK\r\n"
    82.149 AT send      10 "AT+CREG?\r\n"
    82.159 AT read  +   14 "\r\n+CREG: 2,0\r\n"
    82.169 AT read OK    6 "\r\nOK\r\n"
    82.169 AT send      11 "AT+CGREG?\r\n"
    82.179 AT read  +   15 "\r\n+CGREG: 2,0\r\n"
    82.189 AT read OK    6 "\r\nOK\r\n"
    97.189 AT send      10 "AT+CREG?\r\n"
    97.189 AT read  +   14 "\r\n+CIEV: 2,2\r\n"
    97.200 AT read  +   30 "\r\n+CREG: 5,\"11F9\",\"7CE9E8\",6\r\n"
    97.211 AT read  +   36 "\r\n+CGREG: 5,\"11F9\",\"7CE9E8\",6,\"01\"\r\n"
    97.222 AT read  +   14 "\r\n+CIEV: 3,1\r\n"
    97.232 AT read  +   14 "\r\n+CIEV: 7,1\r\n"
    97.242 AT read  +   14 "\r\n+CIEV: 9,2\r\n"
CIEV matched: 9,2
    98.552 AT read  +   32 "\r\n+CREG: 2,5,\"11F9\",\"7CE9E8\",6\r\n"
    98.563 AT read OK    6 "\r\nOK\r\n"
    98.563 AT send      11 "AT+CGREG?\r\n"
    98.573 AT read  +   38 "\r\n+CGREG: 2,5,\"11F9\",\"7CE9E8\",6,\"01\"\r\n"
    98.584 AT read OK    6 "\r\nOK\r\n"
    98.584 AT send      10 "AT+COPS?\r\n"
    98.664 AT read  +   21 "\r\n+COPS: 0,0,\"EE\",2\r\n"
    98.674 AT read OK    6 "\r\nOK\r\n"
    98.674 AT send       9 "AT+CNUM\r\n"
    98.704 AT read OK    6 "\r\nOK\r\n"
    98.704 AT send       8 "AT+CSQ\r\n"
    98.714 AT read  +   14 "\r\n+CSQ: 10,2\r\n"
    98.724 AT read OK    6 "\r\nOK\r\n"

[ Modem::join ] = = = = = = = = = = = = = = = =
    98.724 AT send      12 "AT+CGATT=1\r\n"
    98.735 AT read OK    6 "\r\nOK\r\n"
    98.735 AT send      14 "AT+UPSND=0,8\r\n"
    98.745 AT read  +   17 "\r\n+UPSND: 0,8,0\r\n"
    98.755 AT read OK    6 "\r\nOK\r\n"
    98.755 AT send      23 "AT+UPSD=0,7,\"0.0.0.0\"\r\n"
    98.766 AT read OK    6 "\r\nOK\r\n"
    98.766 AT send      36 "AT+UPSD=0,1,\"spark.telefonica.com\"\r\n"
    98.777 AT read OK    6 "\r\nOK\r\n"
    98.777 AT send      15 "AT+UPSD=0,6,0\r\n"
    98.788 AT read OK    6 "\r\nOK\r\n"
    98.788 AT send      14 "AT+UPSDA=0,3\r\n"
    99.998 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
    99.999 AT send      15 "AT+UPSD=0,6,1\r\n"
    99.999 AT read  +   14 "\r\n+CIEV: 2,1\r\n"
   100.010 AT read OK    6 "\r\nOK\r\n"
   100.010 AT send      14 "AT+UPSDA=0,3\r\n"
   100.191 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
   100.192 AT send      15 "AT+UPSD=0,6,2\r\n"
   100.202 AT read OK    6 "\r\nOK\r\n"
   100.202 AT send      14 "AT+UPSDA=0,3\r\n"
   100.412 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
Your modem APN/password/username may be wrong

0000111928 [system] WARN: Resetting WLAN due to WLAN_WD_TO()
0000111928 [system] WARN: Resetting WLAN due to WLAN_WD_TO()

[ Modem::powerOff ] = = = = = = = = = = = = = =
   111.928 AT send      12 "AT+CPWROFF\r\n"
   111.928 AT read  +   14 "\r\n+CIEV: 2,2\r\n"
   111.939 AT read  +   30 "\r\n+CREG: 5,\"11F9\",\"7CA1DB\",6\r\n"
   111.950 AT read  +   36 "\r\n+CGREG: 5,\"11F9\",\"7CA1DB\",6,\"01\"\r\n"

So I think the most interesting thing from this is this line:

    27.441 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
Your modem APN/password/username may be wrong

Does this mean that the Particle still believes it is on a Particle SIM? Either that, or the third-party SIM hasn’t been configured properly?

Could we have a look at your code?

Also, make sure you completely remove all power (USB and battery) before switching your APN. The change might not take effect otherwise.

2 Likes

Try 30 seconds also, some networks require this low of a setting.

2 Likes