ESH6 TCP VS UDP Socket Connection | Telit Cinterion IoT Developer Community
April 17, 2020 - 10:49pm, 7969 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,
SISC closes the connection. It should always be called if SISO was used to open the connection even if there was an error during the connection. So if you get 'operation temporary not allowed' after calling SISC on the same profile, there may be other reason then not closed connection. That's why I suggested a test with using some other SISS profile for test if some other connection can work. It is worth reading AT^SISO? output to verify the status of each connection, checking if the module is registered to the network or if there is something returned by AT^SISE=<srvProfileId> command or there is some general packed domain connection error readable with AT+CEER.
Regards,
Bartłomiej
Hi Bartłomiej,
Yes, i have tried with SISS profile 0 (Socket) and 1 (transparent) - Same behavior.
Hello,
So if the error occurs you try with another profile and it also fails. It works again after some time or you reboot and it works after that.
As the network quality is not good it is worth monitoring (especially if the device is moving). Maybe it could work better with some other operator or server. At least it's worth testing.
Regards,
Bartłomiej
Hi Bartłomiej,
After testing it for a while, I come to the conclusion that EHS6 is saving some module states in its memory.
Here are my Observations:
1. Even when module is in a good network condition, some***** it stuck in the same state: After opening the pdp session it consistently gives the error on SISO=0 command.
AT^SISC=0
OK
AT^SISS=0,address,"socktcp://xx.xx.***.xx:30000"
OK
AT^SISO=0
+CME ERROR: operation not allowed
AT^SISC=0
OK
AT^SPOW=2,1000,3 //Putting it in the sleep state to save power
OK
Ehs6 never comes out of this state until we reboot
2. Some ***** it stuck at registrations state also; when ehs6 is unable to register to the network - even on the good network condition.
AT^SPOW=1,0,0
OK
ATE1
OK
AT+CMEE=2
OK
AT+CFUN?
+CFUN: 1,0
OK
AT+CFUN=1
OK
AT+CMGF=1
OK
AT+COPS?
+COPS: 0,0,"T-Mobile",2
OK
AT+CREG=0
OK
AT+CGSN
357042065409675
OK
AT+CREG?
+CREG: 0,0
OK
AT+CSDH=1
OK
AT+CREG?
+CREG: 0,0
OK
AT+CREG?
+CREG: 0,0
OK
AT+CREG?
+CREG: 0,0
OK
AT+CREG?
+CREG: 0,2
OK
AT+CREG?
+CREG: 0,2
OK
AT+CREG?
+CREG: 0,2
OK
We are using roaming sims but the network is actually good as they are global sims.
Can you please help us how to solve this problem?
Hello,
Operation not allowed suggests some incorrect state or configuration. So if you haven't changed anything besides the address it should be possible to connect again. And is it possible to open any other connection on some other profile? Have you tried to send AT^SISE=<srvProfileId> or AT+CMEE or to register some indicators with AT^SIND like "psinfo" or "service"?
You could try if GPRS detach or network deregistration can help here or not.
As for the SPOW you need hardware flow cotrol enabled and RTS/CTS lines connected to be able to communicate in power saving mode.
I would say that the network registration issue is probably somehow related to the operator and roaming. But it can be hard to debug without tracing the module. You can check AT+CMEE if there's any error information. Does it finally register or does network deregistration and registration or reboot help in such a case or not?
If it's a frequent problem you may consider changing the provider. Or reporting it to Thales support system or your technical sales or distributor if you suspect that the module may be to blame.
Regards,
Bartłomiej
Hi Bartłomiej,
Sometimes a reboot helps and sometimes it remains in the same state - Unable to register on the roaming network. Now after closing/disconnecting the PDP session we are detaching from GPRS (at+cgatt=0).
Your suggestion for network deregistration helps in getting TOW information if MCC and MNC is changed. But Sim registration is still behaving the same.
In addition, to the above response at+cops (for automatic network search) is giving ERROR or Operation not allowed. Do we have to follow and sequence for hitting successful COPS COMMAND?
AT+COPS=0
+CME ERROR: operation temporary not allowed
AT+COPS=0
ERROR
Please try AT+COPS=2 before. Does it happen after rboot also?
Yes, when we reboot the GSM or wake up GSM from the sleep. AT+COPS=2 - This command is also giving me an error. Is there is any reason for getting Error on COPS command configuration?
Logs after reboot:
þÿ
^SYSLOADING
^SYSSTART
+PBREADY
ATE1
OK
ATI1
Cinterion
EHS6
REVISION 03.001
A-REVISION 00.000.31
OK
AT^SPOW=1,0,0
OK
AT+IPR=115200
OK
AT+CGSN
357042065409675
OK
AT^SPOW=1,0,0
OK
ATE1
OK
AT+CMEE=2
OK
AT+CFUN?
+CFUN: 1,0
OK
AT+CFUN=1
OK
AT+COPS?
+COPS: 2
OK
AT+CGATT?
+CGATT: 0
OK
AT+CMGF=1
OK
AT+CREG=0
OK
AT+COPS=0
+CME ERROR: operation temporary not allowed
AT+CREG?
+CREG: 0,0
OK
AT+CSDH=1
OK
+STKPRO: 05,19
AT+CREG?
+CREG: 0,5
OK
AT
OK
AT^SISO?
^SISO: 0,""
^SISO: 1,""
^SISO: 2,""
^SISO: 3,""
^SISO: 4,""
^SISO: 5,""
^SISO: 6,""
^SISO: 7,""
^SISO: 8,""
^SISO: 9,""
OK
AT^SICS=0,conType,GPRS0
OK
AT^SICS=0,apn,"iot.aer.net"
OK
AT^sind?
^SIND: service,0,1
^SIND: message,0,0
^SIND: call,0,0
^SIND: roam,0,1
^SIND: smsfull,0,0
^SIND: rssi,0,0
^SIND: ciphcall,0,0
^SIND: simdata,0
^SIND: eons,0,2,"Aeris","Aeris"
^SIND: nitz,0,"20/07/21,07:46:09",-28,1
^SIND: psinfo,0,9
^SIND: pacsp,0,99
^SIND: simtray,0,0
^SIND: vmwait,0,0
^SIND: lsta,0,0
^SIND: dtmf,0,1,0,0,0
^SIND: ecallco,0,0
^SIND: ecallda,0,0
^SIND: ecaller,0,0
^SIND: iccid,0
^SIND: euiccid,0
OK
AT+CNMI=2,1
OK
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="GPRS/AutoAttach","enabled"
^SCFG: "GPRS/AutoAttach","enabled"
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://128.138.140.44:13"
OK
AT^SISO=0
OK
AT^SISC=0
OK
AT^SMONI
^SMONI: 3G,9811,432,-15.0,-114,310,260,9E22,9643EF9,3,1,NOCONN
OK
AT^SISC=0
OK
AT^SISS=0,address,"socktcp://52.7.146.49:30000"
OK
AT^SISO=0
OK
^SIS: 0,0,91,"PDP: internal error 2"
^SIS: 0,0,91,"PDP: internal error 2"
AT^SISC=0
OK
AT^SCFG="GPRS/AutoAttach","disabled"
^SCFG: "GPRS/AutoAttach","disabled"
OK
AT^SPOW=2,1000,3
OK
I have added extra commands of ^SCFG: "GPRS/AutoAttach","enabled/disabled" as per your suggestions. Do you think this will help in PDP fail or COPS:2 condition?
Hi Barttomiej,
I have three problem statements here:
1. I am putting my module into sleep using SPOW command. But every time when modules wake up it shows "+COPS: 2" that means device is deregistered manually? What is causing that?
2. My Module is showing PDP connection fail multiple ***** - when COPS:2 but able to registered on roaming network. Do you think module can register without showing COPS,0,network_name? Refer above logs for the same.
3. When even after cops and creg registration it shows PDP fail
AT^SPOW=1,0,0
OK
ATE1
OK
AT+CMEE=2
OK
AT+CGSMS?
+CGSMS: 1
OK
AT+CFUN?
+CFUN: 1,0
OK
AT+CFUN=1
OK
AT+COPS?
+COPS: 0,0,"T-Mobile",2
OK
AT+CGATT?
+CGATT: 1
OK
AT+CMGF=1
OK
AT+CREG=0
OK
AT+COPS=0
+CME ERROR: operation temporary not allowed
AT+CREG?
+CREG: 0,5
OK
AT+CSDH=1
OK
AT
OK
AT^SISO?
^SISO: 0,"Socket",2,1,0,0,"0.0.0.0:0","0.0.0.0:0"
^SISO: 1,""
^SISO: 2,""
^SISO: 3,""
^SISO: 4,""
^SISO: 5,""
^SISO: 6,""
^SISO: 7,""
^SISO: 8,""
^SISO: 9,""
OK
AT^SICS=0,conType,GPRS0
+CME ERROR: operation not allowed
AT^SISC=0
OK
AT^SPOW=1,0,0
OK
ATE1
OK
AT+CMEE=2
OK
AT+CGSMS?
+CGSMS: 1
OK
AT+CFUN?
+CFUN: 1,0
OK
AT+CFUN=1
OK
AT+COPS?
+COPS: 0,0,"T-Mobile",2
OK
AT+CGATT?
+CGATT: 0
OK
AT+CMGF=1
OK
AT+CREG=0
OK
AT+COPS=0
OK
AT+CREG?
+CREG: 0,5
OK
AT+CSDH=1
OK
AT
OK
AT^SISO?
^SISO: 0,"Socket",2,1,0,0,"0.0.0.0:0","0.0.0.0:0"
^SISO: 1,""
^SISO: 2,""
^SISO: 3,""
^SISO: 4,""
^SISO: 5,""
^SISO: 6,""
^SISO: 7,""
^SISO: 8,""
^SISO: 9,""
OK
AT^SICS=0,conType,GPRS0
OK
AT^SICS=0,apn,"iot.aer.net"
OK
AT
OK
AT+CNMI=2,1
OK
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="GPRS/AutoAttach","enabled"
^SCFG: "GPRS/AutoAttach","enabled"
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^SMONI
^SMONI: 3G,9811,250,-13.0,-108,310,260,9E22,964CFDC,5,7,NOCONN
OK
AT^SISC=0
OK
AT^SISS=0,address,"socktcp://52.7.146.49:30000"
OK
AT^SISO=0
OK
AT^SISC=0
OK
AT^SCFG="GPRS/AutoAttach","disabled"
^SCFG: "GPRS/AutoAttach","disabled"
OK
AT^SPOW=2,1000,3
OK
^SIS: 0,0,91,"PDP: internal error 2"
AT^SPOW=1,0,0
OK
AT^SPOW=2,1000,3
OK