From 1a1972441bf6c0c6ce04632ad52e045245cabccb Mon Sep 17 00:00:00 2001 From: PinkyFlowy Date: Sun, 27 Apr 2025 13:34:28 +0200 Subject: [PATCH] Fix payload initialization and update postRequest call in loop function --- hardware/src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hardware/src/main.cpp b/hardware/src/main.cpp index 78d6fce..1861bd4 100644 --- a/hardware/src/main.cpp +++ b/hardware/src/main.cpp @@ -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); } \ No newline at end of file