From 9d27f395d8012c4fd1e3d74384d50d215679fecb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:28:37 +0100 Subject: [PATCH] Add ESP32 experimental support GPIOViewer when ``define USE_ESP32_GPIO_VIEWER`` is enabled --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/tasmota.ino | 15 +++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11631b509..d6382c1f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. ## [13.3.0.2] ### Added - HASPmota type `chart` (#20372) +- ESP32 experimental support GPIOViewer when ``define USE_ESP32_GPIO_VIEWER`` is enabled ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 6198b8991..f566b94db 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -124,6 +124,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258) - Support negative power on BL0942 using index 5..8 [#20322](https://github.com/arendst/Tasmota/issues/20322) - ESP32 used UART information +- ESP32 experimental support GPIOViewer when ``define USE_ESP32_GPIO_VIEWER`` is enabled - Berry `introspect.set()` for class attributes [#20339](https://github.com/arendst/Tasmota/issues/20339) - HASPmota `haspmota.page_show()` to change page [#20333](https://github.com/arendst/Tasmota/issues/20333) - HASPmota type `chart` [#20372](https://github.com/arendst/Tasmota/issues/20372) diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 7febc7a3b..aa8802215 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -17,6 +17,12 @@ along with this program. If not, see . */ +//#define USE_ESP32_GPIO_VIEWER +#ifdef USE_ESP32_GPIO_VIEWER +#include // Must me the first include in your project +GPIOViewer gpio_viewer; +#endif // USE_ESP32_GPIO_VIEWER + // Location specific includes #ifndef ESP32_STAGE // ESP32 Stage has no core_version.h file. Disable include via PlatformIO Option #include // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_7_1) @@ -892,6 +898,15 @@ void Scheduler(void) { #ifndef SYSLOG_UPDATE_SECOND SyslogAsync(false); #endif // SYSLOG_UPDATE_SECOND + +#ifdef USE_ESP32_GPIO_VIEWER + static bool gpio_viewer_wifi_connected = false; + if (!gpio_viewer_wifi_connected && !TasmotaGlobal.global_state.network_down) { + gpio_viewer_wifi_connected = true; + gpio_viewer.setSamplingInterval(200); // You can set the sampling interval in ms, if not set default is 100ms + gpio_viewer.begin(); + } +#endif // USE_ESP32_GPIO_VIEWER } void loop(void) {