mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-30 17:07:16 +02:00
Merge branch 'hotfix/factory-reset-offline-mode' into hotfix/offline-mode-should-not-show-server-status
This commit is contained in:
@ -402,9 +402,8 @@ static void factoryConfigReset(void) {
|
|||||||
mqttTask = NULL;
|
mqttTask = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Disconnect WIFI */
|
/** Reset WIFI */
|
||||||
wifiConnector.disconnect();
|
WiFi.disconnect(true, true);
|
||||||
wifiConnector.reset();
|
|
||||||
|
|
||||||
/** Reset local config */
|
/** Reset local config */
|
||||||
configuration.reset();
|
configuration.reset();
|
||||||
@ -440,7 +439,7 @@ static void factoryConfigReset(void) {
|
|||||||
static void wdgFeedUpdate(void) {
|
static void wdgFeedUpdate(void) {
|
||||||
ag->watchdog.reset();
|
ag->watchdog.reset();
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.println("External watchdog feed");
|
Serial.println("Offline mode or isPostToAirGradient = false: watchdog reset");
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,11 +583,6 @@ static void sendDataToAg() {
|
|||||||
stateMachine.handleLeds(AgStateMachineNormal);
|
stateMachine.handleLeds(AgStateMachineNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Must reset each 5min to avoid ESP32 reset
|
|
||||||
*/
|
|
||||||
static void resetWatchdog() { ag->watchdog.reset(); }
|
|
||||||
|
|
||||||
void dispSensorNotFound(String ss) {
|
void dispSensorNotFound(String ss) {
|
||||||
ss = ss + " not found";
|
ss = ss + " not found";
|
||||||
oledDisplay.setText("Sensor init", "Error:", ss.c_str());
|
oledDisplay.setText("Sensor init", "Error:", ss.c_str());
|
||||||
@ -1101,10 +1095,19 @@ static void updatePm(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void sendDataToServer(void) {
|
static void sendDataToServer(void) {
|
||||||
|
/** Ignore send data to server if postToAirGradient disabled */
|
||||||
|
if (configuration.isPostDataToAirGradient() == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||||
ag, &configuration);
|
ag, &configuration);
|
||||||
if (apiClient.postToServer(syncData)) {
|
if (apiClient.postToServer(syncData)) {
|
||||||
resetWatchdog();
|
ag->watchdog.reset();
|
||||||
|
Serial.println();
|
||||||
|
Serial.println(
|
||||||
|
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||||
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
measurements.bootCount++;
|
measurements.bootCount++;
|
||||||
|
Reference in New Issue
Block a user