|
|
@ -92,6 +92,12 @@ void setup() { |
|
|
|
bme280Topic = "esp32-node/stat/" + iot.hostname + "/bme280"; |
|
|
|
batteryTopic = "esp32-node/stat/" + iot.hostname + "/battery"; |
|
|
|
|
|
|
|
/*
|
|
|
|
//Use the web object to add elements to the interface
|
|
|
|
iot.web.addInterfaceElement("color", "input", "", "#configform", "LampColor"); |
|
|
|
iot.web.setInterfaceElementAttribute("color", "type", "text"); |
|
|
|
*/ |
|
|
|
|
|
|
|
esp_sleep_wakeup_cause_t wakeup_reason = esp_sleep_get_wakeup_cause(); |
|
|
|
switch(wakeup_reason) { |
|
|
|
case ESP_SLEEP_WAKEUP_EXT0: |
|
|
@ -399,7 +405,7 @@ void loop() |
|
|
|
|
|
|
|
strftime(timeStr, sizeof(timeStr), "%H:%M:%S", &timeinfo); |
|
|
|
sprintf(weatherStr, "%.1f°C %.1f%% %.0fhPa", bme280.readTemperature(), bme280.readHumidity(), bme280.readPressure()); |
|
|
|
sprintf(statusStr, "%.1f°C %dmV %u %s", temperatureRead(), voltage, ESP.getFreeHeap()/1024, isAlarmActive()?"A":"_"); |
|
|
|
sprintf(statusStr, "%.1f %dmV %ddBm %ukB %s", temperatureRead(), voltage, WiFi.RSSI(), ESP.getFreeHeap()/1024, isAlarmActive()?"A":"_"); |
|
|
|
|
|
|
|
Serial.print("Free Heap: "); |
|
|
|
Serial.println(ESP.getFreeHeap()); |
|
|
|