I'm using a SIM800L module and Arduino Uno to communicate with a web server. I have a sensor read by the Arduino. I want to store the sensor's value to my database.
On my web server I have a PHP page that saves data to the database. I'm using the GET method like this: http://www.isj.ir/Samples/sample.php?sen1=27.2
.
I'm using this library for the SIM800L.
But I can't pass my sensor's value with this example. I'm so confused! Would you please help me and tell me what should I do?
sprintf(body, "{\"name\": \"%s\"}", "Arduino");
result = http.post("isj.ir/Samples", body, response);
Serial.println(body);
print(F("HTTP POST: "), result);
if (result == SUCCESS) {
Serial.println(response);
StaticJsonBuffer<32> jsonBuffer;
JsonObject& root = jsonBuffer.parseObject(response);
lastRunTime = millis();
waitForRunTime = root["waitForRunTime"];
print(F("Last run time: "), lastRunTime);
print(F("Next post in: "), waitForRunTime);
}
result = http.get("isj.ir/Samples", response);
print(F("HTTP GET: "), result);
if (result == SUCCESS) {
Serial.println(response);
StaticJsonBuffer<32> jsonBuffer;
JsonObject& root = jsonBuffer.parseObject(response);
lastRunTime = millis();
waitForRunTime = root["waitForRunTime"];
print(F("Last run time: "), lastRunTime);
print(F("Next post in: "), waitForRunTime);
}