# Electron Doesn't Connect To Cellular Network on Some SIMs

I am trying to claim a set of Electrons and flash my firmware on them but the devices are never properly connecting to the cellular network with certain otherwise working SIM cards.

Important Configuration Details:
I’m using a 3rd Party SIM (Hologram)
System Firmware 0.6.4

What Is Happening
I have 2 Electrons that I’ve been using for several weeks successfully. I have 2 new Electrons I am trying to set up.

If I put the SIM cards originally in the 2 previously configured Electrons in any of the new Electrons everything works as expected. However, if I put the new SIM cards in any of the 4 Electrons, they go through the following LED pattern: (breathing white) -> (flashing green) -> (breathing blue) -> reset and never connect to the Particle cloud.

I originally suspected the SIM cards but I tried 4 different SIMs, and they all worked in a Cellular hotspot device but not in the Electrons.

Sample Sketch That Exhibits the Problem

STARTUP(cellular_credentials_set("hologram", "", "", NULL));

void setup() {
delay(5000);
Particle.keepAlive(20);
}

void loop() {
}


Because this is single threaded operation, the 5 second delay should usually be sufficient to set the keepAlive, but even when the keepAlive is not properly set the usual (and consistently so) behavior is for the device to connect once to the particle cloud, lose the UDP connection after the timeout of a minute or two, but still breath cyan until the next default keepAlive is sent (every 26 minutes).

Any thoughts as to what is going on? This is critically important that I be able to configure these devices with the 3rd party SIM cards. Using the Particle SIM card everything works properly, but even after claiming neither the device reverting to the above NOR the tinker firmware with the modified APN work, exhibiting the same behavior. I’ve been using Hologram SIM cards for a few months and they have been working exceptionally well for me so there clearly isn’t a systematic incompatibility.

Any help is greatly appreciated.

I think this indicates that the problem is in the new SIM cards, don’t you? Every device works with a known working SIM and conversely every device fails with the new SIM cards.

Have you tried working with your SIM provider on this?

That’s what I thought except that the SIM cards work flawlessly as expected in other devices. I have 100 SIM cards and tested serial numbers at the extreme ranges and in the middle, all with the same effect. I agree, it’s absolutely possible there is a SIM issue, but given that it works in the other device and has always worked in the past with my Electron devices I am honestly more skeptical of the Electron given lots of difficulty with getting expected behavior out of system firmware, especially with 3rd party sims.

I’ve reached out to my contact at hologram as well, but time is unfortunately short for getting resolution on this, so I’m hitting all angles that seem possible. Thanks for the response, appreciate it.

You should get a cloud debug log, which will show exactly what is failing. There are instructions at the end of this page for how to use it with a 3rd-party SIM card.

In trying to configure the 3rd party SIM APN, if I press ‘a’ and then enter to send using the particle dev IDE serial monitor the device just echos back the menu again and doesn’t set the modem.

if I type in ‘ahologram’ and then press enter it doesn’t work either. What am I missing on this?

Edit: it will display “enter APN: clouddebug: press…” after I input an a and press enter.
Seems like the serial buffer doesn’t clear out the EOL char after the a when it hits the enter APN state, but that the composite line ‘ahologram’ doesn’t appear to work either.

Yes, that’s a bug. When you use it with screen or PuTTY, you can just type the a without return. Give me a few minutes and I’ll fix that.

1 Like

I’ve got it working on screen, but it isn’t connecting with my known good SIM cards. The read out is:

clouddebug: press letter corresponding to the command
a - enter APN for 3rd-party SIM card
k - set keep-alive value
c - show carriers at this location
t - run normal tests (occurs automatically after 10 seconds)
enter APN:
APN set to hologram
clouddebug: press letter corresponding to the command
a - enter APN for 3rd-party SIM card
k - set keep-alive value
c - show carriers at this location
t - run normal tests (occurs automatically after 10 seconds)
enter keep-alive value in seconds (typically 30 to 1380):
keepalive will be set to 30
clouddebug: press letter corresponding to the command
a - enter APN for 3rd-party SIM card
k - set keep-alive value
c - show carriers at this location
t - run normal tests (occurs automatically after 10 seconds)
starting tests...
turning cellular on...
deviceID=21003c000b47373130373633
manufacturer=u-blox
model=SARA-U260
firmware version=23.20
ordering code=SARA-U260-00S-01
IMEI=352580080830958
IMSI=u-blox
ICCID=8944502311176184518
0000030158 [app] INFO: enabling trace logging
attempting to connect to the cellular network...
0000030159 [system] INFO: ARM_WLAN_WD 1
0000030159 [s
[ Modem::init ] = = = = = = = = = = = = = = =
30.160 AT send       9 "AT+CGSN\r\n"
30.180 AT read UNK  19 "\r\n352580080830958\r\n"
30.190 AT read OK    6 "\r\nOK\r\n"
30.190 AT send       9 "AT+CGMI\r\n"
30.200 AT read UNK  10 "\r\nu-blox\r\n"
30.210 AT read OK    6 "\r\nOK\r\n"
30.210 AT send       9 "AT+CGMM\r\n"
30.220 AT read UNK  13 "\r\nSARA-U260\r\n"
30.230 AT read OK    6 "\r\nOK\r\n"
30.230 AT send       9 "AT+CGMR\r\n"
30.240 AT read UNK   9 "\r\n23.20\r\n"
30.250 AT read OK    6 "\r\nOK\r\n"
30.250 AT send       9 "AT+CCID\r\n"
30.260 AT read  +   30 "\r\n+CCID: 8944502311176184518\r\n"
30.271 AT read OK    6 "\r\nOK\r\n"
30.271 AT send      11 "AT+UPSV=1\r\n"
30.281 AT read OK    6 "\r\nOK\r\n"
30.281 AT send      11 "AT+CMGF=1\r\n"
30.291 AT read OK    6 "\r\nOK\r\n"
30.291 AT send      13 "AT+CNMI=2,1\r\n"
30.301 AT read OK    6 "\r\nOK\r\n"
30.301 AT send       9 "AT+CIMI\r\n"
30.311 AT read UNK  19 "\r\n234507098618451\r\n"
30.321 AT read OK    6 "\r\nOK\r\n"

[ Modem::register ] = = = = = = = = = = = = = =
30.321 AT send      10 "AT+CREG?\r\n"
30.332 AT read  +   33 "\r\n+CREG: 2,5,\"1BFF\",\"70B4E37\",2\r\n"
30.343 AT read OK    6 "\r\nOK\r\n"
30.343 AT send      11 "AT+CGREG?\r\n"
30.353 AT read  +   39 "\r\n+CGREG: 2,5,\"1BFF\",\"70B4E37\",2,\"12\"\r\n"
30.364 AT read OK    6 "\r\nOK\r\n"
30.364 AT send      10 "AT+COPS?\r\n"
30.494 AT read  +   27 "\r\n+COPS: 0,0,\"T-Mobile\",2\r\n"
30.505 AT read OK    6 "\r\nOK\r\n"
30.505 AT send       9 "AT+CNUM\r\n"
30.525 AT read OK    6 "\r\nOK\r\n"
30.525 AT send       8 "AT+CSQ\r\n"
30.535 AT read  +   14 "\r\n+CSQ: 10,3\r\n"
30.545 AT read OK    6 "\r\nOK\r\n"

[ Modem::join ] = = = = = = = = = = = = = = = =
30.545 AT send      12 "AT+CGATT=1\r\n"
30.556 AT read OK    6 "\r\nOK\r\n"
30.556 AT send      14 "AT+UPSND=0,8\r\n"
30.566 AT read  +   17 "\r\n+UPSND: 0,8,0\r\n"
30.576 AT read OK    6 "\r\nOK\r\n"
30.576 AT send      23 "AT+UPSD=0,7,\"0.0.0.0\"\r\n"
30.586 AT read OK    6 "\r\nOK\r\n"
30.586 AT send      18 "AT+UPSD=0,1,\"30\"\r\n"
30.596 AT read OK    6 "\r\nOK\r\n"
30.596 AT send      15 "AT+UPSD=0,6,0\r\n"
30.606 AT read OK    6 "\r\nOK\r\n"
30.606 AT send      14 "AT+UPSDA=0,3\r\n"
31.926 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
31.927 AT send      15 "AT+UPSD=0,6,1\r\n"
31.937 AT read OK    6 "\r\nOK\r\n"
31.937 AT send      14 "AT+UPSDA=0,3\r\n"
63.297 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"
63.298 AT send      15 "AT+UPSD=0,6,2\r\n"
63.308 AT read OK    6 "\r\nOK\r\n"
63.308 AT send      14 "AT+UPSDA=0,3\r\n"
94.688 AT read ERR  38 "\r\n+CME ERROR: Service not subscribed\r\n"

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

That’s weird. It looks like APN change didn’t take. If removing both USB and battery power for several seconds don’t resolve the problem, I’m not sure what’s wrong.

Also, I ran into a problem building the fixed cloud debug binary, but since you have it working with screen I guess that’s not a problem now.

Yeah, after a power cycle to the device I still have the same response. If I compile the .cpp with my apn set as the default and flash it I shouldn’t have any incompatibilities with the other aspects of the different system firmware, correct?

Edit: looks like I just need to find CellularHelper.h
Edit2: found the CellularHelper repo, will attempt to compile

Yes, that should work.

Alright, so everything seems to work with the ‘good’ SIM. Here are the logs for a ‘bad’ SIM.

The most relevant issue seems to be:

[ Modem::join ] = = = = = = = = = = = = = = = =
17.953 AT send      12 "AT+CGATT=1\r\n"
17.964 AT read OK    6 "\r\nOK\r\n"
17.964 AT send      14 "AT+UPSND=0,8\r\n"
17.974 AT read  +   17 "\r\n+UPSND: 0,8,0\r\n"
17.984 AT read OK    6 "\r\nOK\r\n"
17.984 AT send      23 "AT+UPSD=0,7,\"0.0.0.0\"\r\n"
17.995 AT read OK    6 "\r\nOK\r\n"
17.995 AT send      24 "AT+UPSD=0,1,\"hologram\"\r\n"
18.006 AT read OK    6 "\r\nOK\r\n"
18.006 AT send      15 "AT+UPSD=0,6,0\r\n"
18.016 AT read OK    6 "\r\nOK\r\n"
18.016 AT send      14 "AT+UPSDA=0,3\r\n"
20.556 AT read ERR  42 "\r\n+CME ERROR: PDP authentication failure\r\n"
20.557 AT send      15 "AT+UPSD=0,6,1\r\n"
20.567 AT read OK    6 "\r\nOK\r\n"
20.567 AT send      14 "AT+UPSDA=0,3\r\n"
24.337 AT read ERR  42 "\r\n+CME ERROR: PDP authentication failure\r\n"
24.338 AT send      15 "AT+UPSD=0,6,2\r\n"
24.348 AT read OK    6 "\r\nOK\r\n"
24.348 AT send      14 "AT+UPSDA=0,3\r\n"
27.868 AT read ERR  42 "\r\n+CME ERROR: PDP authentication failure\r\n"


Here are the full logs:

clouddebug: press letter corresponding to the command
a - enter APN for 3rd-party SIM card
k - set keep-alive value
c - show carriers at this location
t - run normal tests (occurs automatically after 10 seconds)
enter keep-alive value in seconds (typically 30 to 1380):
keepalive will be set to 30
clouddebug: press letter corresponding to the command
a - enter APN for 3rd-party SIM card
k - set keep-alive value
c - show carriers at this location
t - run normal tests (occurs automatically after 10 seconds)
starting tests...
turning cellular on...
deviceID=21003c000b47373130373633
manufacturer=u-blox
model=SARA-U260
firmware version=23.20
ordering code=SARA-U260-00S-01
IMEI=352580080830958
IMSI=u-blox
ICCID=8944502311176184450
0000017569 [app] INFO: enabling trace logging
attempting to connect to the cellular network...
0000017570 [system] INFO: ARM_WLAN_WD 1
0000017570 [system] INFO: ARM_WLAN_WD 1

[ Modem::init ] = = = = = = = = = = = = = = =
17.571 AT send       9 "AT+CGSN\r\n"
17.591 AT read UNK  19 "\r\n352580080830958\r\n"
17.601 AT read OK    6 "\r\nOK\r\n"
17.601 AT send       9 "AT+CGMI\r\n"
17.611 AT read UNK  10 "\r\nu-blox\r\n"
17.621 AT read OK    6 "\r\nOK\r\n"
17.621 AT send       9 "AT+CGMM\r\n"
17.631 AT read UNK  13 "\r\nSARA-U260\r\n"
17.641 AT read OK    6 "\r\nOK\r\n"
17.641 AT send       9 "AT+CGMR\r\n"
17.651 AT read UNK   9 "\r\n23.20\r\n"
17.661 AT read OK    6 "\r\nOK\r\n"
17.661 AT send       9 "AT+CCID\r\n"
17.671 AT read  +   30 "\r\n+CCID: 8944502311176184450\r\n"
17.682 AT read OK    6 "\r\nOK\r\n"
17.682 AT send      11 "AT+UPSV=1\r\n"
17.692 AT read OK    6 "\r\nOK\r\n"
17.692 AT send      11 "AT+CMGF=1\r\n"
17.702 AT read OK    6 "\r\nOK\r\n"
17.702 AT send      13 "AT+CNMI=2,1\r\n"
17.712 AT read OK    6 "\r\nOK\r\n"
17.712 AT send       9 "AT+CIMI\r\n"
17.722 AT read UNK  19 "\r\n234507098618445\r\n"
17.732 AT read OK    6 "\r\nOK\r\n"

[ Modem::register ] = = = = = = = = = = = = = =
17.732 AT send      10 "AT+CREG?\r\n"
17.743 AT read  +   14 "\r\n+CREG: 0,5\r\n"
17.753 AT read OK    6 "\r\nOK\r\n"
17.753 AT send      11 "AT+CGREG?\r\n"
17.763 AT read  +   15 "\r\n+CGREG: 0,5\r\n"
17.773 AT read OK    6 "\r\nOK\r\n"
17.773 AT send      10 "AT+COPS?\r\n"
17.903 AT read  +   27 "\r\n+COPS: 0,0,\"T-Mobile\",2\r\n"
17.913 AT read OK    6 "\r\nOK\r\n"
17.913 AT send       9 "AT+CNUM\r\n"
17.933 AT read OK    6 "\r\nOK\r\n"
17.933 AT send       8 "AT+CSQ\r\n"
17.943 AT read  +   14 "\r\n+CSQ: 12,2\r\n"
17.953 AT read OK    6 "\r\nOK\r\n"

[ Modem::join ] = = = = = = = = = = = = = = = =
17.953 AT send      12 "AT+CGATT=1\r\n"
17.964 AT read OK    6 "\r\nOK\r\n"
17.964 AT send      14 "AT+UPSND=0,8\r\n"
17.974 AT read  +   17 "\r\n+UPSND: 0,8,0\r\n"
17.984 AT read OK    6 "\r\nOK\r\n"
17.984 AT send      23 "AT+UPSD=0,7,\"0.0.0.0\"\r\n"
17.995 AT read OK    6 "\r\nOK\r\n"
17.995 AT send      24 "AT+UPSD=0,1,\"hologram\"\r\n"
18.006 AT read OK    6 "\r\nOK\r\n"
18.006 AT send      15 "AT+UPSD=0,6,0\r\n"
18.016 AT read OK    6 "\r\nOK\r\n"
18.016 AT send      14 "AT+UPSDA=0,3\r\n"
20.556 AT read ERR  42 "\r\n+CME ERROR: PDP authentication failure\r\n"
20.557 AT send      15 "AT+UPSD=0,6,1\r\n"
20.567 AT read OK    6 "\r\nOK\r\n"
20.567 AT send      14 "AT+UPSDA=0,3\r\n"
24.337 AT read ERR  42 "\r\n+CME ERROR: PDP authentication failure\r\n"
24.338 AT send      15 "AT+UPSD=0,6,2\r\n"
24.348 AT read OK    6 "\r\nOK\r\n"
24.348 AT send      14 "AT+UPSDA=0,3\r\n"
27.868 AT read ERR  42 "\r\n+CME ERROR: PDP authentication failure\r\n"

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


I’m still learning about the ins and outs of cellular networking, so I’ll start reading up on what a PDP authentication failure might stem from in this context (where this SIM card works in different device, a cellular hotspot) and pass this on to the SIM card provider for additional information. But if you have any follow on thoughts that come to mind that would be great as well! Thanks for the debug tool, very helpful.

Edit: Based on this post on hologram’s forum, my gut says that it’s an issue with Hologram’s activation of the new devices at the carrier level, so waiting to hear back from them and will confirm here if that ends up being the case, though it’s still strange that it worked on the other device.

i also had similar issues when using hologram. then i learned that, at the particular time [not sure if it is still true today] hologram & particle, the companies, had some problems with each other. they really, again, at the time, did not like each other. so i dropped my attempts to use hologram sims. if you do a search on hologram i’m sure that some of the info is there, unless someone did a private message to me about it. anyway, at&t sims worked great for me until i decided to get out of the electron thing altogether. i’m hoping the new cellular devices later this year show some advances in the particle cellular situation. good luck.

1 Like

FYI to future readers - turned out that hologram (the SIM provider) had an outage at the time when I registered and activated those particular SIMs. They haven’t determined the root cause, but it appears to definitely be outside of the scope of the Electron. Cheers, and thanks again for the diagnostic tools above, super helpful!

1 Like

Dear,

I’m from Chile and I have a very similar issue here. We used to use a third party SIM from a Virtual Operator that use the Movistar Network in Chile (The same network that use the Particle SIMs here). A few days ago we started to have problems. If we see the device vitals there was several disconnect event and poor cellular signal. We change the third party SIM to a mobile phone and works perfect, then we put a Particle SIM on the Electron (remember that Particle uses the same Network) and it works perfectly, with zero disconnect event and showing good signal. I’m working with Electron 3G version and the firmware 1.0.1.

Does anyone have similar issues with any other third party provider?

Thanks

Is your SIM 3G-locked only? If not the mobile phone is probably using 4G, which is entirely different when it comes to signal strength. Additionally, a mobile phone’s modem and antenna may give access to different bands and thus stronger possible signals.

In general mobile phones are very poor predictors of IoT cellular connectivity on 3G.

Further, “several” disconnections is a very normal thing. Devices will naturally disconnect from time to time. How are you measuring performance on the mobile phone? How certain are you that the phone is never disconnecting?

The primary difference between the Particle SIM and a Third-Party SIM is the keep-alive interval. The particle sim has a 30min keep alive interval, but most third party sims have one in the range of 30sec to a few minutes. If you are not setting the proper keep alive interval your device will disconnect due to it timing out

1 Like

Yes, the SIM is 2G/3G-locked, it doesn’t work in 4G. I set Particle.keepAlive(20); is that ok?

20 seconds should work fine, though is probably not fully optimized for data usage.

If your issue is present with a proper keepAlive interval, you should follow up with your MVNO to investigate possible issues. A difference between SIM cards (apart from keep alive intervals) is not really something Particle has control over, and third party sims on the Electron have been reliable in my experience.