I am trying to target a specific page (script) on my webserver using a GPRS modem. I can hit my domain, and get a reply back but then when I am trying to call my script it just won't let me:






+ICCID: 54646149798787496


+CSQ: 16,99





+AIPA: 1,,0,0,0 ;Connect with APN server



+AIPO: 1,“”,4770,“”,80,0,30,1,0,64000,8,7300,5720,-500,0) 


I am trying to hit either "MYSRVR.COM/SUB/PAGE.PY" or I can even do with "MYSRVR.COM/SUB/" if that's too much of a hassle.

Ref to AT commands/Data sheet

  • \$\begingroup\$ Have you tried doing so via other computer ? \$\endgroup\$ – vvy Aug 16 '13 at 16:46
  • \$\begingroup\$ what exactly do you mean by other computer? \$\endgroup\$ – Caspian Aug 16 '13 at 16:47
  • \$\begingroup\$ The question is OK here IMO but something you should add is the kind of GPRS modem and a link to a datasheet or command documentation, the AT commands used for TCP/IP level comms tends to vary a bit. \$\endgroup\$ – PeterJ Aug 16 '13 at 16:49
  • \$\begingroup\$ You say "I can hit my domain and get a reply back", I assume you did that via some other computer in your LAN( by pointing your browser to 'the' url). Can you similarly evoke your page.py script using this method ? That will reveal errors, if any. \$\endgroup\$ – vvy Aug 16 '13 at 16:50
  • \$\begingroup\$ Well the reason that I am saying it works ok is the AT's respond on the 3rd line. but to answer your question, yes, I have tested the server and the script and it works OK on a browser, but I believe there is a different technique to opening a page via AT \$\endgroup\$ – Caspian Aug 16 '13 at 16:53

You're opening the socket OK but the part you're missing is that you'll need to issue an HTTP request to the server. The full documentation you'll probably want to look at is RFC2616 but the request should look roughly like this:

Host: www.MYSERVR.com
(blank line)

The above probably violates a few standards because there are additional headers I believe you should include, but it should give you a pointer in the right direction. Maybe for a start install a Telnet client and try connecting that way rather than using a web browser so you can check that the request works OK and easily check the response you get back.

You need to send the above over the socket, so for that module take a look at AT+AIPW command.


I think you need to send a Http GET header after you are connected to the server. Something like

At+AIPW=1, "GET /SUB/ HTTP/1.1 \r\n Host: www.YOURSERVR.com \r\n User-Agent: Myzilla \r\n \r\n "

The datasheet you mentioned suggests one other method too i.e.

..response "CONNECT"
"x bytes of data"

Those x bytes should have a valid GET/POST header.

The server response shall follow the last step.

  • \$\begingroup\$ yeah this sounds more reasonable. I'll give this a try \$\endgroup\$ – Caspian Aug 16 '13 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.