Issue with connection with specific SIM Card | Telit Cinterion IoT Developer Community
December 30, 2021 - 9:20pm, 5385 views
Hi,
I have one issue with a specific scenario here with the APP I developed.
The app basically executes these steps:
1 - setup the connection via AT commands;
2 - execute a Ping test to validate the connection;
3 - initalize the DSS qapi connection;
4 - starts the DSS qapi via qapi_Start_Datacall();
5 - starts the MQTT Qapi connection;
6 - starts the publish/subscribe;
I have two different SIM Cards at hand here:
1 - SIM Card A: which is from an IoT Broker;
2 - SIM Card B: which is my personal smartphone sim card.
The issue:
If I use the SIM Card A, my APP works up to step (4) above.
If I use the SIM Card B, my APP works fine until step (6) above.
Looking at the source code, it is returining the NOCONN state when using QAPI functions.
The code is very similar to the one in SDK/examples/mqtt/mqtt.c in the steps about how to start a data call using the QAPI DSS functions.
The callback when the DSS is started is informing that there is NOCONN, although the AT commands are telling me that the APP is working fine (and pinging to 8.8.8.8 google).
Here are the logs when I run the APP using SIM Card A:
0:00:13:284 CRIT:dss.c,661: (((dss_init)))
00:00:13:287 CRIT:dss.c,143: dss_apn_install)--->
]0:00:13:289 CRIT:at_hdl.c,106: writting 26, =[AT^SGAUTH=1,1,******,*****
00:00:13:301 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:13:303 CRIT:at_hdl.c,146: @@@ MATCH
]0:00:13:306 CRIT:at_hdl.c,106: writting 41, =[AT+CGDCONT=1,"IPV4V6","******"
00:00:13:316 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:13:318 CRIT:at_hdl.c,146: @@@ MATCH
]0:00:13:320 CRIT:at_hdl.c,106: writting 24, =[AT^SGAUTH=2,1,*****,******
00:00:13:331 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:13:333 CRIT:at_hdl.c,146: @@@ MATCH
]0:00:13:335 CRIT:at_hdl.c,106: writting 40, =[AT+CGDCONT=2,"IPV4V6","******X"
00:00:13:345 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:13:347 CRIT:at_hdl.c,146: @@@ MATCH
]0:00:13:351 CRIT:at_hdl.c,106: writting 14, =[AT^SXRAT=12,7
00:00:13:378 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:13:381 CRIT:at_hdl.c,146: @@@ MATCH
00:00:13:383 CRIT:dss.c,574: dss_init_autoconnect)--->
]0:00:13:412 CRIT:at_hdl.c,106: writting 10, =[AT+COPS=2
00:00:13:956 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:13:959 CRIT:at_hdl.c,146: @@@ MATCH
]0:00:13:961 CRIT:at_hdl.c,106: writting 14, =[AT^SXRAT=12,7
00:00:13:987 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:13:989 CRIT:at_hdl.c,146: @@@ MATCH
00:00:13:991 CRIT:dss.c,366: dss_cops_zero)--->
]0:00:13:994 CRIT:at_hdl.c,106: writting 10, =[AT+COPS=0
00:00:15:375 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:15:377 CRIT:at_hdl.c,146: @@@ MATCH
00:00:15:379 CRIT:dss.c,515: dss_smoni)--->
]0:00:15:382 CRIT:at_hdl.c,106: writting 9, =[AT^SMONI
00:00:15:506 CRIT:at_hdl.c,138: Received 81, =[
^SMONI: Cat.M1,9610,28,-,FDD,******X,******,******,******,******,--,-78,-10,CONN,-4
OK
]
00:00:15:508 CRIT:at_hdl.c,146: @@@ MATCH
00:00:15:510 CRIT:dss.c,425: dss_smoni_parse_status)--->
00:00:15:513 CRIT:dss.c,446: STATE CONN CAT M1
00:00:15:515 CRIT:dss.c,475: CONN ANCHOR
00:00:15:517 CRIT:dss.c,279: dss_sica)--->
]0:00:15:519 CRIT:at_hdl.c,106: writting 12, =[AT^SICA=1,1
00:00:17:548 CRIT:at_hdl.c,138: Received 6, =[
OK
]
00:00:17:551 CRIT:at_hdl.c,146: @@@ MATCH
00:00:17:553 CRIT:dss.c,610: .
00:00:17:555 CRIT:dss.c,317: dss_ping)--->
]0:00:20:585 CRIT:at_hdl.c,106: writting 34, =[AT^SISX="Ping",1,"8.8.8.8",1,5000
00:00:20:690 CRIT:at_hdl.c,138: Received 95, =[
^SISX: "Ping",1,1,"8.8.8.8",93
^SISX: "Ping",2,1,1,1,0,0
^SISX: "Ping",3,1,93,93,93
OK
]
00:00:20:692 CRIT:at_hdl.c,146: @@@ MATCH
00:00:20:695 CRIT:dss.c,617: .
00:00:20:697 CRIT:dss.c,627: dss_netctrl_init)--->
00:00:20:699 CRIT:dss.c,171: dss_set_pdp_params)--->
00:00:20:702 CRIT:mod.c,106: (((STATE DSS CONNECT)))
00:00:20:704 CRIT:dss.c,699: dss_start_datacall)--->
00:00:20:711 CRIT:mod.c,149: (((STATE CHECK EVENTS)))
00:00:20:788 CRIT:dss.c,50: FLAG SET CONN_SIG_EVT_NOCONN_EVENT
00:00:20:788 CRIT:dss.c,53: Event IS NO NET
00:00:20:795 CRIT:events.c,55: NOCONN_EVENT
00:00:20:797 CRIT:mod.c,115: (((STATE DSS FAILED CONNECT)))
00:00:20:799 CRIT:dss.c,712: dss_stop_datacall)--->
You should be able to delete the entry for a certain <cid> with AT+CGDCONT=<cid> command.
CID1 is special as it is used to establish LTE connection. It can be auto-configured by the network or preconfigured manually. In LTE you usually use this context for user data. But it could be possible to also set up another context to a different APN or it could be required by some networks to use a separate context for user data.
In your recent log pinging test.mosquitto.org was successful while 191.34.181.156 failed. Then you tried mqtt to 191.34.181.156 and it also failed. Did you try mqtt from the module to test.mosquitto.org? Is 191.34.181.156 your own mqtt broker? Based on your output it looks like the broker recognized the client ID "6666123" so the connection was established but maybe it is a matter of some configuration. But the initial problem was that mqtt via application wasn't possible with SIM Card A as I remember.
Hi,
In your recent log pinging test.mosquitto.org was successful while 191.34.181.156 failed. Then you tried mqtt to 191.34.181.156 and it also failed. Did you try mqtt from the module to test.mosquitto.org?
>>> Yes, I tried to MQTT connect to test.mosquitto.org and it returns the same error message:
Is 191.34.181.156 your own mqtt broker?
>>> Yes, this IP is my own MQTT broker running. And I could make sure that it is reachable outside my intra-network.
Based on your output it looks like the broker recognized the client ID "6666123" so the connection was established but maybe it is a matter of some configuration. But the initial problem was that mqtt via application wasn't possible with SIM Card A as I remember.
>>> Yes, this post has grown quite a lot since the original question. So, all the investigations were not conclusive yet.
So, could you share a step-by-step AT commands to connect to "test.mosquitto.org"? So, I can use this baseline to run in both SIM Card A and SIM Card B, so we can make sure at which state we are on.
I tried to connect to test.mosquitto.org:1883 with AT commands but got the same reply as you. Then I tried the same with broker.hivemq.com:1883 and it worked.
I checked the pcap trace and test.mosquitto.org replied:
Return Code: Connection Refused: identifier rejected (2)
while broker.hivemq.com replied:
Return Code: Connection Accepted (0)
BARTŁOMIEJ GEMA... I've refactored some part of the code that handles the connection, and the issue was that in the qapi code part, I was configuring the APN with a hard-coded value that SIM Card A wouldn't work.
So, now it has been fixed and both SIM Cards are working fine.
Thank you for the support and help so far.
Hello,
Thank you for the summary.
Best regards,
Bartłomiej