RandomWireMan
Newbie level 1
Code:
comsendstr('AT+CIFSR;+CIPSTART="TCP","www.opencellid.org",80');
comsendstr(CR);
Delay(15000);
comsendstr('AT+CIPSEND');
comsendstr(CR);
Delay(2000);
comsendstr('GET /cell/get?key=xxx&mnc=7&mcc=262&lac=11528&cellid=7393047 HTTP/1.1');
comsendstr(CR);
comsendstr(LF);
comsendstr('Host: [url]www.opencellid.org');[/url]
comsendstr(CR);
comsendstr(LF);
comsendstr('Accept: */*');
comsendstr(CR);
comsendstr(LF);
comsendstr(CR);
comsendstr(LF);
comsendstr(Z);
I try to connect my uC to cosm/pachube/OpenCellID using a sim900 module and a grps connection:
For debugging purposes, I am using scripts on Braid terminal software to talk to the module
This is what I get if I issue the following commands after setting the APN:
This is what i send using a terminal:
this is what I get as response:
AT+CIFSR;+CIPSTART="TCP","www.opencellid.org",80
10.76.182.162
OK
CONNECT OK
AT+CIPSEND
> GET /cell/get?key=xxx&mnc=7&mcc=262&lac=11528&cellid=7393047 HTTP/1.1
Host: www.opencellid.org
Accept: */*
SEND OK
HTTP/1.1 200 OK
Date: Sun, 30 Sep 2012 06:51:09 GMT
Server: Apache/2.2.16 (Debian)
X-Powered-By:
Cache-Control: no-cache
Set-Cookie: _OpenCellID_session_id=dc886e8bab6d6ed6fe1f2db9f09847d4; path=/
Content-Length: 187
Status: 200 OK
Content-Type: application/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?><rsp stat="ok"> <cell lat="53.5430811765178" mcc="262" lon="9.93279410526435" cellId="" nbSamples="69" mnc="7" lac="11528" range="50000"/></rsp>
CLOSED
So that's fine. Issuing a request to cosm/pachube leaves me with the "Send OK" message and no response:
This is what i send using a terminal:
comsendstr('AT+CIFSR');
comsendstr(CR);
comsendstr('AT+CIPSTART="TCP","api.cosm.com",80');
comsendstr(CR);
Delay(5000);
comsendstr('AT+CIPSEND');
comsendstr(CR);
Delay(2000);
comsendstr('GET /v2/feeds/xxx.csv HTTP/1.1');
comsendstr(CR);
//comsendstr(LF);
comsendstr('Host: api.pachube.com');
comsendstr(CR);
comsendstr(LF);
comsendstr('Accept: */*');
comsendstr(CR);
comsendstr(LF);
comsendstr('X-PachubeApiKey: xxx');
comsendstr(CR);
comsendstr(LF);
comsendstr(CR);
comsendstr(LF);
comsendstr(Z);
this is what I get as response:
CONNECT OK
AT+CIFSR
AT+CIPSTART="TCP","api.cosm.com",80
10.76.182.162
AT+CIPSEND
> GET /v2/feeds/xxx.csv HTTP/1.1
Host: api.pachube.com
Accept: */*
X-PachubeApiKey: xxx
SEND OK
If I try to connect directly to the feed, I get the following:
AT+CIPSTART="TCP","api.cosm.com/v2/feeds/xxx.csv",80
OK
STATE: IP STATUS
CONNECT FAIL
So what is wrong with the get request to cosm?
Cheers
RandomWireMan
Last edited by a moderator: