The update mechanism is now always enabled.
This commit is contained in:
parent
cf162c9dce
commit
b2d513dcde
2 changed files with 8 additions and 24 deletions
|
@ -1,4 +1,5 @@
|
|||
#define DEBUG 1
|
||||
|
||||
//#define DEBUG 1
|
||||
|
||||
#define SENSOR_TEMPERATURE 0
|
||||
#define SENSOR_HUMIDITY 1
|
||||
|
|
|
@ -40,9 +40,6 @@ Influxdb influxdb(INFLUXDB_HOST, INFLUXDB_PORT);
|
|||
Adafruit_APDS9960 apds;
|
||||
Adafruit_BME280 bme;
|
||||
|
||||
boolean webUpdaterEnabled = false;
|
||||
uint16_t webserver_timeout = 0;
|
||||
|
||||
//*************************************************************************//
|
||||
|
||||
void setup() {
|
||||
|
@ -85,35 +82,20 @@ void setup() {
|
|||
while (1);
|
||||
}
|
||||
|
||||
setupWebUpdater();
|
||||
|
||||
delay(100);
|
||||
|
||||
digitalWrite(STATUS_LED_PIN, LOW);
|
||||
}
|
||||
|
||||
//*************************************************************************//
|
||||
|
||||
void loop() {
|
||||
|
||||
//if (INITIAL_WEBSERVER_TIME * 1000 > webserver_timeout) {
|
||||
|
||||
if (webserver_timeout == 0) {
|
||||
setupWebUpdater();
|
||||
}
|
||||
doWebUpdater();
|
||||
|
||||
#ifdef DEBUG
|
||||
//Serial.print(".");
|
||||
#endif
|
||||
|
||||
webserver_timeout++;
|
||||
//delay(1);
|
||||
|
||||
//return;
|
||||
//}
|
||||
|
||||
/**/
|
||||
digitalWrite(STATUS_LED_PIN, LOW);
|
||||
|
||||
#ifdef DEBUG
|
||||
//Serial.println("---");
|
||||
digitalWrite(STATUS_LED_PIN, HIGH);
|
||||
#endif
|
||||
currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature();
|
||||
|
@ -134,6 +116,7 @@ void loop() {
|
|||
|
||||
pushToInfluxDB(DEVICE_NAME, currentSensorData);
|
||||
|
||||
//ESP.deepSleep(UPDATE_INTERVAL * 1000000);
|
||||
delay(UPDATE_INTERVAL * 1000);
|
||||
/**/
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue