ESH6 TCP VS UDP Socket Connection | Telit Cinterion IoT Developer Community
April 17, 2020 - 10:49pm, 7971 views
I am facing one strange issue on TCP Socket connection. With TCP connection my data sent success rate is only 50 percent. Basically the device is unable to send data to the server using TCP Socket. However, as soon as i change the port to UDP it sends data to the server.
Could u Please verify the commands?
TCP Connection
AT^SICS?
^SICS: 0,"conType","GPRS0"
^SICS: 0,"apn","iot.aer.net"
^SICS: 1,"conType",""
^SICS: 2,"conType",""
^SICS: 3,"conType",""
^SICS: 4,"conType",""
^SICS: 5,"conType",""
OK
AT^SCFG="Tcp/WithURCs","on"
^SCFG: "Tcp/WithURCs","on"
OK
AT^SISS=0,srvType,"Socket"
OK
AT^SISS=0,conId,0
OK
AT^SCFG="Gpio/mode/RING0","std"
^SCFG: "Gpio/mode/RING0","std"
OK
AT^SCFG="URC/Ringline","asc0"
^SCFG: "URC/Ringline","asc0"
OK
AT^SCFG="MEShutdown/sVsup/threshold","-4"
^SCFG: "MEShutdown/sVsup/threshold","-4","-4"
OK
AT^SISS=0,address,"socktcp://xx.xx.xx.xx:30000"
OK
AT^SISO=0
OK
AT^SISC=0
OK
UDP Commands
AT^SICS?
^SICS: 0,"conType","GPRS0"
^SICS: 0,"apn","iot.aer.net"
^SICS: 1,"conType",""
^SICS: 2,"conType",""
^SICS: 3,"conType",""
^SICS: 4,"conType",""
^SICS: 5,"conType",""
OK
AT^SCFG="Tcp/WithURCs","on"
^SCFG: "Tcp/WithURCs","on"
OK
AT^SISS=0,srvType,"Socket"
OK
AT^SISS=0,conId,0
OK
AT^SCFG="Gpio/mode/RING0","std"
^SCFG: "Gpio/mode/RING0","std"
OK
AT^SCFG="URC/Ringline","asc0"
^SCFG: "URC/Ringline","asc0"
OK
AT^SCFG="MEShutdown/sVsup/threshold","-4"
^SCFG: "MEShutdown/sVsup/threshold","-4","-4"
OK
AT^SISS=0,address,"sockudp://xx.xx.xx.xx:30003"
OK
AT^SISO=0
OK
^SISW: 0,1
AT^SISW=0,63
^SISW: 0,63,0
OK
With the UDP success rate is 100 percent and at the Server side there is no difference. I mean the port is open.
Hello,
The SMONI reply shows that the signal quality is rather poor. Generally '+CME ERROR: operation temporary not allowed' is something that can happen but from your description I understand that it happens always or almost always which seems strange. Does AT+COPS=? return some networks at that time? Do you use only one module for your tests or have more that behave the same? Please also check in AT^SCFG? output if all the bands are enabled. When I try with my module it works. COPS 2 and 0 execution involves some netowrk communication so it can take a while sometimes to execute.
I see that you switch AutoAttach during your tests. Please note that the automatic attach works only on power-up and network registration.
Regards,
Bartłomiej
Hi Bartłomiej,
Here are my observations:
1. COPS=0 gives error when AT+COPS? is giving 2 means deregistered. When AT+COPS? Returns
+COPS: 0,0,"T-Mobile",2. It gives Ok on COPS=0. So, it means we can't configure COPS - when it is not getting any operator.
Note: I don't understand what is causing it to deregister. As we are not calling COPS=2 in our code.
2. Regarding AutoAttach - As per your suggestion on PDP failed or PDP error. We are trying manually GPRS attach and detach. After using network registration (CREG=0 or CREG?) we are trying to attach and detaching before going to sleep. (Problem statement: Once TCP returns PDP fails it remains in the same loop until we reboot the GSM)
Note: CGATT or AutoAttach looks the same to us. So, we have added autoattach command.
Hello,
1. If you are registered to the network (AT+COPS? returns +COPS: 0,0,"T-Mobile",2) AT+COPS=0 returns OK, because probably module does not have to do anything - you are already registered to the network. If COPS shows dergistered state, you cannot register even manually with AT+COPS=0. I think the reason that module cannot register neither automatically nor manually can be exactly the same (poor network condition or wrong SIM configuration). In my opinion it would be worth to check the behavior not only in good network conditions but also using completely different SIM card / network operator. You can also check with 'AT+COPS=?' other available network and manually try to force the registration to the network other than T-Mobile.
Even if you don'y use AT+COPS=2, the network itself can force deregistration (e.g. due to the bad signal quality).
2. CGATT=1 command ***** to be sent explicitly to perform an attach. When AutoAttach paremeter is enabled, module will perform attach procedure automatically after power up and registration to the network.
About PDP context fail, 'AT+CEER' command maybe will print additional info about the root cause. Please send 'AT+CEER=0' before the test and 'AT+CEER' after you get PDP context fail.
One more thing - I can see you use APN 'iot.aer.net', but according to this page:
https://www.aeris.com/neo/support/get-started/program-device-apn/
it should be use for LTE Service. EHS6 is 2G/3G module so please try with APN 'neo.iot.net'.
Best regards,
Adam
Hi Adam,
1. That makes sense - So there is no point of using cops=0 command then. As if it is deregistered from the network then it will take some time to come online. Its working fine now.
2. Looks like on Aeris portal it shows session is still open although we have hit SISC=0 command and put gsm to sleep using SPOW=2,100,3.
We have received customized sims and that works perfectly fine with 'iot.aer.net' apn with 4G/3G/2G services. If APN was wrong then it would never have established the successful TCP Session.
Hello,
about point 2: SISC=0 will close remote connection to host, and terminate all internet service actions on modem except for network layer (PDP context will remain active) for a set period. Default value is 20s (network can sometimes overwrite it) and it can be configured with AT^SICS="inactTO"
Best Regards
Tymek
Hi Tymek,
Thanks it worked for me. I have one more doubt regarding SICS configuration command. Sometimes we are getting errors on these two commands while setting up an internet profile. The module remains in the state until we reboot it. Do you know the reason of getting error at these commands? We are hitting this command when we are waking up from the sleep state of the Gemalto module. At this point, registration(CREG) and network selection(COPS) are working fine.
[2020-08-20 09:18:36.254] AT^SICS=0,"conType","GPRS0"
[2020-08-20 09:18:36.543] ERROR
[2020-08-20 09:18:36.702] AT^SICS=0,"apn","iot.aer.net"
[2020-08-20 09:18:37.390] ERROR
Hello,
Please send AT+CMEE=2 before the test to see additional error descriptions if available.
Please also make sure that all the pending connections were closed with AT^SISC command.
Regards,
Bartłomiej