BG95-M3 . wrong CEREG-State after toggle SIM at provider onomondo

The following problem can be reproduced in different firmware versions (i tested it with FW .200 / .201 / .204 and finally with BG95M3LAR02A03_A0.206.A0.206):
We use chipSIM cards from onomondo. If we want to provoke a network change, I have to change the network whitelist in onomondo and switch the SIM off and on again.

Initial situation: the MODEM is online in LTE-M and MQTT is connected. If I deactivate the SIM card in onomondo, CEREG=3 is reported, and immediately afterwards CEREG=5. But, according to Onomondo, the device is no longer connected.
If I query CEREG?, CEREG=5 is still reported. CREG? returns CREG=2. If I query the available networks with AT+QCOPS=2, I get no response. Only a further query after 5 minutes returns “No Service”
The MODEM cannot get out of this status on its own. Only with CFUN=0 and CFUN=1 does it start searching for networks again and a new connection is possible.

here are some (reduced) logs:

(18:23:03.219) BG95: TX(6ms): AT+QMTPUB=1,1,1,0,"bsiot/client/data/motion/--string-removed--",89<CR><LF>
(18:23:03.219) BG95: RX: AT+QMTPUB=1,1,1,0,"bsiot/client/data/motion/--string-removed--",89<CR><LF>
(18:23:03.219) BG95: RX: ><CR><LF>
(18:23:03.219) <CR><LF>
(18:23:03.219) BG95: TX(9ms): {"accX":-157,"accY":464,"accZ":9901,"angX":-305,"angY":-290,"angZ":183,"timestamp":32347}<CR><LF>
(18:23:03.219) BG95: RX:  {"accX":-157,"accY":464,"accZ":9901,"angX":-305,"angY":-290,"angZ":183,"timestamp":32347}<CR><LF>
(18:23:03.219) BG95: RX: OK<CR><LF>
(18:23:03.423) BG95: RX: +QMTPUB: 1,1,0<CR><LF>
(18:23:03.423) LPWA: MQTT Publish status is 1<CR><LF>
(18:23:03.423) BG95: Enter Sleep Mode<CR><LF>
(18:24:00.602) BG95: RX: +CEREG: 3<CR><LF>
(18:24:00.602) BG95: RX: +QIURC: "pdpdeact",1<CR><LF>
(18:24:00.685) BG95: RX: +QMTSTAT: 1,1<CR><LF>
(18:24:00.685) LPWA: Active State: ACTIVE MQTT. Received URC QMTSTAT 1<CR><LF>
(18:24:00.685) BG95: Exit Sleep Mode<CR><LF>
(18:24:00.685) <CR><LF>
(18:24:00.685) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:24:00.685) BG95: RX: AT+CGMI=?<CR><LF>
(18:24:00.685) BG95: RX: OK<CR><LF>
(18:24:00.685) <CR><LF>
(18:24:00.685) BG95: TX(1ms): AT+QMTCONN?<CR><LF>
(18:24:00.685) BG95: RX: AT+QMTCONN?<CR><LF>
(18:24:00.685) BG95: RX: OK<CR><LF>
(18:24:00.685) LPWA: MQTT is not connected. So, Open and Connect to MQTT<CR><LF>
(18:24:00.685) BG95: Enter Sleep Mode<CR><LF>
(18:24:00.685) LPWA: Enter State: SETUP MQTT<CR><LF>
(18:24:00.767) BG95: RX: +CEREG: 5<CR><LF>
(18:24:00.767) LPWA: Event 26 ignored, State: SETUP MQTT<CR><LF>
(18:24:32.847) lpwa send AT+CFUN?<CR><LF>
(18:24:33.169) BG95: Exit Sleep Mode<CR><LF>
(18:24:33.169) CLI: Command succeed!<CR><LF>
(18:24:33.169) <CR><LF>
(18:24:33.169) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:24:33.169) BG95: RX: AT+CGMI=?<CR><LF>
(18:24:33.169) BG95: RX: OK<CR><LF>
(18:24:33.169) <CR><LF>
(18:24:33.169) BG95: TX(1ms): AT+CFUN?<CR><LF>
(18:24:33.169) BG95: Enter Sleep Mode<CR><LF>
(18:24:33.169) BG95: RX: AT+CFUN?<CR><LF>
(18:24:33.169) BG95: RX: +CFUN: 1<CR><LF>
(18:24:33.169) BG95: RX: OK<CR><LF>
(18:24:38.300) lpwa send AT+CREG?<CR><LF>
(18:24:38.585) BG95: Exit Sleep Mode<CR><LF>
(18:24:38.585) CLI: Command succeed!<CR><LF>
(18:24:38.585) <CR><LF>
(18:24:38.585) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:24:38.585) BG95: RX: AT+CGMI=?<CR><LF>
(18:24:38.585) BG95: RX: OK<CR><LF>
(18:24:38.585) <CR><LF>
(18:24:38.585) BG95: TX(1ms): AT+CREG?<CR><LF>
(18:24:38.585) BG95: Enter Sleep Mode<CR><LF>
(18:24:38.585) BG95: RX: AT+CREG?<CR><LF>
(18:24:38.585) BG95: RX: +CREG: 0,2<CR><LF>
(18:24:38.585) BG95: RX: OK<CR><LF>
(18:24:42.901) lpwa send AT+CEREG?<CR><LF>
(18:24:43.254) BG95: Exit Sleep Mode<CR><LF>
(18:24:43.254) CLI: Command succeed!<CR><LF>
(18:24:43.254) <CR><LF>
(18:24:43.254) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:24:43.254) BG95: RX: AT+CGMI=?<CR><LF>
(18:24:43.254) BG95: RX: OK<CR><LF>
(18:24:43.254) <CR><LF>
(18:24:43.254) BG95: TX(1ms): AT+CEREG?<CR><LF>
(18:24:43.254) BG95: Enter Sleep Mode<CR><LF>
(18:24:43.254) BG95: RX: AT+CEREG?<CR><LF>
(18:24:43.254) BG95: RX: +CEREG: 1,5<CR><LF>
(18:24:43.254) LPWA: Event 26 ignored, State: SETUP MQTT<CR><LF>
(18:24:43.254) BG95: RX: OK<CR><LF>
(18:24:53.291) lpwa send AT+QNWINFO<CR><LF>
(18:24:53.547) CLI: Command succeed!<CR><LF>
(18:24:53.547) BG95: Exit Sleep Mode<CR><LF>
(18:24:53.547) <CR><LF>
(18:24:53.547) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:24:53.547) BG95: RX: AT+CGMI=?<CR><LF>
(18:24:53.547) BG95: RX: OK<CR><LF>
(18:24:53.547) <CR><LF>
(18:24:53.547) BG95: TX(1ms): AT+QNWINFO<CR><LF>
(18:24:53.547) BG95: Enter Sleep Mode<CR><LF>
(18:24:53.547) BG95: RX: AT+QNWINFO<CR><LF>
(18:24:53.547) BG95: RX: +QNWINFO: "eMTC","26203","LTE BAND 20",6200<CR><LF>
(18:24:53.547) BG95: RX: OK<CR><LF>
(18:24:55.399) LPWA: MQTT connection state is NOT CONNECTED<CR><LF>
(18:24:55.399) ERROR: [0x2501] dcp publish failed<CR><LF>
(18:25:03.824) lpwa send AT+CSQ?<CR><LF>
(18:25:04.121) BG95: Exit Sleep Mode<CR><LF>
(18:25:04.121) CLI: Command succeed!<CR><LF>
(18:25:04.121) <CR><LF>
(18:25:04.121) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:25:04.121) BG95: RX: AT+CGMI=?<CR><LF>
(18:25:04.121) BG95: RX: OK<CR><LF>
(18:25:04.121) <CR><LF>
(18:25:04.121) BG95: TX(1ms): AT+CSQ?<CR><LF>
(18:25:04.121) BG95: Enter Sleep Mode<CR><LF>
(18:25:04.121) BG95: RX: AT+CSQ?<CR><LF>
(18:25:04.121) BG95: RX: +CME ERROR: 3<CR><LF>
(18:25:06.986) lpwa send AT+CSQ<CR><LF>
(18:25:07.291) CLI: Command succeed!<CR><LF>
(18:25:07.291) BG95: Exit Sleep Mode<CR><LF>
(18:25:07.291) <CR><LF>
(18:25:07.291) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:25:07.291) BG95: RX: AT+CGMI=?<CR><LF>
(18:25:07.291) BG95: RX: OK<CR><LF>
(18:25:07.291) <CR><LF>
(18:25:07.291) BG95: TX(0ms): AT+CSQ<CR><LF>
(18:25:07.291) BG95: Enter Sleep Mode<CR><LF>
(18:25:07.291) BG95: RX: AT+CSQ<CR><LF>
(18:25:07.291) BG95: RX: +CSQ: 19,99<CR><LF>
(18:25:07.291) BG95: RX: OK<CR><LF>
(18:25:26.957) lpwa send AT+QCOPS=2<CR><LF>
(18:25:27.272) CLI: Command succeed!<CR><LF>
(18:25:27.272) BG95: Exit Sleep Mode<CR><LF>
(18:25:27.272) <CR><LF>
(18:25:27.272) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:25:27.272) BG95: RX: AT+CGMI=?<CR><LF>
(18:25:27.272) BG95: RX: OK<CR><LF>
(18:25:27.272) <CR><LF>
(18:25:27.272) BG95: TX(1ms): AT+QCOPS=2<CR><LF>
(18:25:27.272) BG95: Enter Sleep Mode<CR><LF>
(18:25:27.272) BG95: RX: AT+QCOPS=2<CR><LF>
(18:25:27.272) BG95: RX: OK<CR><LF>
(18:32:04.206) lpwa send AT+QCOPS=2<CR><LF>
(18:32:04.545) BG95: Exit Sleep Mode<CR><LF>
(18:32:04.545) CLI: Command succeed!<CR><LF>
(18:32:04.545) <CR><LF>
(18:32:04.545) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:32:04.545) BG95: RX: AT+CGMI=?<CR><LF>
(18:32:04.545) BG95: RX: OK<CR><LF>
(18:32:04.545) BG95: RX: +QCOPS: No Service<CR><LF>
(18:32:04.545) <CR><LF>
(18:32:04.545) BG95: TX(1ms): AT+QCOPS=2<CR><LF>
(18:32:04.545) BG95: Enter Sleep Mode<CR><LF>
(18:32:04.545) BG95: RX: AT+QCOPS=2<CR><LF>
(18:32:04.545) BG95: RX: OK<CR><LF>
(18:32:04.545) BG95: RX: +QCOPS: No Service<CR><LF>
(18:38:42.345) lpwa send AT+CEREG?<CR><LF>
(18:38:42.630) BG95: Exit Sleep Mode<CR><LF>
(18:38:42.630) CLI: Command succeed!<CR><LF>
(18:38:42.630) <CR><LF>
(18:38:42.630) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:38:42.630) BG95: RX: AT+CGMI=?<CR><LF>
(18:38:42.630) BG95: RX: OK<CR><LF>
(18:38:42.630) <CR><LF>
(18:38:42.630) BG95: TX(1ms): AT+CEREG?<CR><LF>
(18:38:42.630) BG95: Enter Sleep Mode<CR><LF>
(18:38:42.630) BG95: RX: AT+CEREG?<CR><LF>
(18:38:42.630) BG95: RX: +CEREG: 1,5<CR><LF>
(18:38:42.630) LPWA: Event 26 ignored, State: SETUP MQTT<CR><LF>
(18:38:42.630) BG95: RX: OK<CR><LF>
(18:38:49.019) lpwa send AT+QNWINFO<CR><LF>
(18:38:49.302) CLI: Command succeed!<CR><LF>
(18:38:49.302) BG95: Exit Sleep Mode<CR><LF>
(18:38:49.302) <CR><LF>
(18:38:49.302) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:38:49.302) BG95: RX: AT+CGMI=?<CR><LF>
(18:38:49.302) BG95: RX: OK<CR><LF>
(18:38:49.302) <CR><LF>
(18:38:49.302) BG95: TX(1ms): AT+QNWINFO<CR><LF>
(18:38:49.302) BG95: Enter Sleep Mode<CR><LF>
(18:38:49.302) BG95: RX: AT+QNWINFO<CR><LF>
(18:38:49.302) BG95: RX: +QNWINFO: "eMTC","26203","LTE BAND 20",6200<CR><LF>
(18:38:49.302) BG95: RX: OK<CR><LF>

Sorry I do not understand if the SIM card is deactive or just derigister network from onomondo. Could you please provide me the modem log so that I can analyse clearly?

Hi @mikey
There are two reasons why the SIM is deactivated in onomondo:

  1. Example: Our device uses the Telekom network in the Czech Republic. However, it turns out that this network has problems in the region in which the device is located. We now have the option of banning this network via onomondo and only allowing the SIM to use other networks. We can also ban the SIM from using 4G networks (for example because Vodafone’s LTE-M is not working correctly).
    If we make these settings in onomondo, the active connection must be disconnected. This can be achieved by temporarily deactivating and then activating the SIM.
  2. Example: There is a fault and onomondo initially blocks all SIMs in order to prevent an overload of registrations after the error has been resolved.

Could you please provide me the modem log so that I can analyse clearly?

What kind of log do you need here? Should I create a QWINlog? If so, with which version and which settings.

Thanks for your sharing and your issue is clear to me.
And yes you need to use QWinlog just the default config is ok and start with CFUN 0/1 untill to the issue appear and then send this log to me.
image

You need to enable the log output through this command firstly.
image

I have receiced your log and I will analyse later.

Hi Daniel, I check your log and I can see it is roaming register on a LTE-M network at first. And then it is limited on this network. Maybe it’s due to deactivate the SIM card and roaming service not activated, so it is not register now actually.

Here again the excerpt from the above log:

(18:24:00.602) BG95: RX: +CEREG: 3<CR><LF>
(18:24:00.602) BG95: RX: +QIURC: "pdpdeact",1<CR><LF>
(18:24:00.685) BG95: RX: +QMTSTAT: 1,1<CR><LF>
(18:24:00.685) LPWA: Active State: ACTIVE MQTT. Received URC QMTSTAT 1<CR><LF>
(18:24:00.685) BG95: Exit Sleep Mode<CR><LF>
(18:24:00.685) <CR><LF>
(18:24:00.685) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:24:00.685) BG95: RX: AT+CGMI=?<CR><LF>
(18:24:00.685) BG95: RX: OK<CR><LF>
(18:24:00.685) <CR><LF>
(18:24:00.685) BG95: TX(1ms): AT+QMTCONN?<CR><LF>
(18:24:00.685) BG95: RX: AT+QMTCONN?<CR><LF>
(18:24:00.685) BG95: RX: OK<CR><LF>
(18:24:00.685) LPWA: MQTT is not connected. So, Open and Connect to MQTT<CR><LF>
(18:24:00.685) BG95: Enter Sleep Mode<CR><LF>
(18:24:00.685) LPWA: Enter State: SETUP MQTT<CR><LF>
(18:24:00.767) BG95: RX: +CEREG: 5<CR><LF>

The problem is that a CEREG=3 comes up and then a CEREG=5. At this point, however, the SIM is definitely still deactivated! Even if I then activate the SIM again, there are no further connection attempts (I can see this in the logs at onomondo). The MODEM then appears to be in an undefined state.
I can happily create another log (but not until Monday) that will be more comprehensive. So:

  • SIM is online
  • Send data
  • Deactivate SIM
  • Activate SIM
  • Try to initiate a connection manually
  • send some AT-commands like AT+QNWINFO, AT+QCSQ, AT+QCOPS
    – If this helps with the analysis: Please tell me any other commands I can send here before I stop logging

Here again from the log above. This isn’t actually possible!? AT+QCOPS=2 responds with +QCOPS: No Service, but AT+CEREG? responds with +CEREG: 1.5

(18:32:04.545) BG95: RX: AT+QCOPS=2<CR><LF>
(18:32:04.545) BG95: RX: OK<CR><LF>
(18:32:04.545) BG95: RX: +QCOPS: No Service<CR><LF>
(18:38:42.345) lpwa send AT+CEREG?<CR><LF>
(18:38:42.630) BG95: Exit Sleep Mode<CR><LF>
(18:38:42.630) CLI: Command succeed!<CR><LF>
(18:38:42.630) <CR><LF>
(18:38:42.630) BG95: TX(1ms): AT+CGMI=?<CR><LF>
(18:38:42.630) BG95: RX: AT+CGMI=?<CR><LF>
(18:38:42.630) BG95: RX: OK<CR><LF>
(18:38:42.630) <CR><LF>
(18:38:42.630) BG95: TX(1ms): AT+CEREG?<CR><LF>
(18:38:42.630) BG95: Enter Sleep Mode<CR><LF>
(18:38:42.630) BG95: RX: AT+CEREG?<CR><LF>
(18:38:42.630) BG95: RX: +CEREG: 1,5<CR><LF>

Hi @mikey,
I sent you a larger log file