BGS5T HTTP POST | Thales IoT Developer Community
November 21, 2014 - 2:32pm, 3838 views
Hello,
I am trying to send POST request to the server. I tryed the AT commands and Java but I had no sucess.My header has to look like this:
POST /v1/feeds/122 HTTP/1.1
Host: apiscada.voco.si
X-ApiKey: W382YBfl_vMcfoY3t064kE4zyBYtUXUC3v_-FUPOIVg
User-Agent: CyBro-2
Content-Length: 1935
Content-Type: text/csv
Connection: close
Here is first the Java code:
And error is:
javax.microedition.io.ConnectionNotFoundException: error -121 in socket::open
As for AT commands I followed offical example: https://iot-developer.thalesgroup.com/tutorial/concept-board-internet-se...
I tryed POST for the data above and GET for site: http://httpbin.org/get nad http://httpbin.org/ip but both ***** I got: ^SIS: 1,0,3,"Bad address specified"
Here are AT commands:
I don't know what could be wrong before parameters for internet connection should be working since in the past managed to transfer midlet from web using OTAP. Do I need certificates or is it somthing else?
Regards
Jure
I checked state of Internet connections and internet services and one probably look wrong:
AT^SICI?
AT^SICI?
^SICI: 0,2,2,"192.168.82.2"
OK
AT^SISI?
AT^SISI?
^SISI: 1,4,0,0,0,0
^SISI: 9,6,0,0,0,0
That SICI ip looks like local ip. Is that normal?
And when I try to ping I get IP adress bot nothing goes trough:
at^sisx="Ping",0,www.google.com
at^sisx="Ping",0,www.google.com
^SISX: "Ping", 1, 0, "74.125.136.103", -1
^SISX: "Ping", 2, 0, 1, 0, 1, 100
^SISX: "Ping", 3, 0, 5000, 0, 0
UPDATE:
I managed to get response for adress http://httpbin.org/get:
AT^SISO=1
OK
^SIS: 1,0,2200,"Http httpbin.org:80"
But nothing else, tutorial says that in respond there should also be response length (^SISR: 1,1270)
I checked with at^sisi=1
^SISI: 1,3,0,0,0,0
Found what the problem was. SIM card APN was set so that acted as it was insinde companys local network. So I used default settings from carrier and now works like it should.
Hi,
It seems I'm too late here..
But it's great that the problem is solved.
Congratulations!
Bartłomiej