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:
GET /getparameters.php?location=id HTTP/1.1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<title>400 Bad Request</title>
<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:
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.!!