From 2e1c4cf7a00b7eadc29998359dd05b1eb14f1d72 Mon Sep 17 00:00:00 2001 From: Gregg Date: Mon, 4 Sep 2023 22:22:36 -0500 Subject: [PATCH 1/4] Update 15-RealPushButtons.ino --- examples/15-RealPushButtons/15-RealPushButtons.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/15-RealPushButtons/15-RealPushButtons.ino b/examples/15-RealPushButtons/15-RealPushButtons.ino index 491a97f..25f3fd1 100644 --- a/examples/15-RealPushButtons/15-RealPushButtons.ino +++ b/examples/15-RealPushButtons/15-RealPushButtons.ino @@ -248,7 +248,7 @@ void loop(){ // For example, if you were using an MCP I/O Port Expander with the Adafruit mcp library, you could create a triggerType function for a pin // on the MCP device that is connected to ground through a pushbutton as such: // - // boolean MCP_READ(int mcpPin) { return ( !mcp.digitalRead(mcpPin); ) } + // boolean MCP_READ(int mcpPin) { return ( !mcp.digitalRead(mcpPin) ); } // // And then simply pass MCP_READ to SpanButton as the triggerType parameter using any of the SpanButton constuctors: // @@ -258,7 +258,7 @@ void loop(){ // // Alternatively, you can use a lambda function as the triggerType parameter, thus creating your function on the fly when instantiating a SpanButton: // - // new SpanButton(23,[](int mcpPin)->boolean{ return ( !mcp.digitalRead(mcpPin); ) } + // new SpanButton(23,[](int mcpPin)->boolean{ return ( !mcp.digitalRead(mcpPin) ); }); // // Note: If you create your own triggerType function, don't forget to perform any initialization of the "pin", or setup/configuration of a // pin extender, etc., prior to instantiating a SpanButton that uses your custom function. HomeSpan cannot do this for you. From 30163c1214932125fe30d5d44ae53db403828723 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Tue, 12 Sep 2023 08:10:46 -0500 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a25c9a..b0b59f8 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Welcome to HomeSpan - a robust and extremely easy-to-use Arduino library for cre HomeSpan provides a microcontroller-focused implementation of Apple's HomeKit Accessory Protocol Specification Release R2 (HAP-R2) designed specifically for the Espressif ESP32 microcontroller running within the Arduino IDE. HomeSpan pairs directly to HomeKit via your home WiFi network without the need for any external bridges or components. With HomeSpan you can use the full power of the ESP32's I/O functionality to create custom control software and/or hardware to automatically operate external devices from the Home App on your iPhone, iPad, or Mac, or with Siri. -HomeSpan requires version 2.0.0 or later of the [Arduino-ESP32 Board Manager](https://github.com/espressif/arduino-esp32), and has been tested up through version 2.0.9 (recommended). HomeSpan can be run on the original ESP32 as well as Espressif's ESP32-S2, ESP32-C3, and ESP32-S3 chips. +HomeSpan requires version 2.0.0 or later of the [Arduino-ESP32 Board Manager](https://github.com/espressif/arduino-esp32), and has been tested up through version 2.0.11 (recommended). HomeSpan can be run on the original ESP32 as well as Espressif's ESP32-S2, ESP32-C3, and ESP32-S3 chips. ### HomeSpan Highlights From 831d3640cc9e2f0ff60c870d3a93505d3cd4adf6 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Fri, 15 Sep 2023 18:41:03 -0500 Subject: [PATCH 3/4] Update Reference.md --- docs/Reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Reference.md b/docs/Reference.md index 472c8cb..1c49200 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -29,7 +29,7 @@ At runtime HomeSpan will create a global **object** named `homeSpan` that suppor The following **optional** `homeSpan` methods override various HomeSpan initialization parameters used in `begin()`, and therefore **should** be called before `begin()` to take effect. If a method is *not* called, HomeSpan uses the default parameter indicated below: * `void setControlPin(uint8_t pin)` - * sets the ESP32 pin to use for the HomeSpan Control Button. If not specified, HomeSpan will assume there is no Control Button + * sets the ESP32 pin to use for the HomeSpan Control Button (which must connect the specified pin to **ground** when pushed). If not specified, HomeSpan will assume there is no Control Button * `int getControlPin()` * returns the pin number of the HomeSpan Control Button as set by `setControlPin(pin)`, or -1 if no pin has been set From 2bda112780bd75981d50b2e950693142bfd3c480 Mon Sep 17 00:00:00 2001 From: Francois Date: Fri, 27 Oct 2023 08:17:06 -0400 Subject: [PATCH 4/4] Verbose WiFi Reconnect Add the ability to turn off WiFi reconnect messages. --- src/HomeSpan.cpp | 2 +- src/HomeSpan.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index 07dd911..fbf045d 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -408,7 +408,7 @@ void Span::checkConnect(){ LOG0("\n*** Can't connect to %s. You may type 'W ' to re-configure WiFi, or 'X ' to erase WiFi credentials. Will try connecting again in 60 seconds.\n\n",network.wifiData.ssid); waitTime=60000; } else { - addWebLog(true,"Trying to connect to %s. Waiting %d sec...",network.wifiData.ssid,waitTime/1000); + if (verboseWiFiReconnect) addWebLog(true,"Trying to connect to %s. Waiting %d sec...",network.wifiData.ssid,waitTime/1000); WiFi.begin(network.wifiData.ssid,network.wifiData.pwd); } diff --git a/src/HomeSpan.h b/src/HomeSpan.h index 5a22b59..6bfc1ba 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -243,6 +243,7 @@ class Span{ Network network; // configures WiFi and Setup Code via either serial monitor or temporary Access Point SpanWebLog webLog; // optional web status/log TaskHandle_t pollTaskHandle = NULL; // optional task handle to use for poll() function + boolean verboseWiFiReconnect = true; // Set to false to not print WiFi reconnect attempts messages SpanOTA spanOTA; // manages OTA process SpanConfig hapConfig; // track configuration changes to the HAP Accessory database; used to increment the configuration number (c#) when changes found @@ -345,6 +346,8 @@ class Span{ void setWebLogCSS(const char *css){webLog.css="\n" + String(css) + "\n";} + void setVerboseWiFiReconnect(bool verbose) { verboseWiFiReconnect = verbose;} + void autoPoll(uint32_t stackSize=8192, uint32_t priority=1, uint32_t cpu=0){ // start pollTask() xTaskCreateUniversal([](void *parms){for(;;)homeSpan.pollTask();}, "pollTask", stackSize, NULL, priority, &pollTaskHandle, cpu); LOG0("\n*** AutoPolling Task started with priority=%d\n\n",uxTaskPriorityGet(pollTaskHandle));