technyon / nuki_hub

Use an ESP32 as a Hub between a NUKI Lock and your smarthome.
MIT License
519 stars 40 forks source link

cosmetic defects nuki smart lock 3.0 pro? #141

Closed pilot1981 closed 1 year ago

pilot1981 commented 1 year ago

Hi, I see two strange things:

these are related to some misconfiguration? I alreadey tried to insert PIN code, but warning don't go away....

unlock function seems to works fine...

pilot1981 commented 1 year ago

image

technyon commented 1 year ago

Please post the content of the "system information" page (click the firmware version number).

pilot1981 commented 1 year ago

NUKI Hub version: 8.16 run: true deviceId: 1329748968 mqttbroker: 192.168.6.31 mqttport: 1883 mqttuser: mqttpass: mqttlog: false lockena: true mqttpath: ingresso openerena: false mqttoppath: maxkpad: opmaxkpad: mqttca: mqttcrt: mqttkey: hassdiscovery: homeassistant dhcpena: true ipaddr: ipsub: ipgtw: dnssrv: nwhw: 2 nwhwdt: 26 rssipb: -1 hostname: ingresso nettmout: -1 restdisc: true resttmr: -1 rstbcn: 60 lockStInterval: 1800 configInterval: 3600 batInterval: 1800 kpInterval: 1800 kpEnabled: false regAsApp: false nrRetry: 3 rtryDelay: 100 crdusr: crdpass: pubauth: false gpiolck: false pubdbg: false prdtimeout: 60 hasmac: false macb0: macb1: macb2: MQTT connected: Yes Lock firmware version: Lock hardware version: Lock paired: Yes Lock PIN set: Yes Network device: Built-in Wifi Uptime: 174 minutes Heap: 92948 Stack watermarks: nw: 6104, nuki: 648, pd: 236 Restart reason FW: RestartOnDisconnectWatchdog Restart reason ESP: ESP_RST_SW: Software reset via esp_restart.

pilot1981 commented 1 year ago

Errata corrige:

lock/unlock feature don’t work again…

This is fourth ESP32 I tried to use…I suppose this is always related to NUKI SMART LOCK 3.0 PRO model…please se other my tickets…

mundschenk-at commented 1 year ago

Please unpair and re-pair the ESP and the look.

technyon commented 1 year ago

There's nothing special about the Pro lock. Make sure to move lock and esp close together so you have a good connection. Also enable publishing rssi values and check how good the reception is.

pilot1981 commented 1 year ago

Reset of pair solved issues…but I come back in original problem (please see other closed tickets): every day I have to reset pairing of my NUKI SMART LOCK 3.0 PRO!

technyon commented 1 year ago

Can you check "Register as app" before pairing again?

pilot1981 commented 1 year ago

Please, can you explain it better? Where I can find it? What I have to check?

regards

technyon commented 1 year ago

Open the configuration portal, go to "NUKI Configuration". Under Advanced NUKI configuration, enable "Register as app" and click Save.

pilot1981 commented 1 year ago

Register as app not solve this issue

5CDF5147-FACC-4C96-9CFE-0D65DA330F5D 3D6084EF-C611-4FED-842A-CC29E5F3F9F1

technyon commented 1 year ago

If you use the smartphone app and check the registered users, do you see NukiHub ?

pilot1981 commented 1 year ago

Yes

pilot1981 commented 1 year ago

D4650C5E-0EC9-4B33-A41C-1419E264CAA3

pilot1981 commented 1 year ago

Anyone here is using NUKI SMART LOCK 3.0 PRO VERSION?

technyon commented 1 year ago

This has nothing to do with Pro or not. I know there are Pro users and it works just fine.

P.S.: I had strange problems with my Opener some time ago. After a factory reset, it worked just fine again, so consider doing a factory reset on the lock.

pilot1981 commented 1 year ago

What I can do else to understand cause of my issue?!

pilot1981 commented 1 year ago

What else I can do to troubleshoot this problem?

I’m trying to solve this issue from about 1 month…

I have another NUKI SMART LOCK 3.0 working with another ESP32.

likeyou83 commented 1 year ago

I have the same problem with 3.0 pro. It seems that the problem occurs when connecting wifi, otherwise it works.

pilot1981 commented 1 year ago

I have the same problem with 3.0 pro. It seems that the problem occurs when connecting wifi, otherwise it works.

what it means? if I disconnect WIFI of nuki, problem disappear?

likeyou83 commented 1 year ago

yes, that worked for me.... but it's inconvenient not to be able to use the app.

how to connect wifi, the problem reappears

pilot1981 commented 1 year ago

yes, that worked for me.... but it's inconvenient not to be able to use the app

thanks for information: I go to try at home!

pilot1981 commented 1 year ago

yes, that worked for me.... but it's inconvenient not to be able to use the app.

how to connect wifi, the problem reappears

I tried to simulate same issue at home, but also with WIFI DOWN on my NUKI SMART LOCK 3.0 PRO, MQTT don’t works using NUKI hub…

I see it works only after a reboot of ESP32…but I can’t reboot it ever second…

mundschenk-at commented 1 year ago

I tried to simulate same issue at home, but also with WIFI DOWN on my NUKI SMART LOCK 3.0 PRO, MQTT don’t works using NUKI hub…

What do you mean by "simulate"?

pilot1981 commented 1 year ago

I tried to simulate same issue at home, but also with WIFI DOWN on my NUKI SMART LOCK 3.0 PRO, MQTT don’t works using NUKI hub…

What do you mean by "simulate"?

I shutdown WIFI connection on NUKI SMART LOCK 3.0 PRO; but issue with ESP32 is always the same

alexdelprete commented 1 year ago

but issue with ESP32 is always the same

what is the issue? I read the whole thread and it's still not clear, different and possibly unrelated problems. Is it MQTT or is it the lock status/actions not working? It's two different things.

Also, did you enable publishing RSSI values? to check connection of the hub with the lock and wifi network.

pilot1981 commented 1 year ago

The problem is NUKI SMART LOCK 3.0 PRO receive MQTT Command but give error answer…don’t lock/unlock…

Already tried to change ESP32, change physical position, retry action, enable RSSI, but this don’t solved

The only workaround found is to reboot ESP32, few seconds after ESP32 all works fine only one time, then I always receive error messages….

alexdelprete commented 1 year ago

The Lock doesn't receive MQTT commands, Nuki Hub processes MQTT commands and sends them to Lock via Bluetooth.

That's why it's difficult to understand where the problem is...and since there are other users with SL Pro that are working, I think the problem is how you configure things (the Hub, MQTT, or something else).

This is the 3rd time that Jan and I are asking you to enable RSSI publishing and show us the values, can you please do it so we can understand if the connection of Nuki Hub with wifi and the lock is ok?

(se hai problemi con l'inglese vai pure in italiano...)

alexdelprete commented 1 year ago

I also forgot to ask: are you using beta firmware on the Pro? They're testing MQTT on SL Pro, are you using that AND also Nuki Hub?

image

pilot1981 commented 1 year ago

Ciao alessandro, I write in English to allow all to understand it.

I know MQTT work only between HA and ESP32…after I send MQTT command, ESP32+this firmware return to me error…

I tried it with NUKI stable firmware and beta firmware: always same result.

below you can find RSSI signal:

801986AD-6215-4B27-95EE-BA83B8856F2C

I moved ESP32 1 meter far from NUKI SMART LICK 3.0 PRO and I’m monitoring WIFI interface using a software: not any ICMP packets lost.

I tried to do troubleshooting but this don’t solved the issue…

it’s possible to have more debug information in log file? I didn’t find any other solution…

thanks I’m advance for your help!

technyon commented 1 year ago

Please flash the attached debug firmware. It will generate a ton of logs, but you'll have to capture them via the serial interface, MQTT logs won't do for this. Connect the ESP to your computer and use a terminal emulator like hterm:

https://www.der-hammer.info/pages/terminal.html

Select the COM-port and connect with 115200 baud. To make the output readable you have to switch "Newline at" to "CR+LF". Perform a lock operation and capture the output ... it'll be a lot of output so maybe put it into a file and zip, so you upload it here.

Also, please post the output of the system information page (click the firmware version).

nuki_hub-8.19-dbg-1.zip

pilot1981 commented 1 year ago

Hi, I installed debug firmware; this is system information page:

NUKI Hub version: 8.19-dbg-1 run: true deviceId: 1329748968 mqttbroker: 192.168.6.31 mqttport: 1883 mqttuser: mqttpass: mqttlog: true lockena: true mqttpath: ingresso openerena: false mqttoppath: maxkpad: opmaxkpad: mqttca: mqttcrt: mqttkey: hassdiscovery: homeassistant dhcpena: true ipaddr: ipsub: ipgtw: dnssrv: nwhw: 2 nwhwdt: 26 rssipb: 60 hostname: ingresso nettmout: -1 restdisc: true resttmr: -1 rstbcn: 60 lockStInterval: 1800 configInterval: 3600 batInterval: 1800 kpInterval: 1800 kpEnabled: false regAsApp: false nrRetry: 3 rtryDelay: 100 crdusr: crdpass: pubauth: false gpiolck: false pubdbg: false prdtimeout: 60 hasmac: false macb0: macb1: macb2: MQTT connected: Yes Lock firmware version: Lock hardware version: Lock paired: Yes Lock PIN set: Yes Lock has door sensor: No Lock has keypad: No Network device: Built-in Wifi Uptime: 2 minutes Heap: 88688 Stack watermarks: nw: 6072, nuki: 680, pd: 276 Restart reason FW: RestartOnDisconnectWatchdog Restart reason ESP: ESP_RST_SW: Software reset via esp_restart.

I sent unlock command and this is output captured using serial connection:

Lock action received: unlock [262689][E][NukiBle.hpp:8] executeAction(): Lock Heartbeat timeout, command failed Lock action result: error Lock: Last command failed, retrying after 100 milliseconds. Retry 1 of 3 [262820][E][NukiBle.hpp:8] executeAction(): Lock Heartbeat timeout, command failed Lock action result: error Lock: Last command failed, retrying after 100 milliseconds. Retry 2 of 3 [262951][E][NukiBle.hpp:8] executeAction(): Lock Heartbeat timeout, command failed Lock action result: error Lock: Last command failed, retrying after 100 milliseconds. Retry 3 of 3 [263082][E][NukiBle.hpp:8] executeAction(): Lock Heartbeat timeout, command failed Lock action result: error Lock: Maximum number of retries exceeded, aborting.

The only useful information seems to be the Lock Heartbeat timeout: what it means? I suppose this is internal function called using NUKI API...

pilot1981 commented 1 year ago

I upload here complete debub logs: complete NUKI log.txt

technyon commented 1 year ago

I think this will be useful already, but can you configure the PIN and get more logs?

P.S.: The heartbeat timeout means that the ESP doesn't receive any bluetooth beacons from the lock

pilot1981 commented 1 year ago

I already configured PIN: I changed it in log file…

I read pin paired, it’s right?

I have to do any other things?

pilot1981 commented 1 year ago

@alexdelprete @technyon any idea? I can do some other test?

technyon commented 1 year ago

@pilot1981 Please give us some time to understand what's going on in the logs.

Does the lock work via the smartphone? Maybe just start over and factory reset everything (lock and esp), then setup everything again.

pilot1981 commented 1 year ago

Yes, sure!

mall works fine using NUKI APP.

I tried a soft reset…

technyon commented 1 year ago

Check release 8.20 please. The fix for the non-random Nonce could fix your issue.

alexdelprete commented 1 year ago

That log is horrible. Severe BLE communication issue, the Hub can't connect to the lock, when it does and it sends a command, it goes in timeout for communication issues:

[ 18282][D][NukiBle.hpp:87] cmdStateMachine(): ************************ SENDING COMMAND [1] ************************
[ 18292][D][NukiBle.cpp:829] sendEncryptedMessage(): payloadlen: 2
[ 18298][D][NukiBle.cpp:830] sendEncryptedMessage(): sizeof(plainData): 8
[ 18305][D][NukiBle.cpp:831] sendEncryptedMessage(): CRC: 459b
Plain data with CRC: : 02 00 5b 38 01 00 11 00 9b 45
Nonce: 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
Additional data: : 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 02 00 5b 38 1a 00
Encryption key (secretKey): : 4b ca 90 d0 53 e2 21 ea 1a 1e f9 67 c7 c9 b0 2e c3 89 2a f0 4e e8 12 83 1f f4 78 7a 85 a1 b9 ab
Plain data encrypted: : 7a f5 b8 0a 3a 0d 8f eb ea 6b 5c 63 58 0b a0 88 6b 36 48 d8 a0 0c 3b 82 cc 8c
[ 18366][D][NukiBle.cpp:132] connectBle(): connecting within: nuki
[ 19370][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying
[ 20383][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying
[ 21396][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying
[ 22409][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
[ 23365][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying
[ 23375][W][NukiBle.cpp:160] connectBle(): BLE Connect failed
[ 23375][W][NukiBle.cpp:863] sendEncryptedMessage(): Send encr msg failed due to unable to connect
[ 23378][D][NukiBle.hpp:96] cmdStateMachine(): ************************ SENDING COMMAND FAILED ************************
Querying lock battery state: failed

If the hub is close to the lock, then the issue is the device. What esp32 device are you using? Specific models so we can check the hw info.

pilot1981 commented 1 year ago

Check release 8.20 please. The fix for the non-random Nonce could fix your issue.

OK, installed...I go to test it...

pilot1981 commented 1 year ago

eMachine(): **** SENDING COMMAND [1] **** [ 18292][D][NukiBle.cpp:829] sendEncryptedMessage(): payloadlen: 2 [ 18298][D][NukiBle.cpp:830] sendEncryptedMessage(): sizeof(plainData): 8 [ 18305][D][NukiBle.cpp:831] sendEncryptedMessage(): CRC: 459b Plain data with CRC: : 02 00 5b 38 01 00 11 00 9b 45 Nonce: 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 Additional data: : 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 02 00 5b 38 1a 00 Encryption key (secretKey): : 4b ca 90 d0 53 e2 21 ea 1a 1e f9 67 c7 c9 b0 2e c3 89 2a f0 4e e8 12 83 1f f4 78 7a 85 a1 b9 ab Plain data encrypted: : 7a f5 b8 0a 3a 0d 8f eb ea 6b 5c 63 58 0b a0 88 6b 36 48 d8 a0 0c 3b 82 cc 8c [ 18366][D][NukiBle.cpp:132] connectBle(): connecting within: nuki [ 19370][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying [ 20383][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying [ 21396][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying [ 22409][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2) [ 23365][W][NukiBle.cpp:147] connectBle(): BLE Connect failed, retrying [ 23375][W][NukiBle.cpp:160] connectBle(): BLE Connect failed [ 23375][W][NukiBle.cpp:863] sendEncryptedMessage(): Send encr msg failed due to unable to connect [ 23378][D][NukiBle.hpp:96] cmdStateMachine(): **** SENDING COMMAND FAILED **** Querying lock battery state: failed

Hi, I'm using this model of ESP32:

https://it.aliexpress.com/item/1005004797369870.html?spm=a2g0o.order_list.order_list_main.29.2a7436962fyYrt&gatewayAdapt=glo2ita

I already tried to change with other 4 ESP32 devices...always same issue...I tried also to move ESP32 more close (less than 1 meter) from NUKI SMART LOCK 3.0 PRO

I used the same model to connect to another NUKI SMART LOCK 3.0: no any issue in this case...

it could be a problem of bluetooth radio interference?!

you can suggest another ESP32 model to use?

alexdelprete commented 1 year ago

it could be a problem of bluetooth radio interference?!

could be. but I would first test a device that is known to be reliable.

you can suggest another ESP32 model to use?

I use these two:

M5 Atom Lite: https://shop.m5stack.com/products/atom-lite-esp32-development-kit M5 AtomU: https://shop.m5stack.com/products/atomu-esp32-development-kit-with-usb-a

pilot1981 commented 1 year ago

Check release 8.20 please. The fix for the non-random Nonce could fix your issue.

Sorry, but 8.20 don’t solved my issue…

alexdelprete commented 1 year ago

It's not a sw issue. You have a problem with the signal, but only you can determine if it's interference or just bad hw.

pilot1981 commented 1 year ago

It's not a sw issue. You have a problem with the signal, but only you can determine if it's interference or just bad hw.

Hi, I tried to shutdown nearest Bluetooth devices (raspberry pi3 and Apple TV 4), but this don’t helped…

so I go to buy M5 Atom: both Atom Lite and AtomU have Bluetooth antenna? I can buy which I prefer? There is a model with best Bluetooth antenna performance?

technyon commented 1 year ago

If reception is the problem, maybe it's worth trying an ESP with an external antenna. The PCB antennas used on most ESPs aren't exactly great.

mundschenk-at commented 1 year ago

There is no difference between Atom Lite and AtomU regarding the antenna. It's not an external one unfortunately, but it's a "3D antenna" and not just some traces on the PCB. In my experience the Atom's signal strength is a bit better than with PCB antennas (but obviously not as good as an external one).

alexdelprete commented 1 year ago

I can buy which I prefer? There is a model with best Bluetooth antenna performance?

They're the same, except that the AtomU is a usb stick, the other requires a usb cable for power, but it's smaller. Check the links I posted.

bcutter commented 1 year ago

After this adventure https://github.com/technyon/nuki_hub/issues/176 today I'm also seeing this (randomly for two ESPs which have been erased and flashed with Nuki hub 8.22 and paired with different smart locks). PIN has been provided already plenty of times.

grafik

grafik

grafik

grafik

Are certain types of PINs problematic? Leading zeros or similar maybe? Just an idea.

Clearly a bug introduced somewhere between 8.8 and 8.22 😄