diff --git a/lib/nuki_ble b/lib/nuki_ble index bd91181..51eb268 160000 --- a/lib/nuki_ble +++ b/lib/nuki_ble @@ -1 +1 @@ -Subproject commit bd91181b3e3a182fb6e822077b6f0f3f711934cc +Subproject commit 51eb268f53efdf216ce32bba5d214c770dffff45 diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 0d140b4..765cffb 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -82,7 +82,7 @@ CONFIG_BT_NIMBLE_NVS_PERSIST=y CONFIG_BT_NIMBLE_GATT_MAX_PROCS=8 CONFIG_BT_NIMBLE_PINNED_TO_CORE_0=y CONFIG_BT_NIMBLE_PINNED_TO_CORE=0 -CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 +CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=12288 CONFIG_BT_NIMBLE_ROLE_CENTRAL=y CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=n CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y diff --git a/src/Config.h b/src/Config.h index 95d5acd..a2d5810 100644 --- a/src/Config.h +++ b/src/Config.h @@ -5,7 +5,7 @@ #define NUKI_HUB_VERSION "9.11" #define NUKI_HUB_VERSION_INT (uint32_t)911 #define NUKI_HUB_BUILD "unknownbuildnr" -#define NUKI_HUB_DATE "2025-04-06" +#define NUKI_HUB_DATE "2025-05-05" #define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest" #define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json" diff --git a/src/NukiWrapper.cpp b/src/NukiWrapper.cpp index 48fc976..e8e363b 100644 --- a/src/NukiWrapper.cpp +++ b/src/NukiWrapper.cpp @@ -359,7 +359,7 @@ void NukiWrapper::update(bool reboot) { Log->println("Updating Lock config based on timer or query"); _nextConfigUpdateTs = ts + _intervalConfig * 1000; - updateConfig(); + updateConfig(); updateDebug(); } if(_waitAuthLogUpdateTs != 0 && ts > _waitAuthLogUpdateTs) @@ -732,34 +732,143 @@ void NukiWrapper::updateConfig() void NukiWrapper::updateDebug() { Nuki::CmdResult result = (Nuki::CmdResult)-1; + int count = 0; + Log->println("Running debug command - RequestGeneralStatistics"); + result = (Nuki::CmdResult)-1; result = _nukiLock.genericCommand(Nuki::Command::RequestGeneralStatistics); Log->print("Result: "); Log->println(result); Log->println("Debug command complete"); + Log->println("Running debug command - RequestDailyStatistics"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.requestDailyStatistics(); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); Log->println("Running debug command - RequestMqttConfig"); result = (Nuki::CmdResult)-1; result = _nukiLock.genericCommand(Nuki::Command::RequestMqttConfig); Log->print("Result: "); Log->println(result); Log->println("Debug command complete"); + Log->println("Running debug command - RequestMqttConfigForMigration"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.genericCommand(Nuki::Command::RequestMqttConfigForMigration); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + Log->println("Running debug command - ReadWifiConfig"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.genericCommand(Nuki::Command::ReadWifiConfig); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + Log->println("Running debug command - ReadWifiConfigForMigration"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.genericCommand(Nuki::Command::ReadWifiConfigForMigration); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + Log->println("Running debug command - GetKeypad2Config"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.genericCommand(Nuki::Command::GetKeypad2Config, false); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + Log->println("Running debug command - RequestFingerprintEntries"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.retrieveFingerprintEntries(); + Log->print("Result: "); + Log->println(result); + count = 0; + while (count < 5) { + delay(1000); + esp_task_wdt_reset(); + count++; + } + + std::list fingerprintEntries; + _nukiLock.getFingerprintEntries(&fingerprintEntries); + + Log->print("Fingerprint entries: "); + Log->println(fingerprintEntries.size()); + Log->println("Debug command complete"); + + Log->println("Running debug command - RequestInternalLogEntries"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.retrieveInternalLogEntries(0, 10, 1, false); + Log->print("Result: "); + Log->println(result); + + count = 0; + while (count < 15) { + delay(1000); + esp_task_wdt_reset(); + count++; + } + + std::list internalLogEntries; + _nukiLock.getInternalLogEntries(&internalLogEntries); + + Log->print("InternalLog entries: "); + Log->println(internalLogEntries.size()); + Log->println("Debug command complete"); + + Log->println("Running debug command - scanWifi"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.scanWifi(15); + Log->print("Result: "); + Log->println(result); + + count = 0; + while (count < 20) { + delay(1000); + esp_task_wdt_reset(); + count++; + } + + std::list wifiScanEntries; + _nukiLock.getWifiScanEntries(&wifiScanEntries); + + Log->print("WifiScan entries: "); + Log->println(wifiScanEntries.size()); + Log->println("Debug command complete"); + + Log->println("Running debug command - getAccessoryInfo, type = 4"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.getAccessoryInfo(4); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + + Log->println("Running debug command - getAccessoryInfo, type = 5"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.getAccessoryInfo(5); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); + + Log->println("Running debug command - RequestDoorSensorConfig"); + result = (Nuki::CmdResult)-1; + result = _nukiLock.genericCommand(Nuki::Command::RequestDoorSensorConfig, false); + Log->print("Result: "); + Log->println(result); + Log->println("Debug command complete"); /* - RequestGeneralStatistics = 0x0063, - RequestMqttConfig = 0x008B, - - RequestInternalLogEntries = 0x0065, - RequestAccessoryInfo = 0x0091, - RequestMatterPairings = 0x0112 - CheckKeypadCode = 0x006E, + CheckKeypadCode = 0x006E keypadCode (int), (nonce, PIN) - SmartLockScanWifi = 0x0080, - SmartLockConnectWifi = 0x0082, - SmartLockSetWifiConfig = 0x0087, - SetMqttConfig = 0x008D, - SetKeypad2Config = 0x009C, - EnableMatterCommissioning = 0x0110, - SetMatterState = 0x0111, + RequestMatterPairings = 0x0112 requestTotalCount (bool), (nonce, PIN) + MatterPairing = 0x0113 + MatterPairingCount = 0x0114 + + ConnectWifi = 0x0082 + SetWifiConfig = 0x0087 + SetMqttConfig = 0x008D + SetKeypad2Config = 0x009C + EnableMatterCommissioning = 0x0110 + SetMatterState = 0x0111 */ } diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp index e08b052..53614d2 100644 --- a/src/WebCfgServer.cpp +++ b/src/WebCfgServer.cpp @@ -6642,7 +6642,7 @@ esp_err_t WebCfgServer::buildInfoHtml(PsychicRequest *request, PsychicResponse* response.print("\n\n------------ GPIO ------------\n"); response.print("\nRetain Input GPIO MQTT state: "); - response.print(_preferences->getBool(preference_retain_gpio, false) ? "Yes" : "No"); + response.print(_preferences->getBool(preference_retain_gpio, false) ? "Yes\n" : "No\n"); String gpioStr = ""; _gpio->getConfigurationText(gpioStr, _gpio->pinConfiguration()); response.print(gpioStr);