mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-24 05:57:17 +02:00
Updated log messages and version number
This commit is contained in:
@ -430,13 +430,13 @@ public:
|
||||
*/
|
||||
void showServerConfig(void) {
|
||||
Serial.println("Server configuration: ");
|
||||
Serial.printf(" inF: %s\r\n", config.inF ? "true" : "false");
|
||||
Serial.printf(" inUSAQI: %s\r\n",
|
||||
Serial.printf("inF: %s\r\n", config.inF ? "true" : "false");
|
||||
Serial.printf("inUSAQI: %s\r\n",
|
||||
config.inUSAQI ? "true" : "false");
|
||||
Serial.printf(" useRGBLedBar: %d\r\n", (int)config.useRGBLedBar);
|
||||
Serial.printf(" Model: %s\r\n", config.models);
|
||||
Serial.printf(" Mqtt Broker: %s\r\n", config.mqttBrokers);
|
||||
Serial.printf(" S8 calib period: %d\r\n", co2AbcCalib);
|
||||
Serial.printf("useRGBLedBar: %d\r\n", (int)config.useRGBLedBar);
|
||||
Serial.printf("Model: %s\r\n", config.models);
|
||||
Serial.printf("MQTT Broker: %s\r\n", config.mqttBrokers);
|
||||
Serial.printf("S8 calibration period: %d\r\n", co2AbcCalib);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -567,19 +567,19 @@ public:
|
||||
/** init client */
|
||||
client = esp_mqtt_client_init(&config);
|
||||
if (client == NULL) {
|
||||
Serial.println("mqtt client init failed");
|
||||
Serial.println("MQTT client init failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Register event */
|
||||
if (esp_mqtt_client_register_event(client, MQTT_EVENT_ANY,
|
||||
mqtt_event_handler, NULL) != ESP_OK) {
|
||||
Serial.println("mqtt client register event failed");
|
||||
Serial.println("MQTT client register event failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (esp_mqtt_client_start(client) != ESP_OK) {
|
||||
Serial.println("mqtt client start failed");
|
||||
Serial.println("MQTT client start failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -950,9 +950,9 @@ void boardInit(void) {
|
||||
|
||||
if (hasSensorS8 == false) {
|
||||
fw_mode = FW_MODE_PP;
|
||||
Serial.println("Can not detect SGP run mode 'PP'");
|
||||
Serial.println("Can not detect SGP run mode 'O-1PP'");
|
||||
} else {
|
||||
Serial.println("Can not detect SGP run mode 'PST' without SGP");
|
||||
Serial.println("Can not detect SGP run mode 'O-1PS'");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1016,7 +1016,7 @@ void failedHandler(String msg) {
|
||||
void co2Calibration(void) {
|
||||
/** Count down for co2CalibCountdown secs */
|
||||
for (int i = 0; i < SENSOR_CO2_CALIB_COUNTDOWN_MAX; i++) {
|
||||
Serial.printf("Start CO2 calib after %d sec\r\n",
|
||||
Serial.printf("Start CO2 calibration after %d sec\r\n",
|
||||
SENSOR_CO2_CALIB_COUNTDOWN_MAX - i);
|
||||
delay(1000);
|
||||
}
|
||||
@ -1024,16 +1024,16 @@ void co2Calibration(void) {
|
||||
if (ag.s8.setBaselineCalibration()) {
|
||||
Serial.println("Calibration success");
|
||||
delay(1000);
|
||||
Serial.println("Wait for calib finish...");
|
||||
Serial.println("Wait for calibration to finish...");
|
||||
int count = 0;
|
||||
while (ag.s8.isBaseLineCalibrationDone() == false) {
|
||||
delay(1000);
|
||||
count++;
|
||||
}
|
||||
Serial.printf("Calib finish after %d sec\r\n", count);
|
||||
Serial.printf("Calibration finished after %d sec\r\n", count);
|
||||
delay(2000);
|
||||
} else {
|
||||
Serial.println("Calibration failure!!!");
|
||||
Serial.println("Calibration failure");
|
||||
delay(2000);
|
||||
}
|
||||
}
|
||||
@ -1055,7 +1055,7 @@ static void updateWiFiConnect(void) {
|
||||
lastRetry = millis();
|
||||
WiFi.reconnect();
|
||||
|
||||
Serial.printf("Re-Connect WiFi\r\n");
|
||||
Serial.printf("Re-Connect to WiFi\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1070,10 +1070,10 @@ static void tvocUpdate(void) {
|
||||
noxRawIndex = ag.sgp41.getNoxRaw();
|
||||
|
||||
Serial.println();
|
||||
Serial.printf(" TVOC index: %d\r\n", tvocIndex);
|
||||
Serial.printf("TVOC raw index: %d\r\n", tvocRawIndex);
|
||||
Serial.printf(" NOx index: %d\r\n", noxIndex);
|
||||
Serial.printf(" NOx raw index: %d\r\n", noxRawIndex);
|
||||
Serial.printf("TVOC index: %d\r\n", tvocIndex);
|
||||
Serial.printf("TVOC raw: %d\r\n", tvocRawIndex);
|
||||
Serial.printf("NOx index: %d\r\n", noxIndex);
|
||||
Serial.printf("NOx raw: %d\r\n", noxRawIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1094,12 +1094,12 @@ static void pmUpdate(void) {
|
||||
pmsResult_1 = true;
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("[1] PMS0.1: %d\r\n", pm01_1);
|
||||
Serial.printf("[1] PMS2.5: %d\r\n", pm25_1);
|
||||
Serial.printf("[1] PMS10.0: %d\r\n", pm10_1);
|
||||
Serial.printf("[1]PMS3.0 Count: %d\r\n", pm03PCount_1);
|
||||
Serial.printf("[1] Temperature: %0.2f\r\n", temp_1);
|
||||
Serial.printf("[1] Humidity: %d\r\n", hum_1);
|
||||
Serial.printf("[1] PM1 ug/m3: %d\r\n", pm01_1);
|
||||
Serial.printf("[1] PM2.5 ug/m3: %d\r\n", pm25_1);
|
||||
Serial.printf("[1] PM10 ug/m3: %d\r\n", pm10_1);
|
||||
Serial.printf("[1] PM3.0 Count: %d\r\n", pm03PCount_1);
|
||||
Serial.printf("[1] Temperature in C: %0.2f\r\n", temp_1);
|
||||
Serial.printf("[1] Relative Humidity: %d\r\n", hum_1);
|
||||
} else {
|
||||
pm01_1 = -1;
|
||||
pm25_1 = -1;
|
||||
@ -1120,12 +1120,12 @@ static void pmUpdate(void) {
|
||||
pmsResult_2 = true;
|
||||
|
||||
Serial.println();
|
||||
Serial.printf("[2] PMS0.1: %d\r\n", pm01_2);
|
||||
Serial.printf("[2] PMS2.5: %d\r\n", pm25_2);
|
||||
Serial.printf("[2] PMS10.0: %d\r\n", pm10_2);
|
||||
Serial.printf("[2]PMS3.0 Count: %d\r\n", pm03PCount_2);
|
||||
Serial.printf("[2] Temperature: %0.2f\r\n", temp_2);
|
||||
Serial.printf("[2] Humidity: %d\r\n", hum_2);
|
||||
Serial.printf("[2] PM1 ug/m3: %d\r\n", pm01_2);
|
||||
Serial.printf("[2] PM2.5 ug/m3: %d\r\n", pm25_2);
|
||||
Serial.printf("[2] PM10 ug/m3: %d\r\n", pm10_2);
|
||||
Serial.printf("[2] PM3.0 Count: %d\r\n", pm03PCount_2);
|
||||
Serial.printf("[2] Temperature in C: %0.2f\r\n", temp_2);
|
||||
Serial.printf("[2] Relative Humidity: %d\r\n", hum_2);
|
||||
} else {
|
||||
pm01_2 = -1;
|
||||
pm25_2 = -1;
|
||||
@ -1193,7 +1193,7 @@ static void co2Update(void) {
|
||||
if (value >= 0) {
|
||||
co2Ppm = value;
|
||||
getCO2FailCount = 0;
|
||||
Serial.printf("CO2 index: %d\r\n", co2Ppm);
|
||||
Serial.printf("CO2 ppm: %d\r\n", co2Ppm);
|
||||
} else {
|
||||
getCO2FailCount++;
|
||||
Serial.printf("Get CO2 failed: %d\r\n", getCO2FailCount);
|
||||
@ -1211,7 +1211,7 @@ static void updateServerConfiguration(void) {
|
||||
if (hasSensorS8) {
|
||||
co2Calibration();
|
||||
} else {
|
||||
Serial.println("CO2 S8 not available, calib ignored");
|
||||
Serial.println("CO2 S8 not available, calibration ignored");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1223,13 +1223,13 @@ static void updateServerConfiguration(void) {
|
||||
int curHour = ag.s8.getAbcPeriod();
|
||||
Serial.printf("Current config: %d (hours)\r\n", curHour);
|
||||
if (curHour == newHour) {
|
||||
Serial.println("set 'abcDays' ignored");
|
||||
Serial.println("Set 'abcDays' ignored");
|
||||
} else {
|
||||
if (ag.s8.setAbcPeriod(agServer.getCo2AbcDaysConfig() * 24) ==
|
||||
false) {
|
||||
Serial.println("Set S8 abcDays period calib failed");
|
||||
Serial.println("Set S8 abcDays period calibration failed");
|
||||
} else {
|
||||
Serial.println("Set S8 abcDays period calib success");
|
||||
Serial.println("Set S8 abcDays period calibration success");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1246,10 +1246,10 @@ static void updateServerConfiguration(void) {
|
||||
mqttTask = NULL;
|
||||
}
|
||||
if (agMqtt.begin(mqttUri)) {
|
||||
Serial.println("Connect to new mqtt broker success");
|
||||
Serial.println("Connect to MQTT broker successful");
|
||||
createMqttTask();
|
||||
} else {
|
||||
Serial.println("Connect to new mqtt broker failed");
|
||||
Serial.println("Connect to MQTT broker failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user