Remove old and modified libs, switch to ESPAsyncWebserver, add support for ESP32-H2 and multiple Ethernet modules (#455)

* Asyncwebserver

* Squashed commit of the following:

commit 575ef02f593918ec6654c87407a4d11fc17071b8
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 17:56:11 2024 +0200

    merge master

commit 35e5adf4ecd80f9829e8801181f35dd2c1d94759
Merge: a2cc7be2 21adca01
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 17:41:04 2024 +0200

    Merge branch 'master' of github.com:technyon/nuki_hub into DM9051

commit a2cc7be2954cbd8767ab8186296c0b14134d1d0b
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:51:50 2024 +0200

    update nuki ble

commit 20c809f3dca28b29b219d1ff3a183f1981316de5
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:44:46 2024 +0200

    backup

commit dd41c218efb5270f5efeb734e64dff695920db16
Merge: 153000b5 e84b944a
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:40:03 2024 +0200

    Merge branch 'master' of github.com:technyon/nuki_hub into DM9051

commit 153000b5b1af7df1fbeb5263df94eb26f689cc0a
Author: technyon <j.o.schuemann@gmx.de>
Date:   Mon Aug 12 10:23:07 2024 +0200

    fix linker error

commit a93bbfbfc4301e46ff3696a763dd13c6c89efefb
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 11 11:27:07 2024 +0200

    backup

commit f611c75ce8c35f829bcad6cf7e86188f4b3ec331
Merge: f1964917 063fbab6
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 11 11:24:47 2024 +0200

    merge master

commit f1964917b4dade3920f1ecdb699c58630199e6da
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 15:17:45 2024 +0200

    update platformio.ini

commit f448e5e8a7e93be38e09e2ab0b622199a3721af6
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 11:28:09 2024 +0200

    add SPIClass instance for DM9051

commit 1f190e9aa08033535a2eb442a92e6e20409bbda1
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 11:22:26 2024 +0200

    add definitions and constructor for DM9051

commit 726b3602ae91594ee1210ad5b6714f75cc5e42a7
Merge: 50a2eb13 4af90cbc
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sat Aug 10 10:19:34 2024 +0200

    merge master

commit 50a2eb136d75d90921f1c6974f18bc107bddc123
Author: technyon <j.o.schuemann@gmx.de>
Date:   Fri Aug 9 11:52:09 2024 +0200

    add comment

commit 9437e485cae169efdf8e5a7bf188a1c7e792d1e5
Author: technyon <j.o.schuemann@gmx.de>
Date:   Sun Aug 4 08:29:21 2024 +0200

    move LAN8720 definitions to seperate file

* Remove Core 2 Ethernet library

* Custom Ethernet

* GPIO and Preferences

* H2
This commit is contained in:
iranl
2024-08-16 13:02:37 +02:00
committed by GitHub
parent 346c5c65d1
commit 9a896a7ab1
206 changed files with 4055 additions and 20829 deletions

View File

@@ -18,11 +18,10 @@ Feel free to join us on Discord: https://discord.gg/9nPq85bP4p
- Nuki Hub is compiled against all ESP32 models with Wi-Fi and Bluetooh Low Energy (BLE) which are supported by ESP-IDF 5.1.4 and Arduino Core 3.0.4.
- Tested stable builds are provided for the ESP32, ESP32-S3 and ESP32-C3.
- Untested builds are provided for the ESP32-Solo1.
- Support for the ESP32-C6 is experimental. There could be more frequent crashes than on other ESP32 devices and connections with the Nuki device could be slower than on other ESP32 devices.
- Support for the ESP32-C6 and ESP32-H2 is experimental. There could be more frequent crashes than on other ESP32 devices and connections with the Nuki device could be slower than on other ESP32 devices.
<b>Not supported ESP32 devices:</b>
- The ESP32-S2 has no BLE and as such can't run Nuki Hub.
- The ESP32-H2 has no Wi-FI and Nuki Hub is not compiled against this target because of this (at this time).
<b>Supported Nuki devices:</b>
- Nuki Smart Lock 1.0
@@ -36,7 +35,7 @@ Feel free to join us on Discord: https://discord.gg/9nPq85bP4p
- Nuki Keypad 2.0
<b>Supported Ethernet devices:</b><br>
As an alternative to Wi-Fi (which is available on any supported ESP32), the following ESP32 modules with wired ethernet are supported:
As an alternative to Wi-Fi (which is available on any supported ESP32), the following ESP32 modules with built-in wired ethernet are supported:
- [Olimex ESP32-POE](https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware)
- [Olimex ESP32-POE-ISO](https://www.olimex.com/Products/IoT/ESP32/ESP32-POE-ISO/open-source-hardware)
- [WT32-ETH01](http://en.wireless-tag.com/product-item-2.html)
@@ -45,6 +44,9 @@ As an alternative to Wi-Fi (which is available on any supported ESP32), the foll
- [LilyGO-T-ETH-POE](https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-POE)
- [GL-S10 (Revisions 2.1, 2.3 / 1.0 is not supported)](https://www.gl-inet.com/products/gl-s10/)
In principle all ESP32 (and variants) devices with built-in ethernet port are supported, but might require additional setup using the "Custom LAN setup" option.
See the "[Connecting via Ethernet](#connecting-via-ethernet-optional)" section for more information.
## Support Nuki Hub development
If you haven't ordered your Nuki product yet, you can support me by using my referrer code when placing your order:<br>
@@ -76,7 +78,7 @@ In a browser navigate to the IP address assigned to the ESP32 via DHCP (often fo
Next click on "Edit" below "MQTT and Network Configuration" and enter the address and port (usually 1883) of your MQTT broker and a username and a password if required by your MQTT broker.<br>
<br>
The firmware supports SSL encryption for MQTT, however most people and especially home users don't use this.<br>
In that case leave all fields starting with "MQTT SSL" blank. Otherwise see the "[MQTT Encryption](#mqtt-encryption-optional-wi-fi-and-lan8720-only)" section of this README.
In that case leave all fields starting with "MQTT SSL" blank. Otherwise see the "[MQTT Encryption](#mqtt-encryption-optional)" section of this README.
## Pairing with a Nuki Lock or Opener
@@ -114,9 +116,9 @@ In a browser navigate to the IP address assigned to the ESP32.
- Home Assistant discovery topic: Set to the Home Assistant auto discovery topic, leave empty to disable auto discovery. Usually "homeassistant" unless you manually changed this setting on the Home Assistant side.
- Home Assistant device configuration URL: When using Home Assistant discovery the link to the Nuki Hub Web Configuration will be published to Home Assistant. By default when this setting is left empty this will link to the current IP of the Nuki Hub. When using a reverse proxy to access the Web Configuration you can set a custom URL here.
- Set Nuki Opener Lock/Unlock action in Home Assistant to Continuous mode (Opener only): By default the lock entity in Home Assistant will enable Ring-to-Open (RTO) when unlocking and disable RTO when locking. By enabling this setting this behaviour will change and now unlocking will enable Continuous Mode and locking will disable Continuous Mode, for more information see the "[Home Assistant Discovery](#home-assistant-discovery-optional)" section of this README.
- MQTT SSL CA Certificate: Optionally set to the CA SSL certificate of the MQTT broker, see the "[MQTT Encryption](#mqtt-encryption-optional-wi-fi-and-lan8720-only)" section of this README.
- MQTT SSL Client Certificate: Optionally set to the Client SSL certificate of the MQTT broker, see the "[MQTT Encryption](#mqtt-encryption-optional-wi-fi-and-lan8720-only)" section of this README.
- MQTT SSL Client Key: Optionally set to the Client SSL key of the MQTT broker, see the "[MQTT Encryption](#mqtt-encryption-optional-wi-fi-and-lan8720-only)" section of this README.
- MQTT SSL CA Certificate: Optionally set to the CA SSL certificate of the MQTT broker, see the "[MQTT Encryption](#mqtt-encryption-optional)" section of this README.
- MQTT SSL Client Certificate: Optionally set to the Client SSL certificate of the MQTT broker, see the "[MQTT Encryption](#mqtt-encryption-optional)" section of this README.
- MQTT SSL Client Key: Optionally set to the Client SSL key of the MQTT broker, see the "[MQTT Encryption](#mqtt-encryption-optional)" section of this README.
- Network hardware: "Wi-Fi only" by default, set to one of the specified ethernet modules if available, see the "Supported Ethernet devices" and "[Connecting via Ethernet](#connecting-via-ethernet-optional)" section of this README.
- Disable fallback to Wi-Fi / Wi-Fi config portal: By default the Nuki Hub will fallback to Wi-Fi and open the Wi-Fi configuration portal when the network connection fails. Enable this setting to disable this fallback.
- Connect to AP with the best signal in an environment with multiple APs with the same SSID: Enable to perform a scan for the Access Point with the best signal strenght for the specified SSID in a multi AP/Mesh environment.
@@ -302,7 +304,7 @@ In a browser navigate to the IP address assigned to the ESP32.
### Maintanence
- maintenance/networkDevice: Set to the name of the network device that is used by the ESP. When using Wi-Fi will be set to "Built-in Wi-Fi". If using Ethernet will be set to "Wiznet W5500", "Olimex (LAN8720)", "WT32-ETH01", "M5STACK PoESP32 Unit", "LilyGO T-ETH-POE" or "GL-S10".
- maintenance/networkDevice: Set to the name of the network device that is used by the ESP. When using Wi-Fi will be set to "Built-in Wi-Fi". If using Ethernet will be set to "Wiznet W5500", "ETH01-Evo", "Olimex (LAN8720)", "WT32-ETH01", "M5STACK PoESP32 Unit", "LilyGO T-ETH-POE" or "GL-S10".
- maintenance/reset: Set to 1 to trigger a reboot of the ESP. Auto-resets to 0.
- maintenance/update: Set to 1 to auto update Nuki Hub to the latest version from GitHub. Requires the setting "Allow updating using MQTT" to be enabled. Auto-resets to 0.
- maintenance/mqttConnectionState: Last Will and Testament (LWT) topic. "online" when Nuki Hub is connected to the MQTT broker, "offline" if Nuki Hub is not connected to the MQTT broker.
@@ -441,7 +443,7 @@ Updating to version 9.00 requires a change to the partition table of the ESP32.<
Please follow the instructions for the [First time installation](#first-time-installation) once when updating to Nuki Hub 9.00 from an earlier version.<br>
Your settings will not be affected when updating using the above instructions (do not select erase device when updating using Webflash).<br>
## MQTT Encryption (optional; Wi-Fi and LAN8720 only)
## MQTT Encryption (optional)
The communication via MQTT can be SSL encrypted.<br>
To enable SSL encryption, supply the necessary information in the MQTT Configuration page.<br>
@@ -607,28 +609,27 @@ To enable GPIO control, go the the "GPIO Configuration" page where each GPIO can
## Connecting via Ethernet (Optional)
If you prefer to connect to the MQTT Broker via Ethernet instead of Wi-Fi, you either use one of the supported ESP32 modules (see about section above),
or wire a seperate Wiznet W5x00 Module (W5100, W5200, W5500 are supported). To use a supported module, flash the firmware, connect via Wi-Fi and
select the correct network hardware in the "MQTT and Network Configuration" section.
If you prefer to connect to via Ethernet instead of Wi-Fi, you either use one of the supported ESP32 modules with built-in ethernet (see "[Supported devices](#supported-devices)" section)
or wire a seperate SPI Ethernet module.<Br>
Currently the Wiznet W5x00 Module (W5100, W5200, W5500), DN9051 and KSZ8851SNL chips are supported.<br>
To use a supported module, flash the firmware, connect via Wi-Fi and select the correct network hardware in the "MQTT and Network Configuration" section.
To wire an external W5x00 module to the ESP, use this wiring scheme:
- Connect W5x00 to ESP32 SPI0:<br>
- W5x00 SCK to GPIO18<br>
- W5x00 MISO to GPIO19<br>
- W5x00 MOSI to GPIO23<br>
- W5x00 CS/SS to GPIO5<br>
- Optionally connect:<br>
- W5x00 reset to GPIO33<br>
- Connect W5x00 to ESP32 SPI:<br>
- W5x00 SCK to GPIO 8<br>
- W5x00 MISO to GPIO 9<br>
- W5x00 MOSI to GPIO 10<br>
- W5x00 CS/SS to GPIO 5<br>
Optional:
- W5x00 RST to GPIO 4<br>
- W5x00 INT/IRQ to GPIO 3<br>
Now connect via Wi-Fi and change the network hardware to "Generic W5500".<br>
If the W5500 hwardware isn't detected, Wi-Fi is used as a fallback.<br>
If Ethernet hwardware isn't detected, Wi-Fi is used as a fallback, unless this is disabled in the settings.<br>
<br>
Note: Encrypted MQTT is only available for Wi-Fi and LAN8720 modules, W5x00 modules don't support encryption<br>
(that leaves Olimex, WT32-ETH01 and M5Stack PoESP32 Unit if encryption is desired).<br>
Note: LAN8720 modules are only supported on the ESP32, not on the ESP32-S3, ESP32-C3 or ESP-C6<br>
<br>
If encryption is needed, Olimex is the easiest option, since it has USB for flashing onboard.
Note: LAN8720 modules are only supported on the ESP32 and ESP32-Solo1, not on the ESP32-S3, ESP32-C3 or ESP-C6<br>
## Troubleshooting
@@ -716,7 +717,7 @@ source .venv/bin/activate
git clone https://github.com/technyon/nuki_hub --recursive
cd nuki_hub
# install tools platformio and esptool
# install tools platformio and esptool
make deps
# build all binary boards