From b3237f06ed8ce38fabb384bc1190d0b67740905c Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Thu, 8 Jul 2021 21:59:38 -0500 Subject: [PATCH 1/8] 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 51e6742..ce2722b 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -8,7 +8,7 @@ The HomeSpan Library is invoked by including *HomeSpan.h* in your Arduino sketch ## *homeSpan* -At runtime this HomeSpan will create a global **object** named `homeSpan` that supports the following methods: +At runtime HomeSpan will create a global **object** named `homeSpan` that supports the following methods: * `void begin(Category catID, const char *displayName, const char *hostNameBase, const char *modelName)` * initializes HomeSpan From 69efec0d6545d6a920d79628edc6847f180d63f0 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Sun, 11 Jul 2021 12:32:22 -0500 Subject: [PATCH 2/8] Update FAQ.md --- docs/FAQ.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index 6b8eefb..1b73503 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -36,6 +36,10 @@ * Not as present. Though with a compatible Ethernet board the ESP32 can be configured to run as an Ethernet Server, using MDNS over Ethernet does not work on the ESP32 due to some apparent problems with the Ethernet UDP stack. Unfortunately, HomeSpan and HAP-R2 require MDNS to operate. If anyone has managed to get an Ethernet version of MDNS working on an ESP32 please let me know - it would be great to add Ethernet support to HomeSpan. +#### Does HomeSpan work with SPI and I2C? + +* Yes, the standard Arduino libraries `SPI.h` and `Wire.h` both work well within the HomeSpan environment. Typically the code to read from an SPI or I2C device is implemented within the `loop()` method of a HomeSpan Service with any initialization being done in the constructor for that Service. See [TemperatureSensorI2C](https://github.com/HomeSpan/TempSensorI2C) for an illustrative example. + --- [↩️](README.md) Back to the Welcome page From d9fbab0c58c62741178aea0f87a7ecd12e3a8e17 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Sun, 25 Jul 2021 22:02:48 -0500 Subject: [PATCH 3/8] Update FAQ.md --- docs/FAQ.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index 1b73503..9b64a1d 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -40,6 +40,11 @@ * Yes, the standard Arduino libraries `SPI.h` and `Wire.h` both work well within the HomeSpan environment. Typically the code to read from an SPI or I2C device is implemented within the `loop()` method of a HomeSpan Service with any initialization being done in the constructor for that Service. See [TemperatureSensorI2C](https://github.com/HomeSpan/TempSensorI2C) for an illustrative example. +#### Can you add a Web Server to HomeSpan? + +* Yes, provided you implement your Web Server using standard ESP32-Arduino libraries, such as `WebServer.h`. See [ProgrammableHub](https://github.com/HomeSpan/ProgrammableHub) for an illustrative example of how to easily integrate a Web Server into HomeSpan. This project also covers various other advanced topics, including TCP slot management, dynamic creation of Accessories, and saving arbitrary data in the ESP32's NVS. +* Note *ESP32AsyncWebServer* cannot be used since it requires a TCP stack that is unfortunately incompatible with HomeSpan. + --- [↩️](README.md) Back to the Welcome page From 79a0175dda2e8ef92c472201eb736cc0655de368 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Mon, 23 Aug 2021 20:13:45 -0500 Subject: [PATCH 4/8] Update FAQ.md --- docs/FAQ.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index 9b64a1d..c214427 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -20,6 +20,10 @@ * No, HomeSpan is coded specifically for the ESP32 and will not operate on an ESP8266 device. +#### Will HomeSpan work on an ESP32-S2 or ESP32-C3? + +* HomeSpan is not presently configured for the S2 or C3 versions of the ESP32. Once Espressif publishes their initial stable release of the [Arduino-ESP32 2.0 library](https://github.com/espressif/arduino-esp32#esp32-s2-and-esp32-c3-support) (with support for the S2 and C3 chips), HomeSpan will be updated to run on those chips (to the extent possible). + #### How can I read HomeSpan's MDNS broadcast mentioned in the [OTA](OTA.md) documentation? * HomeSpan uses MDNS (multicast DNS) to broadcast a variety of HAP information used by Controllers wishing to pair with HomeSpan. Apple uses the name *Bonjour* to refer to MDNS, and originally included a Bonjour "Browser" in Safari that has since been discontinued. However, there are a number of alternative MDNS browsers available for free that operate on both the Mac and the iPhone, such as the [Discovery - DNS-SD Browser](https://apps.apple.com/us/app/discovery-dns-sd-browser/id1381004916?mt=12). You'll find all your HomeSpan devices, as well as any other HomeKit devices you may have, under the MDNS service named *_hap._tcp.* The fields broadcast by HomeSpan are a combination of all data elements requires by HAP (HAP-R2, Table 6-7) plus three additional HomeSpan fields: From aa128411c97f9ff3a6ef297a325b1c5491dd144c Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Wed, 8 Sep 2021 22:01:36 -0500 Subject: [PATCH 5/8] Update ServiceList.md --- docs/ServiceList.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ServiceList.md b/docs/ServiceList.md index 4e9bc54..57949ef 100644 --- a/docs/ServiceList.md +++ b/docs/ServiceList.md @@ -30,7 +30,7 @@ Additionally, when first starting up, HomeSpan begins by validating the device's | CarbonDioxideSensor | CarbonDioxideDetected | Name
StatusActive
StatusFault
StatusTampered
StatusLowBattery
CarbonDioxideLevel
CarbonDioxidePeakLevel | | CarbonMonoxideSensor | CarbonMonoxideDetected | Name
StatusActive
StatusFault
StatusTampered
StatusLowBattery
CarbonMonoxideLevel
CarbonMonoxidePeakLevel | | ContactSensor | ContactSensorState | Name
StatusActive
StatusFault
StatusTampered
StatusLowBattery | -| Door | CurrentPosition | TargetPosition
PositionState
Name
HoldPosition
ObstructionDetected | +| Door | CurrentPosition
TargetPosition
PositionState | Name
HoldPosition
ObstructionDetected | | Doorbell | ProgrammableSwitchEvent | Name
Volume
Brightness | | Fan | Active | Name
CurrentFanState
TargetFanState
RotationDirection
RotationSpeed
SwingMode
LockPhysicalControls | | Faucet | Active | StatusFault
Name | From 53b6a7dfc35d0c04d6335e695c393b1a14e93d32 Mon Sep 17 00:00:00 2001 From: Gregg Date: Sun, 19 Sep 2021 18:23:06 -0500 Subject: [PATCH 6/8] added version numbers for sodium and mbedtls --- src/SRP.cpp | 5 ++++- src/src.ino | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/SRP.cpp b/src/SRP.cpp index d18259a..2a5e185 100644 --- a/src/SRP.cpp +++ b/src/SRP.cpp @@ -144,7 +144,10 @@ void SRP6A::createPublicKey(){ void SRP6A::getPrivateKey(){ uint8_t privateKey[32]; - randombytes_buf(privateKey,16); // generate 32 random bytes using libsodium (which uses the ESP32 hardware-based random number generator) + randombytes_buf(privateKey,32); // generate 32 random bytes using libsodium (which uses the ESP32 hardware-based random number generator) + + for(int i=0;i<32;i++) + privateKey[i]=i+1; mbedtls_mpi_read_binary(&b,privateKey,32); } diff --git a/src/src.ino b/src/src.ino index 60385c0..b4f4742 100644 --- a/src/src.ino +++ b/src/src.ino @@ -3,12 +3,24 @@ // as well as compile and test from this point. This file is ignored when the library is included in other sketches. #include "HomeSpan.h" +#include +#include void setup() { Serial.begin(115200); homeSpan.setLogLevel(1); + + homeSpan.setStatusPin(5); + homeSpan.setControlPin(33); + + Serial.println(sodium_version_string()); + Serial.println(sodium_library_version_major()); + Serial.println(sodium_library_version_minor()); + char mb[64]; + mbedtls_version_get_string_full(mb); + Serial.println(mb); homeSpan.setHostNameSuffix("-lamp1"); homeSpan.setPortNum(1201); From 896418f1795a1b5e97dad2bd28283618c3ebd0f1 Mon Sep 17 00:00:00 2001 From: Gregg Date: Tue, 21 Sep 2021 05:48:12 -0500 Subject: [PATCH 7/8] Revert "added version numbers for sodium and mbedtls" This reverts commit 53b6a7dfc35d0c04d6335e695c393b1a14e93d32. --- src/SRP.cpp | 5 +---- src/src.ino | 12 ------------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/SRP.cpp b/src/SRP.cpp index 2a5e185..d18259a 100644 --- a/src/SRP.cpp +++ b/src/SRP.cpp @@ -144,10 +144,7 @@ void SRP6A::createPublicKey(){ void SRP6A::getPrivateKey(){ uint8_t privateKey[32]; - randombytes_buf(privateKey,32); // generate 32 random bytes using libsodium (which uses the ESP32 hardware-based random number generator) - - for(int i=0;i<32;i++) - privateKey[i]=i+1; + randombytes_buf(privateKey,16); // generate 32 random bytes using libsodium (which uses the ESP32 hardware-based random number generator) mbedtls_mpi_read_binary(&b,privateKey,32); } diff --git a/src/src.ino b/src/src.ino index b4f4742..60385c0 100644 --- a/src/src.ino +++ b/src/src.ino @@ -3,24 +3,12 @@ // as well as compile and test from this point. This file is ignored when the library is included in other sketches. #include "HomeSpan.h" -#include -#include void setup() { Serial.begin(115200); homeSpan.setLogLevel(1); - - homeSpan.setStatusPin(5); - homeSpan.setControlPin(33); - - Serial.println(sodium_version_string()); - Serial.println(sodium_library_version_major()); - Serial.println(sodium_library_version_minor()); - char mb[64]; - mbedtls_version_get_string_full(mb); - Serial.println(mb); homeSpan.setHostNameSuffix("-lamp1"); homeSpan.setPortNum(1201); From d9bcb3426daf679c501da21217a3556c642ab468 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Fri, 24 Sep 2021 06:20:29 -0500 Subject: [PATCH 8/8] Update README.md --- docs/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/README.md b/docs/README.md index a4cf170..18c0c45 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,6 +4,8 @@ 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)](https://developer.apple.com/homekit/specification/) 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. +> :exclamation: HomeSpan currently works only under the version 1 series of the Arduino-ESP32 board manager (the latest being version 1.0.6). The new version 2 series (including version 2.0.0 released by Espressif in Sep 2021) is not backwards compatible with version 1.0.6 and breaks HomeSpan. A new version of HomeSpan will be released shortly that is compatible with version 2.0.0 of the Arduino-ESP32 board manager. At this time please use version 1.0.6 of the board manager to compile HomeSpan sketches. + ### HomeSpan Highlights * Provides a natural, intuitive, and **very** easy-to-use framework