Added a bit more logging

This commit is contained in:
Admar Schoonen 2022-06-04 10:37:23 +02:00
parent 1ed29953fe
commit 87c76e945f
1 changed files with 18 additions and 10 deletions

View File

@ -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();