From 87c76e945f4713c6c8fe6309affb545859b1d508 Mon Sep 17 00:00:00 2001 From: admar Date: Sat, 4 Jun 2022 10:37:23 +0200 Subject: [PATCH] Added a bit more logging --- Claire.ino | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Claire.ino b/Claire.ino index 59dbf32..5d01c7f 100644 --- a/Claire.ino +++ b/Claire.ino @@ -321,8 +321,8 @@ void readSensors(void) { unsigned long time_trigger = millis(); if (iaqSensor.run()) { // If new data is available - output = "Time: " + String(time_trigger); - output += " ms, Traw: " + String(iaqSensor.rawTemperature); + output = String(time_trigger); + output += " Sensor data: Traw: " + String(iaqSensor.rawTemperature); output += " *C , P: " + String(iaqSensor.pressure); output += " hPa, RHraw: " + String(iaqSensor.rawHumidity); output += " %, Rgas: " + String(iaqSensor.gasResistance); @@ -504,6 +504,8 @@ void getPrecipitation(const float * location) { url = baseUrlPrecipitation + "&lat=" + latS + "&lon=" + lonS; + Serial.print(millis()); + Serial.print(" Retrieving precipitation from "); Serial.println(url); http.begin(url, root_ca); @@ -513,8 +515,8 @@ void getPrecipitation(const float * location) { payload = http.getString(); parseJson(&payload); } else { - Serial.print(__func__); - Serial.print("(): got http code "); + Serial.print(millis()); + Serial.print(" Got http code "); Serial.println(httpCode); } http.end(); @@ -530,6 +532,8 @@ void getPrecipitation(const String address) { url = baseUrlPrecipitation + "&address=" + a; + Serial.print(millis()); + Serial.print(" Retrieving precipitation from "); Serial.println(url); http.begin(url, root_ca); @@ -539,8 +543,8 @@ void getPrecipitation(const String address) { payload = http.getString(); parseJson(&payload); } else { - Serial.print(__func__); - Serial.print("(): got http code "); + Serial.print(millis()); + Serial.print(" Got http code "); Serial.println(httpCode); } http.end(); @@ -562,6 +566,8 @@ void getAQI(const float * location) { url = baseUrlAQI + "&lat=" + latS + "&lon=" + lonS; + Serial.print(millis()); + Serial.print(" Retrieving AQI from "); Serial.println(url); http.begin(url, root_ca); @@ -571,8 +577,8 @@ void getAQI(const float * location) { payload = http.getString(); parseJson(&payload); } else { - Serial.print(__func__); - Serial.print("(): got http code "); + Serial.print(millis()); + Serial.print(" Got http code "); Serial.println(httpCode); } http.end(); @@ -588,6 +594,8 @@ void getAQI(const String address) { url = baseUrlAQI + "&address=" + a; + Serial.print(millis()); + Serial.print(" Retrieving AQI from "); Serial.println(url); http.begin(url, root_ca); @@ -597,8 +605,8 @@ void getAQI(const String address) { payload = http.getString(); parseJson(&payload); } else { - Serial.print(__func__); - Serial.print("(): got http code "); + Serial.print(millis()); + Serial.print(" Got http code "); Serial.println(httpCode); } http.end();