Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to the smartlock #39

Closed
0rsa opened this issue Sep 28, 2022 · 107 comments
Closed

Cannot connect to the smartlock #39

0rsa opened this issue Sep 28, 2022 · 107 comments

Comments

@0rsa
Copy link

0rsa commented Sep 28, 2022

Hello,
I cannot pair the smartlock

*wm:[2] Connection result: WL_CONNECTED
*wm:[1] AutoConnect: SUCCESS
*wm:[2] Connected in 4634 ms
*wm:[1] STA IP Address: xxx.xxx.xxx.xxx
WiFi connected: xxx.xxx.xxx.xxx
Host name: nukihub
MQTT Broker: xxx.xxx.xxx.xxx
NUKI Lock enabled
Lock state interval: 1800 | Battery interval: 1800 | Publish auth data: yes
NUKI Opener disabled
Presence detection timeout (ms): 60000
Attempting MQTT connection
MQTT: Connecting without credentials
MQTT connected
Nuki start pairing
Nuki start pairing
Nuki start pairing
Nuki start pairing
Nuki start pairing

Nuki and ESP32 are separated by 5 centimeters.
I use the latest Nuki 2.0 firmware 2.12.4

Nuki is of course in pair mode (white circle)

I tried to factory reset the smartlock but still trying to pair without success.

Do you have an idea?

Thank you

@0rsa
Copy link
Author

0rsa commented Sep 28, 2022

I tried to register as an app (I was using bridge mode first) but the issue persists.

@technyon
Copy link
Owner

Did you pair your smartphone already?

@0rsa
Copy link
Author

0rsa commented Sep 29, 2022

First yes the smartphone was paired to the smartlock
It was not after the factory reset

@technyon
Copy link
Owner

ok, just asking to make sure pairing in general is working.

It's hard to tell, usually it just works. How close is the ESP to the lock?

@0rsa
Copy link
Author

0rsa commented Sep 29, 2022

They are literally separated by 5cm, I unmounted the doorlock from the door to put in just near the ESP32
I was using this ESP32 to control an other doorlock just before so the ESP32 bluetooth should be working
I tried also:

  • A previous version of nuki hub (5.15)
  • A second ESP32
  • A second Nuki 2.0 which has not been updated for at least 1 year ago

It still won't connect sadly.

@technyon
Copy link
Owner

I'm somewhat out of ideas ... I'd have to add some log messages to see what's really going on.

@0rsa
Copy link
Author

0rsa commented Sep 29, 2022

Ok, thank you.
From my side, I ordered a different model of my current ESPs to see if it can the responsible of this issue.

@technyon
Copy link
Owner

Please try with the attached firmware and send logs. When flashed the version string is "6.0-dbg-connect".

nuki_hub-dbg-connect.zip

@0rsa
Copy link
Author

0rsa commented Sep 30, 2022

Thank you
This log in loop mode:

Nuki start pairing
[ 90784][D][NukiBle.cpp:102] pairNuki(): No nuki in pairing mode found
[ 90785][D][NukiBle.cpp:107] pairNuki(): pairing result 0

Nuki is in pairing mode (and it connects to my smartphone or to my FOB within second when I enable the pairing mode on Nuki smartlock, the smartlock bluetooth works fine)

Some info from my current ESP:

Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz

@0rsa
Copy link
Author

0rsa commented Sep 30, 2022

Oh, new logs:

[289304][D][NukiBle.cpp:102] pairNuki(): No nuki in pairing mode found
[289305][D][NukiBle.cpp:107] pairNuki(): pairing result 0
[294285][D][NukiBle.cpp:229] onResult(): Found nuki in pairing state:  addr: xx:xx:xx:xx:xx:xx
Nuki start pairing
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
[302732][W][NukiBle.cpp:138] connectBle(): BLE Connect failed, retrying
[332746][W][NukiBle.cpp:138] connectBle(): BLE Connect failed, retrying
[362759][W][NukiBle.cpp:138] connectBle(): BLE Connect failed, retrying

I already saw this error "lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)", it was related to the poor bluetooth connection.
Did you max the bluetooth range power currently from the ESP32?

I cannot make the ESP32 closer to the smartlock, they are already together...

@technyon
Copy link
Owner

The error packet count mismatch comes from the bluetooth stack, but is normal, it happens sometimes.

Your ESP somehow has problems though with bluetooth communication. In the first log, it didn't receive the iBeacon from the lock, in the second it tried to connect but failed, so the pairing process wasn't initiated.

Why this is happening is hard to tell. I'd try another ESP as you suggested. No point in meddling with bluetooth parameters, the first log is about receiving a beacon, and there's no way to improve reception from software side, you'd need to change the antenna ... that's not the problem here.

@StefanTR96
Copy link

Had the same Problem ... I paired it with the App, selected Configure Bridge, powered on the ESP32 and pushed the button for 10 seconds (The light started after about 5 seconds) ... The App told "success" and the Web Interface of the ESP32 told "Paired"

@yaronkof
Copy link

@technyon here are my logs
esp-web-tools-logs.txt

I set my lock to paring mode, and the esp just got stuck in a Nuki start pairing loop

@technyon
Copy link
Owner

It's very strange ... I just unpaired my lock and paring worked immediately. I've compiled the latest firmware with enhanced logging, can you give it a try? When successfully flashed, the versions reads "6.0-dbg-1".

nuki_hub-dbg.zip

@yaronkof
Copy link

It's very strange ... I just unpaired my lock and paring worked immediately. I've compiled the latest firmware with enhanced logging, can you give it a try? When successfully flashed, the versions reads "6.0-dbg-1".

nuki_hub-dbg.zip

how do I flash this ver?

@gonzalezcalleja
Copy link

gonzalezcalleja commented Oct 15, 2022

Same issue here, can't pair.

  • Previously I have been using RaspiNukiBridge (https://github.com/dauden1184/RaspiNukiBridge) in a RPI for a long time.
  • Nuki Smart Lock firmware 3.3.5 on Nuki Smart Lock 3.0 device.
  • Tested with 2 ESP32 devices with same result.
  • Tested with nukihub 6.0, 6.0-dbg-1 and 5.15.
  • Tested with "register as app" on and off.
  • Restored to factory settings the Nuki smart lock.
  • Chip is ESP32-D0WD-V3 (revision 3) (from esptool).
  • Tested with nuki_hub-dbg-connect.zip from this issue @technyon:
Attempting MQTT connection
MQTT: Connecting without credentials
MQTT connect failed, rc=-2
Free Heap: 112864
Nuki start pairing
[963732][D][NukiBle.cpp:102] pairNuki(): No nuki in pairing mode found
[963733][D][NukiBle.cpp:107] pairNuki(): pairing result 0

(in loop)

  • nuki/presence/devices in MQTT is always empty.
  • Distance between ESP32 and Nuki about 10 centimetres.
  • After a lot of tries, I get this pressing about 30 seconds the Nuki button.
[603449][D][NukiBle.cpp:102] pairNuki(): No nuki in pairing mode found
[603449][D][NukiBle.cpp:107] pairNuki(): pairing result 0
Attempting MQTT connection
MQTT: Connecting without credentials
MQTT connect failed, rc=-2
Free Heap: 112352
[608429][D][NukiBle.cpp:229] onResult(): Found nuki in pairing state:  addr: 54:d2:72:86:2d:ec

But ended with:

[758727][W][NukiBle.cpp:138] connectBle(): BLE Connect failed, retrying

@technyon
Copy link
Owner

technyon commented Oct 16, 2022

Same as with the logs before, for some reason the ESP isn't picking up the beacon from the lock, so it doesn't initiate the pairing procedure. I have no explanation really, here it just works. I'm on firmware 3.3.5 on a NUKI 3.0 too.

Can you try to enable the presence detection and see if it's reporting anything? If it doesn't wobk try my other firmware:

https://github.com/technyon/blescanner

This just reports beacons from devices in the area. Just to make sure your ESP receives any beacons at all and that bluetooth is working.

P.S.: Just saw that it worked after a lot of tries. Something's up with the bluetooth communication. Using the app on the smartphone works without problems?

@technyon
Copy link
Owner

how do I flash this ver?

  • download a release and unzip it
  • replace the nuki_hub.bin in the unpacked release with the debug bin
  • follow the instructions in the readme

@gonzalezcalleja
Copy link

Same as with the logs before, for some reason the ESP isn't picking up the beacon from the lock, so it doesn't initiate the pairing procedure. I have no explanation really, here it just works. I'm on firmware 3.3.5 on a NUKI 3.0 too.

Can you try to enable the presence detection and see if it's reporting anything? If it doesn't wobk try my other firmware:

https://github.com/technyon/blescanner

This just reports beacons from devices in the area. Just to make sure your ESP receives any beacons at all and that bluetooth is working.

P.S.: Just saw that it worked after a lot of tries. Something's up with the bluetooth communication. Using the app on the smartphone works without problems?

Hi,

Yes, the lock works over bluetooth, I use every day from 2 smartphone and from Raspinuk (https://github.com/dauden1184/RaspiNukiBridge).

I have tested blescanner and the ESP32 doesn't show the Nuki Lock device, but I can see other devices, is strange because with hcitool lescan from a RPI I always receive the beacons from the Nuki.

Thanks!

@gonzalezcalleja
Copy link

gonzalezcalleja commented Oct 17, 2022

With this script https://gist.github.com/elliotlarson/1e637da6613dbe3e777c (ibeacon-scan.bash) I can see a lot of beacons every second from a Tesla car ... could be this too much beacons for an ESP32 an is ignoring the Nuki beacons?

Tested the same ESP32 devices with esphome (ble_scanner) and I cannon't find the Nuki lock.

@gonzalezcalleja
Copy link

Tested today with other ESP32 boards and worked an paired at the first try:

Nuki start pairing
Nuki paired
Nuki lock state: locked
Reading config. Result: 1
Reading advanced config. Result: 1

The new board is from az-Delivery and the older one with bluetooth problems from DUBEUYEW:

IMG_1117

Thanks for your support @technyon, finally was a hardware problem with the ESP32 boards.

@technyon
Copy link
Owner

Hi,

thanks for feedback. Maybe it's time to compile a list of recommended hardware ... still I have no explanation really and without being able to reproduce the issue it's really hard to fix. At least I can give the advice to try a different board now.

@SergioWarriorPeru
Copy link

Hi, a question...where is the option "register as an app"?

@technyon
Copy link
Owner

In the configuration portal go to NUKI Configuration, in the advanced section enable the first checkmark.

@SergioWarriorPeru
Copy link

Thanks...I can not pair with my Nuky 2.o....I have the same broad marked witd "X" in picture above swowed...it is frustrating for me

@SergioWarriorPeru
Copy link

I have seen logs and it is always showing
Nuki start pairing
Nuki start pairing
Nuki start pairing
Nuki start pairing
Nuki start pairing
Nuki start pairing

@technyon
Copy link
Owner

@gonzalezcalleja Do you have a link to the DUBEUYEW board? I'd like to add it to the readme as an incompatible board.

@SergioWarriorPeru Try a different board. It seems this one in particular has some issue.

@SergioWarriorPeru
Copy link

SergioWarriorPeru commented Oct 22, 2022

Yeah...but, I would like know why...Maybe it could be the chip ESP32-D0WDQ6....I was surfing to know what is the chip used az-Delivery board...but I have not been successful

@technyon
Copy link
Owner

Doing a quick google check, it's at least listed as "Not recommended for new designs", which means as far as I understand that there newer revisions available that address potential hardware bugs:

https://www.italki.com/en/teacher/7737037/englishhttps://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf

Maybe pick one that's not listed as "NRND".

@gonzalezcalleja
Copy link

gonzalezcalleja commented Oct 24, 2022

@gonzalezcalleja Do you have a link to the DUBEUYEW board? I'd like to add it to the readme as an incompatible board.

Hi, I only have this amazon link: https://www.amazon.es/gp/product/B0B55MS33L

The board is labeled as "ESP32 DEVKIT V1"

image

@amastrogiacomo1968
Copy link

I've release version 6.2, which has some updated libraries. There's a chance this fixes some of the pairing issues.

Good evening, I tried to update to 6.2 but unfortunately my ESP-WEOOM-32 still doesn't connect to the lock
20221211_180858~2

@Jejebond
Copy link

Jejebond commented Dec 30, 2022

Same issue, always showing "Nuki start pairing". It's the HiLetgo ESP-WROOM-32 ESP32 ESP-32D (Chip is ESP32DOWDQ6 (revision 1) from what i can read on amazon comment). Any idea ?

Edit: firmware 6.7

PXL_20221230_232003336

@hsdneo
Copy link

hsdneo commented Jan 3, 2023

Hi,

I am having the same problem. Got a new ESP32 device today from Amazon (AZ-Delivery ESP32 DevKitC V2, ESP32-WROOM-32) but I think this is a device which is not working yet?!

After flashing with Nuki Hub via Web the MQTT connection was not a big deal but the pairing is not working after I pressed the button on my Nuki 3.0 pro lock.
Anything else I can do or just unsupported device?

@Jejebond
Copy link

Jejebond commented Jan 3, 2023

I've sent back mine, gonna try with the AZ Delivery V4.

Anyone got an esp32 model that is 100% compatible ?

@technyon
Copy link
Owner

technyon commented Jan 3, 2023

I'm using this:

https://www.amazon.de/-/en/gp/product/B093GQGJCV/

Although I think it's not guaranteed that you get the exact same product. They could use whatever chip they could get at the time.

@davide93
Copy link

davide93 commented Jan 4, 2023

I've sent back mine, gonna try with the AZ Delivery V4.

Anyone got an esp32 model that is 100% compatible ?

#39 (comment)

@hsdneo
Copy link

hsdneo commented Jan 5, 2023

Do you think that this - AZ-Delivery ESP32 DevKitC V2, ESP32-WROOM-32 - will be compatible via another firmware or version or is there no chance to make it work?

hat's your experience with the beta firmware ? I also have an SL3P and I've b

Same question from my side: any experience with battery drain in the beta firmware while MQTT is activated?

@hsdneo
Copy link

hsdneo commented Jan 5, 2023

Maybe another suggestion from amazon germany which ESP is a working one?

@Jejebond
Copy link

Jejebond commented Jan 5, 2023

AZDelivery Dev kit V4 not working too... :(

@nob0dy80
Copy link

nob0dy80 commented Jan 6, 2023

Mine failed too.
almost seems like there are more boards that don't work than those that work. Is that perhaps due to the Nukihub code rather than the ESP32 itself?

@nob0dy80
Copy link

nob0dy80 commented Jan 8, 2023

for those who are still looking: https://www.amazon.de/gp/product/B0811LGWY2/

This ESP32 works.

@Stilzchen
Copy link

That is my working one: https://www.amazon.de/gp/product/B09LS6SCF7

@shlomki
Copy link

shlomki commented Jan 13, 2023

Following the same steps (enabled/disabled Bluetooth pairing/reset) doesn't resolved the pairing issue with all devices I've been tested on my side.

Are you able to find out the exact chip on your AZ-Delivery V4? My working chip is a ESP32-D0WDQ6 (ESP32D). Your AZ-Delivery V2 should be an ESP32S, I think.

My full steps after resetting my Nuki device:

  1. esptool.py erase_flash
  2. flash ESP with esptool like described in readme.txt
  3. configure Wifi settings
  4. configure MQTT settings
  5. pairing Nuki first with app
  6. diasble pairing in app (Settings --> Features & Configuration --> Button & LED --> Bluetooth Pairing)
  7. enable pairing in app
  8. bring Nuki device in paring mode

I never tried "register as app" in nukihub Advanced NUKI Configuration, because I do not own more than one Nuki - no bridge or something else.

Hey guys, I have the DevKitV1 and I was just able to pair using the steps above. At first it didn't pair at all, but after trying the steps outlined here it worked all of the sudden. I'm not sure what's the reason.

The one I have is the "ESP32-CH9102X" version, ordered from here: https://www.aliexpress.com/item/32959541446.html?spm=a2g0o.order_list.order_list_main.43.6a991802bAp4Y8

@nob0dy80
Copy link

nob0dy80 commented Jan 13, 2023

@shlomki
Nice it worked for you. Tried several ESP32 and none of them worked with those steps.

As stated as "working" on the mainpage, i really recommend everyone to get an ESP32D to get away from any difficulties. Those ESP32D just work out of the box, and it seems like, it doesnt matter what kind of board it is as long it got a ESP32D.
myself tried 3 differend ESP32D boards now and everyone worked out of the box.
But sure, if you like lottery, you can try ESP32. You may have luck, but mostly you dont.

@amastrogiacomo1968
Copy link

This works 100% https://it.aliexpress.com/item/32864722159.html

@SergioWarriorPeru
Copy link

I have bought this and work fine
https://a.aliexpress.com/_mqSdNjU

@Jejebond
Copy link

This works 100% https://it.aliexpress.com/item/32864722159.html

Wich one ? The 32D ?

@amastrogiacomo1968
Copy link

This works 100% https://it.aliexpress.com/item/32864722159.html

Wich one ? The 32D ?

Yes

@Jejebond
Copy link

This works 100% https://it.aliexpress.com/item/32864722159.html

Wich one ? The 32D ?

Yes

I'm getting it. Can you tell the model of your smartlock (3 or 3 pro), firmware version and nuki_hub integration version for futur comparaison ?

@technyon
Copy link
Owner

I have more reports that erasing the ESP and then (re-)flashing does help pairing problems. If it doesn't work for you, you can use the espressif download tool (or esptool.py) to erase the flash. Then try flashing a new firmware.

@sumur1au
Copy link

sumur1au commented Feb 5, 2023

I also had paring issues with my ESP32 until I upgraded to 8.2 with the downgraded BLE library. It paired after a few attempts. I bought this EPS32 MCU from Amazon Australia https://www.amazon.com.au/DIGISHUO-ESP-WROOM-32-Development-Microcontroller-Integrated/dp/B097DCN76N

@magior
Copy link

magior commented Feb 19, 2023

Same problem here; I have two different type of ESP32 boards, very similar: one is from AZ-Delivery, and the other one from an unknown manufacturer.
They both identify as:

Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None

Do I need to buy another type, or is it possible to get one working?

@technyon
Copy link
Owner

technyon commented Apr 4, 2023

Since there's no activity here, I'll close this for now.

If you still have issues, please try release the latest release, version 8.18 has a fix for pairing issues.

@technyon
Copy link
Owner

I've added the M5Stack Atom Lite to the readme, which is known to work and is recommended due to its improved antenna.

@sgouedj
Copy link

sgouedj commented May 28, 2023

I can't pair my ESP32-WROOM 32U. I erased the firmware and reflashed with the ESP tool, without success...

@technyon
Copy link
Owner

The external antenna is properly connected?

@sgouedj
Copy link

sgouedj commented May 29, 2023

I hadn't connected it!...it works now.
Bluetooth signal -82dbm, wifi -59dbm
a big thank-you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests