Fix payload initialization and update postRequest call in loop function
This commit is contained in:
@@ -8,8 +8,10 @@ BMP280_DEV bme;
|
|||||||
|
|
||||||
// HTTP Request
|
// HTTP Request
|
||||||
String response;
|
String response;
|
||||||
|
String payload;
|
||||||
const String url = "/api/v1/sensors/:sensorId/values";
|
const String url = "/api/v1/sensors/:sensorId/values";
|
||||||
|
|
||||||
|
|
||||||
// MQ7
|
// MQ7
|
||||||
float sensorVolt, sensorValue, RSAir, R0;
|
float sensorVolt, sensorValue, RSAir, R0;
|
||||||
|
|
||||||
@@ -52,6 +54,8 @@ void loop() {
|
|||||||
GPS_Read();
|
GPS_Read();
|
||||||
lon = GPS_longitud();
|
lon = GPS_longitud();
|
||||||
lat = GPS_latitud();
|
lat = GPS_latitud();
|
||||||
//postRequest(HTTPClient &httpClient, const String url, String &payload, String &response)
|
//postRequest(HTTPClient &httpClient, const String url, String &payload, String &response)
|
||||||
postRequest(httpClient, url, serializeSensorValue(), )
|
//String serializeSensorValue(int sensorId, int deviceId, String sensorType, String unit, int sensorStatus, float temperature, float humidity, float carbonMonoxide, float lat, float lon, long timestamp)
|
||||||
|
|
||||||
|
postRequest(httpClient, url, payload, response);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user