Need help with HTTP request | Thales IoT Developer Community
April 5, 2020 - 1:54am, 2792 views
Hello,
I'm a newbie with ELS61-E2 Module.
I want to send data to server with get command and save it in data base.
I tried with AT^SISS=4,"address","https://localhost/Test/test.php?data=test"
It returns OK but when i try to open the service with the command AT^SISO=6, it returns ERROR.
Any help ?
Best regards,
Hello,
With GET you can download something from a server. Ty send you need POST. Anyway you need to configure the internet connection first and then your server connection. Please see these tutorials first: https://iot-developer.thalesgroup.com/knowledge-base?title=http&field_kb...
You will also find examples in the AT Commands Specification document for your module.
If you still have problems or any doubts, please write in this thread.
Best regards,
Bartłomiej
Hello,
Thanks for your response. I thought that both method can transfer data to the server. I have already configured the internet connection and the server. Here is my configuration and its response
----------------------------------------------------
^SYSLOADING
^SYSSTART
AT+CTZU=1
OK
AT+CPIN?
+CPIN: READY
OK
AT+CGDCONT=1,"IP","weborange"
OK
AT+CMEE=2
OK
+PBREADY
AT+CGATT=1
OK
At^SICS=0,conType,GPRS0
OK
AT^SICS=0,apn,"weborange"
OK
AT^SISS=2,srvType,http
OK
AT^SISS=2,hcProp,Content-Type:application/json
OK
AT^SISS=2,cmd,0
OK
AT^SISS=2,"address","https://localhost/Test/test.php"
OK
AT^SISO=2
OK
^SIS: 2,0,2200,"Http 127.0.0.1:443"
^SIS: 2,0,14,"An established connection was aborted, possibly due to a data transmission time-out or protocol error"
+CME ERROR: operation not allowed
I tried the GETS's method exemple that i found in document, it worked but when i change the amount of data to read "AT^SISR=4,x" where x is different than 1000, it returns ERROR.
I also tried reading data from the localhost, it returns the error mentioned above.
Can you help me ? Thank you.
Hello,
I think tha that the problem is in the address you connect to - localhost means internal loop - 127.0.0.1 address is used by devices to connect to themselves. You need an external IP address (public address if you are using the public APN) or domain name.
The maximum data size you can request to read with a single SISR call is 1500 bytes. If it's not the problem, please paste a log - maybe there's some more information.
Regards,
Bartłomiej
Hello,
Could you please explain more ?
I didn't get it, How can i set an external IP address ?
Thank you.
Best regards.
Hello,
I meant any external IP (other than local loopback). With 127.0.0.1 the module probably attempted to connect to itself.
If you are using the standard public APN for the connection you should know the public IP address of your server (or public domain name) the same that you can access with a borwser on any PC.
If you have a test http server on yor PC you can access it with https://localhost url only from your PC and not from the module or any other device connected to public internet.
Regards,
Bartłomiej