I am trying to use a GSM shield to do a http Get request using GPRS.
This is the hardware I am using:
The problem I am having is that I keep seeing this output in the debug window:
AT#GPRS=1
+IP: 10.215.185.131
OK
AT
AT#SKTD=0,80,"www.bijlmereuro.net",0
CONNECT
GET /getparameters.php?location=id HTTP/1.1
Host: www.bijlmereuro.net
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<
Something seems to be wrong in my GET request or in the timing of it. The ret_val = gsm.SendATCmdWaitResp and 10000, 1000, “OK”, 1 numbers are part of the GSM library of the GSM shield.
Forum wont let me post a link, even though it’s an example.
I’m getting the same problem
Sorted it connecting directly with Hyperteminal:
at the end of the GET line
at the end of the Host line
Control M being CR
Control J being LF
ANY OTHER COMBINATION RESULTED IN ERROR: even a LF after the first CR.
Don’t understand why but it works.
However when transferring this code to Arduino and getting it to send the same data string results in the same error again. No idea why. Tried all combinations of CR LF
Anyone had same the problem and solved whats going on??
I actually managed to solve my own problem and am planing to write a tutorial for the GSM shield website for how to do it. So just quickly. The key thing to realise is that each time you do "gsm.SendATCmdWaitResp" is actually a carriage return and newline \r\n.
So try this:
Hi Thanks for reply.
First:
I think they sold me an old version of GSM model.
The command AT#SKTD=0,80,\"www.google.com\",0 returns ERROR when sending direct from hyperterminal as does AT#SKTD?
I have been using AT#SKTSET = 0,80,\"www.google.com\",0,0
which does the same thing but is from an older command set.
Secondly:
I have been sending with one function call ie:
ret_val = gsm.SendATCmdWaitResp("GET / HTTP/1.1\r\nHost: www.google.co.uk\r\n", 10000, 1000, "", 1);
Ok found what's causing it...
I'm using GPRS to access a PHP script on my server to update a database with data collected by the Arduino. I could do it from Hyperterminal directly to the GSM Shield, but not when testing with the Arduino.
I striped out all the DEBUG_PRINT commands and let my sketch just do it's stuff. All worked great. So the print _debugger is chucking odd characters back into the Shield, not much good as a debugger then!!
Thanks for pointing out the addition of CRLF inserted by the function. Bit naught that, it should just send what you tell it too.!!