1
0

Fix payload initialization and update postRequest call in loop function

This commit is contained in:
PinkyFlowy
2025-04-27 13:34:28 +02:00
parent 2e425a04f9
commit 1a1972441b

View File

@@ -8,8 +8,10 @@ BMP280_DEV bme;
// HTTP Request
String response;
String payload;
const String url = "/api/v1/sensors/:sensorId/values";
// MQ7
float sensorVolt, sensorValue, RSAir, R0;
@@ -52,6 +54,8 @@ void loop() {
GPS_Read();
lon = GPS_longitud();
lat = GPS_latitud();
//postRequest(HTTPClient &httpClient, const String url, String &payload, String &response)
postRequest(httpClient, url, serializeSensorValue(), )
//postRequest(HTTPClient &httpClient, const String url, String &payload, String &response)
//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);
}