summaryrefslogtreecommitdiff
path: root/platformio
diff options
context:
space:
mode:
Diffstat (limited to 'platformio')
-rw-r--r--platformio/relayctl/src/config.def.h.example3
-rw-r--r--platformio/relayctl/src/main.cpp7
2 files changed, 8 insertions, 2 deletions
diff --git a/platformio/relayctl/src/config.def.h.example b/platformio/relayctl/src/config.def.h.example
index dd3d89b..52de4f7 100644
--- a/platformio/relayctl/src/config.def.h.example
+++ b/platformio/relayctl/src/config.def.h.example
@@ -1,6 +1,6 @@
#pragma once
-#define FW_VERSION 3
+#define FW_VERSION 7
#define DEFAULT_WIFI_AP_SSID ""
#define DEFAULT_WIFI_STA_SSID ""
@@ -28,5 +28,6 @@
// 12 bytes string
#define HOME_SECRET_SIZE 12
#define HOME_SECRET ""
+#define MQTT_BLINK 1
#define ARRAY_SIZE(X) sizeof((X))/sizeof((X)[0]) \ No newline at end of file
diff --git a/platformio/relayctl/src/main.cpp b/platformio/relayctl/src/main.cpp
index 0c4d469..8c3a0cb 100644
--- a/platformio/relayctl/src/main.cpp
+++ b/platformio/relayctl/src/main.cpp
@@ -34,7 +34,9 @@ static volatile enum WiFiConnectionState wifi_state = WiFiConnectionState::WAITI
static void* service = nullptr;
static WiFiEventHandler wifiConnectHandler, wifiDisconnectHandler;
static Ticker wifiTimer;
+#if MQTT_BLINK
static StopWatch blinkStopWatch;
+#endif
static DNSServer* dnsServer = nullptr;
@@ -127,7 +129,9 @@ void loop() {
service = new mqtt::MQTT();
((mqtt::MQTT*)service)->connect();
+#if MQTT_BLINK
blinkStopWatch.save();
+#endif
}
auto mqtt = (mqtt::MQTT*)service;
@@ -140,12 +144,13 @@ void loop() {
mqtt->sendStat();
}
+#if MQTT_BLINK
// periodically blink board led
if (blinkStopWatch.elapsed(5000)) {
- // PRINTF("free heap: %d\n", ESP.getFreeHeap());
board_led.blink(1, 10);
blinkStopWatch.save();
}
+#endif
}
} else {
if (dnsServer != nullptr)