EHS6 Socket Issues AT^SISC and AT^SISS | Telit Cinterion IoT Developer Community
January 20, 2017 - 9:01pm, 5427 views
Hello to everyone!
I´m having trouble to recover after an unexpected power failure with my EHS6 V3. I´m running a Java programs that sends AT commands to the EHS6 to establish a non transparent TCP socket Client (always on).
The current set of commands it´s able to connect to the server and works fine, but if there is a sudden interruption on the power source (let's say a couple of seconds) the midlet restarts but wont receive any AT^SICS or AT^SISS commands. it returns +CME ERROR: 256 ( operation temporary not allowed ).
In the AT Command Manual says that writing "none" on the "srvType" will reset the rest of the parameters, but this command also returns the previously refered error.
I tryed to send the command AT^SISC after receiving the +CME ERROR: 256 but results in +CME ERROR: 21 (Invalid Index)
If I wait around 10 to 15 minutes and power the module up again it works fine like the first time
There is a command to force the EHS6 to release all PDP and Internet Service Configuration?
There is a command to change the local port when acting as a non transparent Socket Client?
Here is the version, config and commands that I'm sending.
Thanks in advance
ATI
Cinterion
EHS6
REVISION 03.001
OK
AT^SCFG?
^SCFG: "Audio/Loop","0"
^SCFG: "Call/ECC","0"
^SCFG: "Call/Speech/Codec","0"
^SCFG: "GPRS/AutoAttach","disabled"
^SCFG: "Gpio/mode/ASC1","std"
^SCFG: "Gpio/mode/DAI","gpio"
^SCFG: "Gpio/mode/DCD0","gpio"
^SCFG: "Gpio/mode/DSR0","gpio"
^SCFG: "Gpio/mode/DTR0","gpio"
^SCFG: "Gpio/mode/FSR","gpio"
^SCFG: "Gpio/mode/HSIC","rsv"
^SCFG: "Gpio/mode/PULSE","gpio"
^SCFG: "Gpio/mode/PWM","gpio"
^SCFG: "Gpio/mode/RING0","gpio"
^SCFG: "Gpio/mode/SPI","rsv"
^SCFG: "Gpio/mode/SYNC","gpio"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","EHS6"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEShutdown/sVsup/threshold","0","0"
^SCFG: "MEopMode/CFUN","0","1"
^SCFG: "MEopMode/SoR","off"
^SCFG: "Radio/Band","511"
^SCFG: "Radio/Mtpl","0"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","1","1"
^SCFG: "Serial/USB/DDD","0","0","0409","1E2D","0058","Cinterion Wireless Modules","EHx",""
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","6000"
^SCFG: "Tcp/WithURCs","on"
^SCFG: "Trace/Syslog/OTAP","0"
^SCFG: "URC/Ringline","local"
^SCFG: "URC/Ringline/ActiveTime","2"
^SCFG: "Userware/Autostart","1"
^SCFG: "Userware/Autostart/Delay","0"
^SCFG: "Userware/DebugInterface","0.0.0.0","0.0.0.0","0"
^SCFG: "Userware/DebugMode","on"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","usb4",,,,"off"
^SCFG: "Userware/Watchdog","0"
OK
/**************************** Sucessful Routine *************************************************/
Java midlet Started.
$Transparent Socket v0.0
Sending asynchronous Command... 0
$InputStream and OutputStream opened
CMD_Config: ATE0
OK
Sending asynchronous Command... 1
CMD_Config: AT+CMEE=1
OK
Sending asynchronous Command... 2
CMD_Config: AT+CMEE=1
OK
Sending asynchronous Command... 3
CMD_Config: AT+CREG=2
OK
Sending asynchronous Command... 4
CMD_Config: AT+CGREG=2
OK
Sending asynchronous Command... 5
CMD_Config: AT+CPIN?
+CPIN: READY
OK
Sending asynchronous Command... 6
CMD_Config: AT+CLIP=1
OK
Sending asynchronous Command... 7
CMD_Config: AT+CMGF=1
OK
Sending asynchronous Command... 8
CMD_Config: AT+CREG?
+CREG: 2,1,"C937","00002894",0
OK
Sending asynchronous Command... 9
CMD_Config: at^SCFG="Tcp/WithURCs","on"
^SCFG: "Tcp/WithURCs","on"
OK
Sending asynchronous Command... 10
CMD_Config: AT^SISS=1,"srvType","none"
OK
Sending asynchronous Command... 11
CMD_Config: at^SICS=1,"conType",GPRS0
OK
Sending asynchronous Command... 12
CMD_Config: at^SICS=1,"inactTO","120"
OK
Sending asynchronous Command... 13
CMD_Config: AT^SICS=1,dns1,"8.8.8.8"
OK
Sending asynchronous Command... 14
CMD_Config: AT^SICS=1,passwd,""
OK
Sending asynchronous Command... 15
CMD_Config: AT^SICS=1,user,""
OK
Sending asynchronous Command... 16
CMD_Config: AT^SICS=1,apn,"internet.colombiamovil.com.co"
OK
Sending asynchronous Command... 17
CMD_Config: AT^SISS=1,"srvType","Socket"
OK
Sending asynchronous Command... 18
CMD_Config: AT^SISS=1,"conId","1"
OK
Sending asynchronous Command... 19
CMD_Config: AT^SISS=1,"address",socktcp://201.234.71.191:12000
OK
Sending asynchronous Command... 20
CMD_Config: AT+CGATT=1
OK
URC Message:
+CGREG: 1,"C937","00002894",3,"57"
URC Message:
+CGREG: 1,"C937","00002894",3,"57"
Sending asynchronous Command... 21
CMD_Socket: AT^SISO=1
Trying to establish Socket....
OK
URC Message:
^SISW: 1,1
$EVENT: Socket Established!
/***********************END OF ROUTINE*****************************/
After the power failure everything from command 10 (AT^SISS=1,"srvType","none") returns +CME ERROR: 256
Hello,
Does it happen frequently or do you have a test routine to reproduce this situation?
It looks like that short power interruption has caused some strange state of the module. Is the whole device rebooting in this situation or just a MIDlet? Is it possible to check if the JRC MIDlet is working at that time (AT^SJAM=5)? ERROR replies might also suggest that JRC is not running.
Have you tried to initiate the module reboot in such a case (AT+CFUN=1,1 for example) just right away without waiting 10-15 minutes? I believe that this should help.
If such short interruptions are frequent in the area I suppose that maybe you should have some hardware solution to sustain the power for a while.
Is the whole device rebooting in this situation or just a MIDlet? Is it possible to check if the JRC MIDlet is working at that time (AT^SJAM=5)?
ERROR replies might also suggest that JRC is not running.
I expect that the MIDlet is configured for autostart? What are the settings of autostart parameters in the jad file.
Regards,
Bartłomiej
Hello Bartłomiej,
Thanks for the response, the whole device it's rebooting, I see the messages ^SISLOADING ^PBREADY and ^SISSTART as well as all messages from my Midlet.
Yes, the MIDlet has autostart enabled with the number 2 for start sequence here are my MIDlet parameters:
MIDlet-1: MIDlet-1,,tcp.Main
MIDlet-Jar-Size: 57966
MIDlet-Jar-URL: TransparentSocket.jar
MIDlet-Name: TransparentSocket MIDlet Suite
MIDlet-Vendor: MIDlet Suite Vendor
MIDlet-Version: 1.0.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: IMP-NG
Oracle-MIDlet-Autostart: 2
Oracle-MIDlet-Restart: true
Oracle-MIDlet-Restart-Count: 1
About the JRC MIDlet I had perform the AT^SJAM=5 and it's running.
About the frecuency of occurrence it happends all the time.
I program to send the AT+CFUN=1,1 when I get the ERROR Message, it's not pretty but IT WORKS!
I can send the export package if you want to probe yourself
About changing the local port for TCP Client, this is very important to my application, how can I do it?
Thanks a lot
Atte,
Cesar S.
Hello,
Good that restart works.
And how do you reproduce it - switch off the power manually for a while? Maybe it would reproduce without the MIDlet.
What power source are you using - is it some stock power adapter or your propriety hardware?
Have you tried without the MIDlet also?
There's no way to configure the local port while making the TCP Client connection to the remote host unfortunately.
Regards,
Bartłomiej
Hello,
Thanks again
The problem began because the Gate that switch on and off the EHS6's power source, it's controlled by an external MCU, we are on implemmentation phase, therefore we are programming and debugging all the components of our solution.
While we reboot the external MCU, the gate control temporally switch off the EHS6 less than 2 seconds, but In the real life scenario we can also have brief power failures.
I'm very sad to hear about the local port, because as the connection model it's always on, the socket cannot be re opened until the Operative System of the server realizes that the client it's no longer connected and releases the remote port, that takes about 3 minutes.
Another question, I'm concerned about the restart, performing the AT+CFUN=1,1 inside the MIDlet will cause the JRC to stop my MIDlet from auto start?
It's there any other command to force the EHS6 to flush the internet service parameters?
Atte,
Cesar S.
Hello,
Thanks for that additional explanations.
You can normally clear the internet service profile with SISS as you do it in your log. But in this case with the power source malfunction it seems not to be working. I suspect that this short power disruption causes some strange and not allowed signal states and that's why the module is not fully operational. So the best way would be to restart it properly.
Please also measure the BATT+ line with oscilloscope to check what's happening during the power failure.
I probably don't understand the explanation with ports. Your client application on the module connects to the server on some defined port (on which the server is listening), then the connection is established - on the module side on some port taken from the pool, and in the same way on the server side.
If the connection is broken for any reason the procedure is the same - the client can connect (when it detects that the connection is broken) on the same define port where the server is constantly listening and the real connection is established on the ports taken automatically from the pool on both sides. There's no way to reinitiate the broken connection by one side on the same local port.
The AT+CFUN=1,1 command causes that the whole module is restarted and after that the JRC and other applications enabled for autostart are initiated. No configuration change is done.
Regards,
Bartłomiej
Hi,
With AT^SIPS=all,save you can store the SISS and SICS profiles on the EHS6 flash.Using AT^SIPS=all,load you can read the profiles back.
Best Regards,
Antero
Antero Markkula
Communication and Mechatronics
Enkom Active Oy – www.enkom-active.fi
Upseerinkatu 3 A, 02600 Espoo, Finland
Mobile: +358 400 411368
Office: +358 10 204 0000
Fax: +358 10 204 0010
E-mail: antero.markkula@enkom-active.fi
Thanks a lot for the advices, I´m quite happy with the stability and speed of the connection, I'm now on the task of remotely update the MIDlet, I'll let you know if i run into problems.
Thanks again and best Regards,
Atte,
Cesar Sarmiento