mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-06 12:46:32 +02:00
Better server configure for abcDays
debug message
This commit is contained in:
@ -569,14 +569,19 @@ static void serverConfigPoll(void) {
|
||||
co2Calibration();
|
||||
}
|
||||
if (agServer.getCo2AbcDaysConfig() > 0) {
|
||||
int newHour = agServer.getCo2AbcDaysConfig() * 24;
|
||||
Serial.printf("abcDays config: %d days(%d hours)\r\n",
|
||||
agServer.getCo2AbcDaysConfig(),
|
||||
agServer.getCo2AbcDaysConfig() * 24);
|
||||
agServer.getCo2AbcDaysConfig(), newHour);
|
||||
int curHour = ag.s8.getAbcPeriod();
|
||||
Serial.printf("Current config: %d (hours)\r\n", ag.s8.getAbcPeriod());
|
||||
if (ag.s8.setAbcPeriod(agServer.getCo2AbcDaysConfig() * 24) == false) {
|
||||
Serial.println("Set S8 abcDays period calib failed");
|
||||
if (curHour == newHour) {
|
||||
Serial.println("set 'abcDays' ignored");
|
||||
} else {
|
||||
Serial.println("Set S8 abcDays period calib success");
|
||||
if (ag.s8.setAbcPeriod(agServer.getCo2AbcDaysConfig() * 24) == false) {
|
||||
Serial.println("Set S8 abcDays period calib failed");
|
||||
} else {
|
||||
Serial.println("Set S8 abcDays period calib success");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -774,7 +774,7 @@ void webServerMeasureCurrentGet(void) {
|
||||
webServer.send(200, "application/json", getServerSyncData());
|
||||
}
|
||||
|
||||
void webServerHandler(void* param) {
|
||||
void webServerHandler(void *param) {
|
||||
for (;;) {
|
||||
webServer.handleClient();
|
||||
}
|
||||
@ -1269,17 +1269,24 @@ static void serverConfigPoll(void) {
|
||||
if (agServer.isCo2Calib()) {
|
||||
co2Calibration();
|
||||
}
|
||||
|
||||
if (agServer.getCo2AbcDaysConfig() > 0) {
|
||||
int newHour = agServer.getCo2AbcDaysConfig() * 24;
|
||||
Serial.printf("abcDays config: %d days(%d hours)\r\n",
|
||||
agServer.getCo2AbcDaysConfig(),
|
||||
agServer.getCo2AbcDaysConfig() * 24);
|
||||
agServer.getCo2AbcDaysConfig(), newHour);
|
||||
int curHour = ag.s8.getAbcPeriod();
|
||||
Serial.printf("Current config: %d (hours)\r\n", ag.s8.getAbcPeriod());
|
||||
if (ag.s8.setAbcPeriod(agServer.getCo2AbcDaysConfig() * 24) == false) {
|
||||
Serial.println("Set S8 abcDays period calib failed");
|
||||
if (curHour == newHour) {
|
||||
Serial.println("set 'abcDays' ignored");
|
||||
} else {
|
||||
Serial.println("Set S8 abcDays period calib success");
|
||||
if (ag.s8.setAbcPeriod(agServer.getCo2AbcDaysConfig() * 24) == false) {
|
||||
Serial.println("Set S8 abcDays period calib failed");
|
||||
} else {
|
||||
Serial.println("Set S8 abcDays period calib success");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (agServer.isLedBarTestRequested()) {
|
||||
if (agServer.getCountry() == "TH") {
|
||||
ledTest2Min();
|
||||
|
@ -444,10 +444,8 @@ public:
|
||||
}
|
||||
|
||||
/** Register event */
|
||||
if (esp_mqtt_client_register_event(
|
||||
client, MQTT_EVENT_ANY,
|
||||
mqtt_event_handler,
|
||||
NULL) != ESP_OK) {
|
||||
if (esp_mqtt_client_register_event(client, MQTT_EVENT_ANY,
|
||||
mqtt_event_handler, NULL) != ESP_OK) {
|
||||
Serial.println("mqtt client register event failed");
|
||||
return false;
|
||||
}
|
||||
@ -980,15 +978,22 @@ static void serverConfigPoll(void) {
|
||||
if (agServer.isCo2Calib()) {
|
||||
co2Calibration();
|
||||
}
|
||||
|
||||
if (agServer.getCo2AbcDaysConfig() > 0) {
|
||||
int newHour = agServer.getCo2AbcDaysConfig() * 24;
|
||||
Serial.printf("abcDays config: %d days(%d hours)\r\n",
|
||||
agServer.getCo2AbcDaysConfig(),
|
||||
agServer.getCo2AbcDaysConfig() * 24);
|
||||
agServer.getCo2AbcDaysConfig(), newHour);
|
||||
int curHour = ag.s8.getAbcPeriod();
|
||||
Serial.printf("Current config: %d (hours)\r\n", ag.s8.getAbcPeriod());
|
||||
if (ag.s8.setAbcPeriod(agServer.getCo2AbcDaysConfig() * 24) == false) {
|
||||
Serial.println("Set S8 abcDays period calib failed");
|
||||
if (curHour == newHour) {
|
||||
Serial.println("set 'abcDays' ignored");
|
||||
} else {
|
||||
Serial.println("Set S8 abcDays period calib success");
|
||||
if (ag.s8.setAbcPeriod(agServer.getCo2AbcDaysConfig() * 24) ==
|
||||
false) {
|
||||
Serial.println("Set S8 abcDays period calib failed");
|
||||
} else {
|
||||
Serial.println("Set S8 abcDays period calib success");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user