From 94b94d8a91c059961250749e998df9577ce1049e Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 26 Jun 2018 13:54:06 +0200 Subject: [PATCH] more ota debugging --- src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f69ecf0..c5a0af2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -237,6 +237,9 @@ void ICACHE_FLASH_ATTR sendValues() { rssiObject["value"] = sd.rssi; root["rssi"] = sd.rssi; + root["millis"] = millis(); + root["heap"] = ESP.getFreeHeap(); + char buffer[500]; array.printTo(buffer, sizeof(buffer)); @@ -361,6 +364,10 @@ void ICACHE_FLASH_ATTR sendValues() { mqttclient.loop(); mqttclient.disconnect(); + if (sd.rssi == 0) { // re-read rssi if zero + sd.rssi = WiFi.RSSI(); + } + if (loop_count == 1) { XD0OTA ota; ota.update(); @@ -407,7 +414,7 @@ void setup() { geigeraverage.clear(); - previousMillis = millis(); + previousMillis = rtcMillis(); DEBUG_MSG("ready.\n"); //Serial.flush(); }