ELS61-E: can't HTTP POST more than 21584 bytes with AT^SISW | Telit Cinterion IoT Developer Community
August 9, 2019 - 12:09pm, 5448 views
Hello,
i am stuck with a problem posting a bigger dataset to a HTTP POST endpoint.
My problem is: i can't post more than 21584 bytes with repeated AT^SISW commands. Whenever i try more i get the following response from the module:
^SISW: 0,2
^SIS: 0,0,2200,"HTTP POST: https://els61.requestcatcher.com"
^SIS: 0,0,8002,"HttpHTTP POST: IllegalArgumentException Socket-Error:-1000"
My ATI1 is:
Cinterion
ELS61-E
REVISION 01.000
A-REVISION 00.026.00
Anyone knows what might be wrong?
Kind regards
mbank
Hello,
I can reproduce the same behavior on this module. I will check it more deeply and come back to you.
Best regards,
Adam
Hello,
I have workaround idea. Could you please implement HTTP POST request on your own based on the module's TCPs stack? Like in below logs:
at^scfg="tcp/withurcs","on"
^SCFG: "Tcp/WithURCs","on"
OK
at^sics=1,contype,GPRS0
OK
at^sics=1,apn,internet
OK
AT^SISS=2,srvType,"socket"
OK
AT^SISS=2,conId,1
OK
AT^SISS=2,hccontlen,10
OK
AT^SISS=2,address,"socktcps://httpbin.org:443;etx"
OK
AT^SISO=2
OK
^SISW: 2,1
AT^SIST=2
CONNECT
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
here you send http headers and data, in Zoc REXX script it works like this:
crlf = "0D"x || "0A"x
http_data = ""
method = "POST /post HTTP/1.1"||crlf
host = "Host: httpbin.org"||crlf
usr_agt = "Module"
user_agent = "User-Agent: "||usr_agt||crlf
content_type = "Content-Type: application/x-www-form-urlencoded"||crlf
content_length = "Content-Length: 24000"||crlf
accept = "Accept: */*"||crlf
http_data = method || user_agent || content_type || content_length || host || accept || crlf || data
CALL ZocSendRaw http_data
CALL ZocSendRaw "24000 bytes of data"
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//and server returns the response
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Wed, 14 Aug 2019 13:33:03 GMT
Referrer-Policy: no-referrer-when-downgrade
Server: nginx
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 24365
Connection: keep-alive
{
"args": {},
"data": "",
"files": {},
"form": {
"DATALorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
.
.
.
tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id,": ""
},
"headers": {
"Accept": "*/*",
"Content-Length": "24000",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "httpbin.org",
"User-Agent": "Module"
},
"json": null,
"origin": "46.134.13.158, 46.134.13.158",
"url": "https://httpbin.org/post"
}
after that you can quit transparent mode by sending '+++'
Could you please consider this idea?
Best regards,
Adam
Hi Adam,
that is a nice workaround. I tried it and it is also much faster than repeated AT^SISW.
Thanks for your help!
Kind regards
mbank
Adam,
that kinda worked. But are you able to post 50000 bytes this way?
Kind regards
mbank
P.S. Nevermind, it works when I reduce the baudrate to 115200. I will have a look why it doens't always work with 921600.
Hello,
Please let me know after you will have results of your test. What error do you get when transmission does not work?
Thanks,
Adam
Adam,
when posting a 50k body with 921600 bps to httpbin.org afer some seconds I just get:
HTTP/1.1 504 GATEWAY_TIMEOUT
Content-Length: 0
Connection: keep-alive
After that im not able to leave tranparent mode with "+++". After some minutes I get a NO CARRIER.
When posting just 30k auf data I just get a OK but not the usual httbin.org response.
Its working when I reduce the bps to 115200.
I also use requestcatcher.com for my tests. There I can't post a 50k body too. During the transfer I get
NO CARRIER
^SIS: 2,0,48,"Remote peer has closed the connection"
Using postman I am able to post large amounts of data to both services.
Kind regards
mbank
P.S. Ok I made some progress with httbin.org. Insted of using a single write call with 50000 bytes I used 50000 calls with 1 byte. That seems to work.
Hello,
Af these problems seem to depend on baudrate, may I ask what interface you are using - ASC0/1 or USB?
Is hardware flow control enabled and wired?
Thanks and regards,
Bartłomiej
Hello,
we are using ASC0 with hardware flow control enabled on both sides.
The ASC0 ist connected to a USB-RS232 converter to my pc.
I guess it could be a problem with the converter. So we will remove that and I will test again with a direct connection to my pc's RS232. I will let you hear the results.
Kind regards
mbank
Hello,
Problems with certain baudrate only would suggest some flow control problems. Some USB-RS232 convertest may cause problems so it's worth checking. Please also make sure that RTS/CTS flow control is enabled on the module.
Regards,
Bartłomiej
Hello,
ok I got it working now. It was definitly a flow control problem. Since my PCs serial port is limited to 115200 I finally succeded with changing a setting in the virtual com port setup of the USB-RS232 converter.
Thank you all very much for your help and sorry that I wasted your time by using that converter which lead me to problems that are not the modules fault.
Kind regards
mbank
Pages