Browse Source

The update mechanism is now always enabled.

klaute 2 years ago
parent
commit
b2d513dcde
2 changed files with 8 additions and 24 deletions
  1. 2
    1
      firmware/config.h
  2. 6
    23
      firmware/firmware.ino

+ 2
- 1
firmware/config.h View File

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

+ 6
- 23
firmware/firmware.ino View File

@@ -40,9 +40,6 @@ Influxdb influxdb(INFLUXDB_HOST, INFLUXDB_PORT);
40 40
 Adafruit_APDS9960 apds;
41 41
 Adafruit_BME280 bme;
42 42
 
43
-boolean webUpdaterEnabled = false;
44
-uint16_t webserver_timeout = 0;
45
-
46 43
 //*************************************************************************//
47 44
 
48 45
 void setup() {
@@ -85,35 +82,20 @@ void setup() {
85 82
     while (1);
86 83
   }
87 84
 
85
+  setupWebUpdater();
86
+
88 87
   delay(100);
88
+
89
+  digitalWrite(STATUS_LED_PIN, LOW);
89 90
 }
90 91
 
91 92
 //*************************************************************************//
92 93
 
93 94
 void loop() {
94 95
 
95
-  //if (INITIAL_WEBSERVER_TIME * 1000 > webserver_timeout) {
96
-
97
-    if (webserver_timeout == 0) {
98
-      setupWebUpdater();
99
-    }
100
-    doWebUpdater();
101
-
102
-#ifdef DEBUG
103
-    //Serial.print(".");
104
-#endif
105
-
106
-    webserver_timeout++;
107
-    //delay(1);
108
-
109
-    //return;
110
-  //}
111
-
112
-  /**/
113
-  digitalWrite(STATUS_LED_PIN, LOW);
96
+  doWebUpdater();
114 97
 
115 98
 #ifdef DEBUG
116
-  //Serial.println("---");
117 99
   digitalWrite(STATUS_LED_PIN, HIGH);
118 100
 #endif
119 101
   currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature();
@@ -134,6 +116,7 @@ void loop() {
134 116
 
135 117
   pushToInfluxDB(DEVICE_NAME, currentSensorData);
136 118
 
119
+  //ESP.deepSleep(UPDATE_INTERVAL * 1000000);
137 120
   delay(UPDATE_INTERVAL * 1000);
138 121
   /**/
139 122
 }

Loading…
Cancel
Save