EHS6T - HTTP post issue | Telit Cinterion IoT Developer Community
December 14, 2017 - 8:20pm, 7219 views
Hi guys,
Sometimes when I send an HTTP post, it happens that after sending AT^SISW: x,0,1, the EHS6 doesn't send the ^SISW x,0,0 response, even if I wait for several minutes.
Here is a log:
001976630: Sending AT^SCFG="Tcp/WithURCs","on"
001976710: RX: ^SCFG: "Tcp/WithURCs","on"
OK
001976830: Sending AT^SICI=1
001976890: RX: ^SICI: 1,2,0,"***.***.***.***"
OK
001977010: Sending AT^SISS=2,srvType,Http
001977080: RX: OK
001977200: Sending AT^SISS=2,conId,1
001977270: RX: OK
001977390: Sending AT^SISS=2,cmd,"post"
001977460: RX: OK
001977580: Sending AT^SISS=2,address,"http://******************************"
001977730: RX: OK
001977850: Sending AT^SISS=2,hcContLen,148
001977930: RX: OK
001978240: Sending AT^SISO=2
001978310: RX: OK
001978350: RX: ^SIS: 2,0,2200,"Http ***.***.***.***"
001978370: RX: ^SISW: 2,1
001978430: Sending AT^SISW=2,148
001978490: RX: ^SISW: 2,148,0
001978500: writing post data
001978850: RX: OK
001978880: RX: ^SISW: 2,1
001978970: Sending AT^SISW=2,0,1
When the problem occurs, after that point I don't get any messages from EHS6.
So I did one little test. After waiting 15 minutes without receiving any message, I removed the SIM card, and then the following messages were received:
^SISW: 2,0,0
OK
^SISW: 2,2
^SIS: 2,0,2200,"HTTP POST: http://***************************"
^SIS: 2,0,8002,"HttpHTTP POST: IllegalArgumentException Socket-Error:94"
It seems EHS6 didn't send the URCs for some reason. I'm not sure either if the exception message is due the card removal, or if the exception is making the EHS6 to get stuck.
Any ideas?
Response from ATI1:
Cinterion
EHS6
REVISION 03.001
A-REVISION 00.000.55
Thanks in advance for your help.
Hello,
For POST the module actually opens the socket and starts sending data after you enter end of data with AT^SISW=2,0,1 command. And you get the reply for this command when the data is already sent. So here it looks like there was some problem with the connection to server and there was no reply for so long maybe due to tcp retransmissions, timeouts etc. After you have removed the SIM card the reply was returned together with this socket error information. So it seems that the POST was not sent. I think that some adjustment of these parameters should help here to get the error earlier:
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","6000"
The SCFG setting is global. You can also configure these params for the particular connection with AT^SISS command.
Regards,
Barłomiej
Thanks Barłomiej,
According to the HTTP post example on EHS6 AT commands manual, the following messages mean that the data were actually sent to the server. Is that correct? So, it seems that the messages were ready to be sent but got stuck on EHS6 - the post couldn't be sent without the SIM card.
^SISW: 2,0,0
OK
^SISW: 2,2
Anyway, I'll try to reconfigure the timers and see what happens.
Regards,
Harley
I just confirmed that the server did receive the post.
So maybe the problem was in the reception of seerver reply and the module was waiting for the complete reply. Is it also possible to verify if the server sent the reply and if it contained the end of data flag?
Regards,
Bartłomiej
Hi Bartłomiej,
Does the ^SISW: 2,2 URC depend on server reply? If it is a notification that the post data was transmitted, shouldn't it be sent regardless the server reply?
I tried reconfiguring the following parameters that way:
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","60"
After that, when the problem occurred again I waited for almost 2 hours for the module reply, without success.
Is there a way to enable some debug on the module? I'm not using Java, I'm sending commands through serial port.
I'll see if there's a way to check the server reply, although I belive there is no problem with the server responses.
Regards,
Harley
I did another test, and this time I programmed the EHS6 to send a ^SRADC URC every 30s. After removing the SIM card, I got the following messages:
^SISW: 2,0,0
OK
^SISW: 2,2
^SIS: 2,0,2200,"HTTP POST: http://***************************"
A lot of ^SRADC URC messages here
^SIS: 2,0,8002,"HttpHTTP POST: IllegalArgumentException Socket-Error:94"
So:
1 - The exception message is due the SIM card removal, and not the cause of the ^SISW messages not being sent.
2 - Even though there are new URC messages in the queue, that's not enough to make the module send those messages.
Another thing I noticed, after sending AT^SISW=2,0,1 the module seems unable to accept any other commands until it sends the pending URCs. Is there a way to put the module back in a state where it can accept commands again?
Hello,
I think that in such case only the traces would show us what happens between the module and the server and if there is any reply or acknowlegement not sent.
There's no way to trace the module, there are only internal tools for that.
It looks like this functionality is implemented in this way that when you send end of data to the module the connection is established, POST is sent and the reply is gathered within this command execution. And after that the command returns the answer and OK/ERROR result.
And URC's should not be thrown in the middle of a command which means that any URC should appear between the command echo and OK/ERROR reply. That is probably the reason why your ^SRADC URC's are not thrown. And also any other command can be sent on a particular interface before the previous one is executed and has returned the OK/ERROR reply.
Regards,
Bartłomiej
So it seems that the only thing I can do is wait the module return an error based on the timers/retransmissons parameters. As I said in an earlier post, with the following settings I've been waiting for almost 2 hours for the module response, with no lucky. Shouldn't the Tcp/OT abort the command execution faster?
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","60"
Regards,
Harley
Hi Bartłomiej,
I changed the following parameters (^SCFG: Tcp/OT is back to default value)
AT^SISS=2,tcpot,60
AT^SISS=2,tcpmr,3
After that, I started getting the following after some time running:
004900730: Sending AT^SMONI=255
004900780: RX: ^SMONI: 3G,10612,155,-7.0,-69,724,05,754F,08307F5,11,36,NOCONN
OK
004900910: Sending AT^SMONP=255
004900990: RX: 3G:
10612,155,-12.5,-121,---,---,AN,------
10612,125,-12.5,-121,---,---,AN,------
10612,77,-12.5,-121,---,---,AN,------
10612,197,-12.5,-121,---,---,AN,------
10612,203,-12.5,-121,---,---,AN,------
10612,24,-12.5,-121,---,---,AN,------
2G:
----,----,-,-,----,------
OK
004901130: Sending AT^SISW=2,0,1
004901220: RX: ^SISW: 2,0,0
OK
004901270: RX: ^SISW: 2,2
004901290: RX: ^SIS: 2,0,2200,"HTTP POST: http://*****************************"
004901310: RX: ^SIS: 2,0,8002,"HttpHTTP POST: IllegalArgumentException Socket-Error:16"
What does this socket error mean?
Regards,
Harley
Pages