diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml
index 76ff2a9..491d865 100644
--- a/.github/workflows/beta.yml
+++ b/.github/workflows/beta.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- board: [esp32, esp32-s3, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
+ board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
build: [release, debug]
env:
BOARD: ${{ matrix.board }}
@@ -62,11 +62,6 @@ jobs:
run: |
BOARD=`echo $BOARD | tr '[:lower:]' '[:upper:]'`
- # fix for docs
- if [ "$BOARD" = "ESP32DEV" ]; then
- BOARD="ESP32"
- fi
-
# look for documentation on flash and copy the command
command=`sed -n '/^Howto flash (esptool)$/,$p' ${DOC} | sed -n '/^## '"${BOARD}"'$/,\${ n; n; p; }' | head -n1`
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f6ad16f..6305dc1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- board: [esp32, esp32-s3, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
+ board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
build: [release, debug]
env:
BOARD: ${{ matrix.board }}
@@ -67,11 +67,6 @@ jobs:
run: |
BOARD=`echo $BOARD | tr '[:lower:]' '[:upper:]'`
- # fix for docs
- if [ "$BOARD" = "ESP32DEV" ]; then
- BOARD="ESP32"
- fi
-
# look for documentation on flash and copy the command
command=`sed -n '/^Howto flash (esptool)$/,$p' ${DOC} | sed -n '/^## '"${BOARD}"'$/,\${ n; n; p; }' | head -n1`
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 4a00ebb..652ee9d 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- board: [esp32, esp32-s3, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
+ board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
build: [release, debug]
env:
BOARD: ${{ matrix.board }}
@@ -84,11 +84,6 @@ jobs:
run: |
BOARD=`echo $BOARD | tr '[:lower:]' '[:upper:]'`
- # fix for docs
- if [ "$BOARD" = "ESP32DEV" ]; then
- BOARD="ESP32"
- fi
-
# look for documentation on flash and copy the command
command=`sed -n '/^Howto flash (esptool)$/,$p' ${DOC} | sed -n '/^## '"${BOARD}"'$/,\${ n; n; p; }' | head -n1`
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b8a2eb1..d1765e0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- board: [esp32, esp32-s3, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
+ board: [esp32, esp32-s3, esp32-s3-oct, esp32-c3, esp32-c6, esp32-h2, esp32-solo1]
build: [release, debug]
env:
BOARD: ${{ matrix.board }}
@@ -61,11 +61,6 @@ jobs:
run: |
BOARD=`echo $BOARD | tr '[:lower:]' '[:upper:]'`
- # fix for docs
- if [ "$BOARD" = "ESP32DEV" ]; then
- BOARD="ESP32"
- fi
-
# look for documentation on flash and copy the command
command=`sed -n '/^Howto flash (esptool)$/,$p' ${DOC} | sed -n '/^## '"${BOARD}"'$/,\${ n; n; p; }' | head -n1`
diff --git a/README.md b/README.md
index cd30f24..483d664 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,23 @@ As an alternative to Wi-Fi (which is available on any supported ESP32), the foll
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.
+## Recommended ESP32 devices
+
+- If WIFI6 is required: ESP32-C6
+- If PoE is required: Any of the above mentioned devices with PoE or any other ESP device in combination with a SPI Ethernet module ([W5500](https://www.aliexpress.com/w/wholesale-w5500.html)) and [PoE to Ethernet and USB type B/C splitter](https://aliexpress.com/w/wholesale-poe-splitter-usb-c.html)
+- If you want maximum performance and intend to run any or multiple of the following:
+ - a Nuki Lock and Nuki Opener and/or
+ - MQTT SSL and/or
+ - HTTP SSL and/or
+ - large amounts of keypad codes, timecontrol or authorization entries
+ - Developing/debugging Nuki devices and/or Nuki Hub
+
+ An ESP32-S3 with 2MB of PSRAM or more (look for an ESP32-S3 with the designation N>=4 and R>=2 such as an ESP32-S3 N16R8)
+
+- In general when buying a new device when size and a couple of dollars more or less are not an issue: An ESP32-S3 with 2MB of PSRAM or more.
+
+The ESP32-S3 is a dual-core CPU with many GPIO's, ability to enlarge RAM using PSRAM, ability to connect Ethernet modules over SPI and optionally power the device with a PoE splitter. The only functions missing from the ESP32-S3 as compared to other ESP devices is the ability to use some Ethernet modules only supported by the original ESP32 and the ability to connect over WIFI6 (C6)
+
## 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:
@@ -97,6 +114,34 @@ Enable "Register as app" before pairing to allow this. Otherwise the Bridge will
Hybrid mode allows you to use the official Nuki MQTT implemenation on a Nuki Lock 3.0 Pro, Nuki Lock 4.0 or Nuki Lock 4.0 Pro in conjunction with Nuki Hub.
See [hybrid mode](/HYBRID.md) for more information.
+## Memory constraints
+
+ESP32 devices have a limited amount of free RAM available.
+
+On version 9.01 of Nuki Hub with only a Nuki Lock connected the expected free amount of RAM/Heap available is around:
+- ESP32: 60 kilobytes / 60.000 bytes
+- Other variants (C3/S3/C6/H2): 90-120 kilobytes / 90.000-120.000 bytes
+
+This free amount of RAM can be reduced (temporarily) by certain actions (such as changing Nuki device config) or continuously when enabling the following:
+- Connecting both a Nuki opener and a Nuki lock to Nuki Hub
+- Enlarging stack sizes of the Nuki and Network task to accommodate large amounts of keypad codes, authorization entries or timecontrol entries
+- MQTT SSL (Costs about 30k RAM)
+- HTTP SSL (Costs about 30k RAM)
+- Developing/debugging Nuki devices and/or Nuki Hub, using WebSerial (Costs about 30k RAM)
+
+The currently available RAM/Heap can be found on the info page of the Web configurator of Nuki Hub.
+
+When the ESP32 runs out of available RAM this device can crash or otherwise unexpected behaviour can occur.
+
+Nuki Hub does allow for the use of embedded PSRAM on the regular binaries whenever it is available.
+PSRAM is usually 2, 4 or 8MB in size and thus greatly enlarges the 320kb of internal RAM that is available.
+It is basically impossible to run out of RAM when PSRAM is available.
+You can check on the info page of the Web configurator if PSRAM is available.
+
+Note that there are two build of Nuki Hub for the ESP32-S3 available.
+One for devices with no or Quad SPI PSRAM and one for devices with Octal SPI PSRAM.
+If your ESP32-S3 device has PSRAM but it is not detected please flash the other S3 binary.
+
## Configuration
In a browser navigate to the IP address assigned to the ESP32.
diff --git a/boards/nuki-esp32-s3-oct.json b/boards/nuki-esp32-s3-oct.json
new file mode 100644
index 0000000..1c52fbe
--- /dev/null
+++ b/boards/nuki-esp32-s3-oct.json
@@ -0,0 +1,50 @@
+{
+ "build": {
+ "arduino":{
+ "ldscript": "esp32s3_out.ld"
+ },
+ "core": "esp32",
+ "extra_flags": [
+ "-DARDUINO_ESP32S3_DEV",
+ "-DARDUINO_USB_MODE=1",
+ "-DARDUINO_RUNNING_CORE=1",
+ "-DARDUINO_EVENT_RUNNING_CORE=1"
+ ],
+ "f_cpu": "240000000L",
+ "f_flash": "80000000L",
+ "flash_mode": "qio",
+ "hwids": [
+ [
+ "0x303A",
+ "0x1001"
+ ]
+ ],
+ "mcu": "esp32s3",
+ "variant": "esp32s3"
+ },
+ "connectivity": [
+ "bluetooth",
+ "wifi"
+ ],
+ "debug": {
+ "default_tool": "esp-builtin",
+ "onboard_tools": [
+ "esp-builtin"
+ ],
+ "openocd_target": "esp32s3.cfg"
+ },
+ "frameworks": [
+ "arduino",
+ "espidf"
+ ],
+ "name": "ESP32-S3 (>=4 MB QD, OCTAL PSRAM)",
+ "upload": {
+ "flash_size": "4MB",
+ "maximum_ram_size": 327680,
+ "maximum_size": 4194304,
+ "require_upload_port": true,
+ "speed": 460800
+ },
+ "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
+ "vendor": "Espressif"
+}
diff --git a/boards/nuki-esp32-s3.json b/boards/nuki-esp32-s3.json
index 9dd0cf6..a45a34d 100644
--- a/boards/nuki-esp32-s3.json
+++ b/boards/nuki-esp32-s3.json
@@ -37,7 +37,7 @@
"arduino",
"espidf"
],
- "name": "ESP32-S3 (4 MB QD, No PSRAM)",
+ "name": "ESP32-S3 (>=4 MB QD, QUAD OR NO PSRAM)",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
diff --git a/pio_package_post.py b/pio_package_post.py
index 2e20791..b412cad 100644
--- a/pio_package_post.py
+++ b/pio_package_post.py
@@ -9,6 +9,8 @@ def get_board_name(env):
if env.get('BOARD') == 'esp32-solo1':
board = env.get('BOARD').replace('-', '')
+ elif env.get('BOARD') == 'nuki-esp32-s3-oct':
+ board = 'esp32s3oct'
return board
def create_target_dir(env):
diff --git a/platformio.ini b/platformio.ini
index a0f7376..ac95ee1 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -73,7 +73,7 @@ monitor_filters =
[env:esp32]
board = esp32dev
board_build.cmake_extra_args =
- -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults"
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32"
extra_scripts =
pre:pio_package_pre.py
post:pio_package_post.py
@@ -89,21 +89,33 @@ build_flags =
[env:esp32-c3]
extends = env:esp32
board = esp32-c3-devkitc-02
+board_build.cmake_extra_args =
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults"
[env:esp32-s3]
extends = env:esp32
board = nuki-esp32-s3
+board_build.cmake_extra_args =
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32-s3"
+
+[env:esp32-s3-oct]
+extends = env:esp32
+board = nuki-esp32-s3-oct
+board_build.cmake_extra_args =
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults;sdkconfig.defaults.esp32-s3-oct"
[env:esp32-c6]
extends = env:esp32
board = esp32-c6-devkitm-1
+board_build.cmake_extra_args =
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults"
[env:esp32-h2]
extends = env:esp32
board = esp32-h2-devkitm-1
board_build.cmake_extra_args =
-DNUKI_TARGET_H2=y
- -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults"
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.release.defaults"
lib_ignore =
BLE
BluetoothSerial
@@ -124,7 +136,7 @@ board_build.cmake_extra_args =
extends = env:esp32
custom_build = debug
board_build.cmake_extra_args =
- -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults"
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults;sdkconfig.defaults.esp32"
build_flags =
${env.build_flags}
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
@@ -213,7 +225,28 @@ build_flags =
extends = env:esp32-s3
custom_build = debug
board_build.cmake_extra_args =
- -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults"
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults;sdkconfig.defaults.esp32-s3"
+build_flags =
+ ${env.build_flags}
+ -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
+ -DCONFIG_NIMBLE_CPP_LOG_LEVEL=0
+ -DCONFIG_BT_NIMBLE_LOG_LEVEL=0
+ -DDEBUG_NUKIHUB
+ -DDEBUG_SENSE_NUKI
+ -DDEBUG_NUKI_COMMAND
+ -DDEBUG_NUKI_CONNECT
+ -DDEBUG_NUKI_COMMUNICATION
+ ;-DDEBUG_NUKI_HEX_DATA
+ -DDEBUG_NUKI_READABLE_DATA
+ -DCONFIG_ASYNC_TCP_QUEUE_SIZE=128
+ -DCONFIG_ASYNC_TCP_STACK_SIZE=8192
+ -DWS_MAX_QUEUED_MESSAGES=512
+
+[env:esp32-s3-oct_dbg]
+extends = env:esp32-s3-oct
+custom_build = debug
+board_build.cmake_extra_args =
+ -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.debug.defaults;sdkconfig.defaults.esp32-s3-oct"
build_flags =
${env.build_flags}
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG
diff --git a/resources/how-to-flash.txt b/resources/how-to-flash.txt
index 6d11dbe..fc2737d 100644
--- a/resources/how-to-flash.txt
+++ b/resources/how-to-flash.txt
@@ -36,6 +36,13 @@ e000 boot_app0.bin
10000 nuki_hub_esp32s3.bin
280000 nuki_hub_updater_esp32s3.bin
+ESP32-S3-OCT
+e000 boot_app0.bin
+0 bootloader.bin
+8000 nuki_hub.partitions.bin
+10000 nuki_hub_esp32s3oct.bin
+280000 nuki_hub_updater_esp32s3oct.bin
+
ESP32-C3
e000 boot_app0.bin
0 bootloader.bin
@@ -84,6 +91,10 @@ esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset
esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x0 bootloader.bin 0x10000 nuki_hub_esp32s3.bin 0x280000 nuki_hub_updater_esp32s3.bin 0x8000 nuki_hub.partitions.bin
+## ESP32-S3-OCT
+
+esptool.py --chip esp32s3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x0 bootloader.bin 0x10000 nuki_hub_esp32s3oct.bin 0x280000 nuki_hub_updater_esp32s3oct.bin 0x8000 nuki_hub.partitions.bin
+
## ESP32-C3
esptool.py --chip esp32c3 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq keep --flash_size detect 0xe000 boot_app0.bin 0x0 bootloader.bin 0x10000 nuki_hub_esp32c3.bin 0x280000 nuki_hub_updater_esp32c3.bin 0x8000 nuki_hub.partitions.bin
diff --git a/sdkconfig.debug.defaults b/sdkconfig.debug.defaults
index 19ac7c9..ee9344a 100644
--- a/sdkconfig.debug.defaults
+++ b/sdkconfig.debug.defaults
@@ -2,4 +2,6 @@ CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_ESP_IPC_TASK_STACK_SIZE=8192
CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
-CONFIG_BOOTLOADER_LOG_LEVEL=1
\ No newline at end of file
+CONFIG_BOOTLOADER_LOG_LEVEL=1
+CONFIG_FREERTOS_USE_TRACE_FACILITY=y
+CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
\ No newline at end of file
diff --git a/sdkconfig.defaults.esp32 b/sdkconfig.defaults.esp32
new file mode 100644
index 0000000..10a55c9
--- /dev/null
+++ b/sdkconfig.defaults.esp32
@@ -0,0 +1,6 @@
+CONFIG_SPIRAM=y
+CONFIG_SPIRAM_IGNORE_NOTFOUND=y
+CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
+CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
\ No newline at end of file
diff --git a/sdkconfig.defaults.esp32-s3 b/sdkconfig.defaults.esp32-s3
new file mode 100644
index 0000000..10a55c9
--- /dev/null
+++ b/sdkconfig.defaults.esp32-s3
@@ -0,0 +1,6 @@
+CONFIG_SPIRAM=y
+CONFIG_SPIRAM_IGNORE_NOTFOUND=y
+CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
+CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
\ No newline at end of file
diff --git a/sdkconfig.defaults.esp32-s3-oct b/sdkconfig.defaults.esp32-s3-oct
new file mode 100644
index 0000000..103353e
--- /dev/null
+++ b/sdkconfig.defaults.esp32-s3-oct
@@ -0,0 +1,7 @@
+CONFIG_SPIRAM=y
+CONFIG_SPIRAM_IGNORE_NOTFOUND=y
+CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
+CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
+CONFIG_SPIRAM_MODE_OCT=y
\ No newline at end of file
diff --git a/sdkconfig.defaults.esp32-solo1 b/sdkconfig.defaults.esp32-solo1
index 58ed5cc..2cb5c90 100644
--- a/sdkconfig.defaults.esp32-solo1
+++ b/sdkconfig.defaults.esp32-solo1
@@ -1 +1,7 @@
-CONFIG_FREERTOS_UNICORE=y
\ No newline at end of file
+CONFIG_FREERTOS_UNICORE=y
+CONFIG_SPIRAM=y
+CONFIG_SPIRAM_IGNORE_NOTFOUND=y
+CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y
+CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=50768
\ No newline at end of file
diff --git a/src/Config.h b/src/Config.h
index e161403..1a4d1cb 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -23,6 +23,20 @@
#define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32c3.bin"
#define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32c3.bin"
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
+#if defined(CONFIG_SPIRAM_MODE_OCT)
+#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3oct.bin"
+#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3oct.bin"
+#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32s3oct.bin"
+#define GITHUB_BETA_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_updater_esp32s3oct.bin"
+#define GITHUB_MASTER_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_esp32s3oct.bin"
+#define GITHUB_MASTER_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/master/nuki_hub_updater_esp32s3oct.bin"
+#define GITHUB_LATEST_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_esp32s3oct.bin"
+#define GITHUB_LATEST_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/nuki_hub_updater_esp32s3oct.bin"
+#define GITHUB_BETA_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_esp32s3oct.bin"
+#define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32s3oct.bin"
+#define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32s3oct.bin"
+#define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32s3oct.bin"
+#else
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32s3.bin"
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32s3.bin"
#define GITHUB_BETA_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/beta/nuki_hub_esp32s3.bin"
@@ -35,6 +49,7 @@
#define GITHUB_BETA_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/beta/nuki_hub_updater_esp32s3.bin"
#define GITHUB_MASTER_RELEASE_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_esp32s3.bin"
#define GITHUB_MASTER_UPDATER_BINARY_URL_DBG (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/debug/master/nuki_hub_updater_esp32s3.bin"
+#endif
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
#define GITHUB_LATEST_RELEASE_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_esp32c6.bin"
#define GITHUB_LATEST_UPDATER_BINARY_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/nuki_hub_updater_esp32c6.bin"
diff --git a/src/NukiOpenerWrapper.cpp b/src/NukiOpenerWrapper.cpp
index 8209c85..3ae17a7 100644
--- a/src/NukiOpenerWrapper.cpp
+++ b/src/NukiOpenerWrapper.cpp
@@ -256,10 +256,10 @@ void NukiOpenerWrapper::update()
if(_nextLockAction != (NukiOpener::LockAction)0xff)
{
- _retryCount = 0;
- Nuki::CmdResult cmdResult;
+ int retryCount = 0;
+ Nuki::CmdResult cmdResult = (Nuki::CmdResult)-1;
- while(_retryCount < _nrOfRetries + 1 && cmdResult != Nuki::CmdResult::Success)
+ while(retryCount < _nrOfRetries + 1 && cmdResult != Nuki::CmdResult::Success)
{
cmdResult = _nukiOpener.lockAction(_nextLockAction, 0, 0);
char resultStr[15] = {0};
@@ -275,15 +275,15 @@ void NukiOpenerWrapper::update()
Log->print(F("Opener: Last command failed, retrying after "));
Log->print(_retryDelay);
Log->print(F(" milliseconds. Retry "));
- Log->print(_retryCount + 1);
+ Log->print(retryCount + 1);
Log->print(" of ");
Log->println(_nrOfRetries);
- _network->publishRetry(std::to_string(_retryCount + 1));
+ _network->publishRetry(std::to_string(retryCount + 1));
delay(_retryDelay);
- ++_retryCount;
+ ++retryCount;
}
postponeBleWatchdog();
}
@@ -292,14 +292,14 @@ void NukiOpenerWrapper::update()
{
_nextLockAction = (NukiOpener::LockAction) 0xff;
_network->publishRetry("--");
- _retryCount = 0;
+ retryCount = 0;
if(_intervalLockstate > 10) _nextLockStateUpdateTs = ts + 10 * 1000;
}
else
{
Log->println(F("Opener: Maximum number of retries exceeded, aborting."));
_network->publishRetry("failed");
- _retryCount = 0;
+ retryCount = 0;
_nextLockAction = (NukiOpener::LockAction) 0xff;
}
}
@@ -380,17 +380,15 @@ void NukiOpenerWrapper::unpair()
void NukiOpenerWrapper::updateKeyTurnerState()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(result != Nuki::CmdResult::Success && retryCount < _nrOfRetries + 1)
{
- Log->print(F("Querying opener state: "));
+ Log->print(F("Result (attempt "));
+ Log->print(retryCount + 1);
+ Log->print("): ");
result =_nukiOpener.requestOpenerState(&_keyTurnerState);
-
- if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
- }
- else break;
+ ++retryCount;
}
char resultStr[15];
@@ -455,15 +453,15 @@ void NukiOpenerWrapper::updateKeyTurnerState()
void NukiOpenerWrapper::updateBatteryState()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Querying opener battery state: "));
result = _nukiOpener.requestBatteryReport(&_batteryReport);
delay(250);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -511,15 +509,15 @@ void NukiOpenerWrapper::updateConfig()
if(isPinSet()) {
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
Log->println(F("Nuki opener PIN is set"));
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
result = _nukiOpener.verifySecurityPin();
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -599,15 +597,15 @@ void NukiOpenerWrapper::updateAuthData(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Retrieve log entries: "));
result = _nukiOpener.retrieveLogEntries(0, _preferences->getInt(preference_authlog_max_entries, MAX_AUTHLOG), 1, false);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -672,15 +670,15 @@ void NukiOpenerWrapper::updateKeypad(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Querying opener keypad: "));
result = _nukiOpener.retrieveKeypadEntries(0, _preferences->getInt(preference_keypad_max_entries, MAX_KEYPAD));
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -739,15 +737,15 @@ void NukiOpenerWrapper::updateTimeControl(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Querying opener timecontrol: "));
result = _nukiOpener.retrieveTimeControlEntries();
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -800,15 +798,15 @@ void NukiOpenerWrapper::updateAuth(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries)
+ while(retryCount < _nrOfRetries)
{
Log->print(F("Querying opener authorization: "));
result = _nukiOpener.retrieveAuthorizationEntries(0, _preferences->getInt(preference_auth_max_entries, MAX_AUTH));
delay(250);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -1098,9 +1096,9 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
if((int)_basicOpenerConfigAclPrefs[i] == 1)
{
cmdResult = Nuki::CmdResult::Error;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(basicKeys[i], "name") == 0)
{
@@ -1256,7 +1254,7 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
}
if(cmdResult != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -1288,9 +1286,9 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
if((int)_advancedOpenerConfigAclPrefs[j] == 1)
{
cmdResult = Nuki::CmdResult::Error;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(advancedKeys[j], "intercomID") == 0)
{
@@ -1513,8 +1511,9 @@ void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
else jsonResult[advancedKeys[j]] = "invalidValue";
}
- if(cmdResult != Nuki::CmdResult::Success) {
- ++_retryCount;
+ if(cmdResult != Nuki::CmdResult::Success)
+ {
+ ++retryCount;
}
else break;
}
@@ -1614,9 +1613,9 @@ void NukiOpenerWrapper::onKeypadCommandReceived(const char *command, const uint
int codeInt = code.toInt();
bool codeValid = codeInt > 100000 && codeInt < 1000000 && (code.indexOf('0') == -1);
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(command, "add") == 0)
{
@@ -1705,7 +1704,7 @@ void NukiOpenerWrapper::onKeypadCommandReceived(const char *command, const uint
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -1799,9 +1798,9 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
}
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(action, "delete") == 0) {
if(idExists)
@@ -2151,7 +2150,7 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -2238,9 +2237,9 @@ void NukiOpenerWrapper::onTimeControlCommandReceived(const char *value)
}
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(action, "delete") == 0) {
if(idExists)
@@ -2377,7 +2376,7 @@ void NukiOpenerWrapper::onTimeControlCommandReceived(const char *value)
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -2471,11 +2470,12 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value)
}
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries)
+ while(retryCount < _nrOfRetries)
{
- if(strcmp(action, "delete") == 0) {
+ if(strcmp(action, "delete") == 0)
+ {
if(idExists)
{
result = _nukiOpener.deleteAuthorizationEntry(authId);
@@ -2835,7 +2835,7 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value)
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -2895,15 +2895,15 @@ void NukiOpenerWrapper::notify(Nuki::EventType eventType)
void NukiOpenerWrapper::readConfig()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
result = _nukiOpener.requestConfig(&_nukiConfig);
_nukiConfigValid = result == Nuki::CmdResult::Success;
if(!_nukiConfigValid) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -2921,15 +2921,15 @@ void NukiOpenerWrapper::readConfig()
void NukiOpenerWrapper::readAdvancedConfig()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
result = _nukiOpener.requestAdvancedConfig(&_nukiAdvancedConfig);
_nukiAdvancedConfigValid = result == Nuki::CmdResult::Success;
if(!_nukiAdvancedConfigValid) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
diff --git a/src/NukiOpenerWrapper.h b/src/NukiOpenerWrapper.h
index ffdfebd..1d5eb28 100644
--- a/src/NukiOpenerWrapper.h
+++ b/src/NukiOpenerWrapper.h
@@ -108,7 +108,6 @@ private:
bool _disableNonJSON = false;
int _nrOfRetries = 0;
int _retryDelay = 0;
- int _retryCount = 0;
int _retryConfigCount = 0;
int _retryLockstateCount = 0;
int64_t _nextRetryTs = 0;
diff --git a/src/NukiWrapper.cpp b/src/NukiWrapper.cpp
index 87868bb..6980df0 100644
--- a/src/NukiWrapper.cpp
+++ b/src/NukiWrapper.cpp
@@ -257,10 +257,10 @@ void NukiWrapper::update()
}
if(_nextLockAction != (NukiLock::LockAction)0xff)
{
- _retryCount = 0;
+ int retryCount = 0;
Nuki::CmdResult cmdResult;
- while(_retryCount < _nrOfRetries + 1 && cmdResult != Nuki::CmdResult::Success)
+ while(retryCount < _nrOfRetries + 1 && cmdResult != Nuki::CmdResult::Success)
{
cmdResult = _nukiLock.lockAction(_nextLockAction, 0, 0);
char resultStr[15] = {0};
@@ -275,15 +275,15 @@ void NukiWrapper::update()
Log->print(F("Lock: Last command failed, retrying after "));
Log->print(_retryDelay);
Log->print(F(" milliseconds. Retry "));
- Log->print(_retryCount + 1);
+ Log->print(retryCount + 1);
Log->print(" of ");
Log->println(_nrOfRetries);
- _network->publishRetry(std::to_string(_retryCount + 1));
+ _network->publishRetry(std::to_string(retryCount + 1));
delay(_retryDelay);
- ++_retryCount;
+ ++retryCount;
}
postponeBleWatchdog();
}
@@ -292,7 +292,7 @@ void NukiWrapper::update()
{
_nextLockAction = (NukiLock::LockAction) 0xff;
_network->publishRetry("--");
- _retryCount = 0;
+ retryCount = 0;
if(!_network->_offConnected) _statusUpdated = true; Log->println(F("Lock: updating status after action"));
_statusUpdatedTs = ts;
if(_intervalLockstate > 10) _nextLockStateUpdateTs = ts + 10 * 1000;
@@ -301,7 +301,7 @@ void NukiWrapper::update()
{
Log->println(F("Lock: Maximum number of retries exceeded, aborting."));
_network->publishRetry("failed");
- _retryCount = 0;
+ retryCount = 0;
_nextLockAction = (NukiLock::LockAction) 0xff;
}
}
@@ -443,20 +443,17 @@ void NukiWrapper::unpair()
void NukiWrapper::updateKeyTurnerState()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- Log->println("Querying lock state");
+ Log->println(F("Querying lock state"));
- while(_retryCount < _nrOfRetries + 1)
+ while(result != Nuki::CmdResult::Success && retryCount < _nrOfRetries + 1)
{
Log->print(F("Result (attempt "));
- Log->print(_retryCount + 1);
- Log->print("): ");
+ Log->print(retryCount + 1);
+ Log->print(F("): "));
result =_nukiLock.requestKeyTurnerState(&_keyTurnerState);
- if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
- }
- else break;
+ ++retryCount;
}
char resultStr[15];
@@ -519,19 +516,19 @@ void NukiWrapper::updateKeyTurnerState()
void NukiWrapper::updateBatteryState()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
Log->println("Querying lock battery state");
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Result (attempt "));
- Log->print(_retryCount + 1);
+ Log->print(retryCount + 1);
Log->print("): ");
result = _nukiLock.requestBatteryReport(&_batteryReport);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -578,14 +575,14 @@ void NukiWrapper::updateConfig()
if(isPinSet()) {
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
Log->println(F("Nuki Lock PIN is set"));
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
result = _nukiLock.verifySecurityPin();
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -665,14 +662,14 @@ void NukiWrapper::updateAuthData(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Retrieve log entries: "));
result = _nukiLock.retrieveLogEntries(0, _preferences->getInt(preference_authlog_max_entries, MAX_AUTHLOG), 1, false);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -736,14 +733,14 @@ void NukiWrapper::updateKeypad(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Querying lock keypad: "));
result = _nukiLock.retrieveKeypadEntries(0, _preferences->getInt(preference_keypad_max_entries, MAX_KEYPAD));
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -802,14 +799,14 @@ void NukiWrapper::updateTimeControl(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
Log->print(F("Querying lock timecontrol: "));
result = _nukiLock.retrieveTimeControlEntries();
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -862,15 +859,15 @@ void NukiWrapper::updateAuth(bool retrieved)
if(!retrieved)
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries)
+ while(retryCount < _nrOfRetries)
{
Log->print(F("Querying lock authorization: "));
result = _nukiLock.retrieveAuthorizationEntries(0, _preferences->getInt(preference_auth_max_entries, MAX_AUTH));
delay(250);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -1289,9 +1286,9 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
if((int)_basicLockConfigaclPrefs[i] == 1)
{
cmdResult = Nuki::CmdResult::Error;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(basicKeys[i], "name") == 0)
{
@@ -1469,7 +1466,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
}
if(cmdResult != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -1501,9 +1498,9 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
if((int)_advancedLockConfigaclPrefs[j] == 1)
{
cmdResult = Nuki::CmdResult::Error;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(advancedKeys[j], "unlockedPositionOffsetDegrees") == 0)
{
@@ -1753,7 +1750,7 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
}
if(cmdResult != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -1880,9 +1877,9 @@ void NukiWrapper::onKeypadCommandReceived(const char *command, const uint &id, c
int codeInt = code.toInt();
bool codeValid = codeInt > 100000 && codeInt < 1000000 && (code.indexOf('0') == -1);
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(command, "add") == 0)
{
@@ -1971,7 +1968,7 @@ void NukiWrapper::onKeypadCommandReceived(const char *command, const uint &id, c
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -2065,9 +2062,9 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
}
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(action, "delete") == 0) {
if(idExists)
@@ -2417,7 +2414,7 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -2504,9 +2501,9 @@ void NukiWrapper::onTimeControlCommandReceived(const char *value)
}
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
if(strcmp(action, "delete") == 0) {
if(idExists)
@@ -2645,7 +2642,7 @@ void NukiWrapper::onTimeControlCommandReceived(const char *value)
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -2739,9 +2736,9 @@ void NukiWrapper::onAuthCommandReceived(const char *value)
}
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries)
+ while(retryCount < _nrOfRetries)
{
if(strcmp(action, "delete") == 0) {
if(idExists)
@@ -3106,7 +3103,7 @@ void NukiWrapper::onAuthCommandReceived(const char *value)
}
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
}
else break;
}
@@ -3169,9 +3166,9 @@ void NukiWrapper::notify(Nuki::EventType eventType)
void NukiWrapper::readConfig()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
result = _nukiLock.requestConfig(&_nukiConfig);
_nukiConfigValid = result == Nuki::CmdResult::Success;
@@ -3182,7 +3179,7 @@ void NukiWrapper::readConfig()
Log->println(resultStr);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
Log->println("Failed to retrieve lock config, retrying in 1s");
delay(1000);
}
@@ -3193,9 +3190,9 @@ void NukiWrapper::readConfig()
void NukiWrapper::readAdvancedConfig()
{
Nuki::CmdResult result = (Nuki::CmdResult)-1;
- _retryCount = 0;
+ int retryCount = 0;
- while(_retryCount < _nrOfRetries + 1)
+ while(retryCount < _nrOfRetries + 1)
{
result = _nukiLock.requestAdvancedConfig(&_nukiAdvancedConfig);
_nukiAdvancedConfigValid = result == Nuki::CmdResult::Success;
@@ -3206,7 +3203,7 @@ void NukiWrapper::readAdvancedConfig()
Log->println(resultStr);
if(result != Nuki::CmdResult::Success) {
- ++_retryCount;
+ ++retryCount;
Log->println("Failed to retrieve lock advanced config, retrying in 1s");
delay(1000);
}
diff --git a/src/NukiWrapper.h b/src/NukiWrapper.h
index f87693d..a510b43 100644
--- a/src/NukiWrapper.h
+++ b/src/NukiWrapper.h
@@ -130,7 +130,6 @@ private:
uint _maxAuthEntryCount = 0;
int _nrOfRetries = 0;
int _retryDelay = 0;
- int _retryCount = 0;
int _retryConfigCount = 0;
int _retryLockstateCount = 0;
int _rssiPublishInterval = 0;
diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp
index 278a4d8..090148b 100644
--- a/src/WebCfgServer.cpp
+++ b/src/WebCfgServer.cpp
@@ -4,6 +4,9 @@
#include "Logger.h"
#include "RestartReason.h"
#include
+#ifdef CONFIG_SOC_SPIRAM_SUPPORTED
+#include
+#endif
#ifndef CONFIG_IDF_TARGET_ESP32H2
#include
#endif
@@ -3128,7 +3131,6 @@ esp_err_t WebCfgServer::buildAccLvlHtml(PsychicRequest *request)
response.print("
");
response.print("
");
}
-
response.print("");
response.print("