I'm using the Sim800L module and the NEO6M GPS Module in combination with an Arduino nano to create a simple tracking device. I get the data from the GPS and try to upload it to my site with some simple PHP scripts. I'm using this code down here:
//the function - which is responsible for sending data to the web server
void sendLocation(String lat, String lon){
Sim800l.listen();
//The line below sets the URL we want to connect to
Sim800l.println("AT+HTTPPARA=\"URL\", \"http://" + ipAddress + "/log_info.php?dev_id=13&lat=" + lat + "&lon=" + lon + "\"");
waitUntilResponse("OK");
//GO
Sim800l.println("AT+HTTPACTION=0");
waitUntilResponse("200");
Serial.println("Location sent");
gpsPort.listen();
}
Unfortunately, when I try to use this code, in my serial monitor I get this message:
AT+HTTPACTION=0
OK
+HTTPACTION: 0,302,171
error
I Looked it up in the datasheet for the Sim800L, and the number 302 means "Found". I'm expecting the number 200 for "OK". I have no idea what I did wrong, the data is not being send to the web server for some reason. I hope you can help. Thanks in advance!
EDIT: The datasheet with all the errors for the Sim800L https://www.elecrow.com/wiki/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf