The update mechanism is now always enabled.

This commit is contained in:
klaute 2018-06-24 15:53:58 +02:00
parent cf162c9dce
commit b2d513dcde
2 changed files with 8 additions and 24 deletions

View file

@ -1,4 +1,5 @@
#define DEBUG 1
//#define DEBUG 1
#define SENSOR_TEMPERATURE 0 #define SENSOR_TEMPERATURE 0
#define SENSOR_HUMIDITY 1 #define SENSOR_HUMIDITY 1

View file

@ -40,9 +40,6 @@ Influxdb influxdb(INFLUXDB_HOST, INFLUXDB_PORT);
Adafruit_APDS9960 apds; Adafruit_APDS9960 apds;
Adafruit_BME280 bme; Adafruit_BME280 bme;
boolean webUpdaterEnabled = false;
uint16_t webserver_timeout = 0;
//*************************************************************************// //*************************************************************************//
void setup() { void setup() {
@ -85,35 +82,20 @@ void setup() {
while (1); while (1);
} }
setupWebUpdater();
delay(100); delay(100);
digitalWrite(STATUS_LED_PIN, LOW);
} }
//*************************************************************************// //*************************************************************************//
void loop() { void loop() {
//if (INITIAL_WEBSERVER_TIME * 1000 > webserver_timeout) { doWebUpdater();
if (webserver_timeout == 0) {
setupWebUpdater();
}
doWebUpdater();
#ifdef DEBUG #ifdef DEBUG
//Serial.print(".");
#endif
webserver_timeout++;
//delay(1);
//return;
//}
/**/
digitalWrite(STATUS_LED_PIN, LOW);
#ifdef DEBUG
//Serial.println("---");
digitalWrite(STATUS_LED_PIN, HIGH); digitalWrite(STATUS_LED_PIN, HIGH);
#endif #endif
currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature(); currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature();
@ -134,6 +116,7 @@ void loop() {
pushToInfluxDB(DEVICE_NAME, currentSensorData); pushToInfluxDB(DEVICE_NAME, currentSensorData);
//ESP.deepSleep(UPDATE_INTERVAL * 1000000);
delay(UPDATE_INTERVAL * 1000); delay(UPDATE_INTERVAL * 1000);
/**/ /**/
} }