dauden1184/RaspiNukiBridge

Error while pairing nuki

Opened this issue · 4 comments

xircom commented

any suggestions?? Thanks

root@raspberrypi:/home/david/RaspiNukiBridge# python3 . --verbose --pair 54:D2:72:30:BA:5D
/home/david/RaspiNukiBridge/./nuki.py:135: FutureWarning: This method will be removed in a future version of Bleak. Use the detection_callback of the BleakScanner constructor instead.
  self._scanner.register_detection_callback(self._detected_ibeacon)
2023-12-29 22:15:47.332|I|__main__.py:278|Generatig keys for Nuki 54:D2:72:30:BA:5D
2023-12-29 22:15:47.338|I|__main__.py:282|bridge_public_key: 7d10679a249f5f7e9c556b985be90d0d10c0401d24cbe578d773d18330bd4447
2023-12-29 22:15:47.341|I|__main__.py:283|bridge_private_key: 7c05370796e527efe846c09590d8634ef327a1a67e6c9a231125f38b5f9bdfef
2023-12-29 22:15:47.365|I|nuki.py:173|Stop scanning
2023-12-29 22:15:47.367|I|nuki.py:570|Nuki connecting
2023-12-29 22:15:48.395|D|nuki.py:572|Services ['0000003e-0000-1000-8000-0026bb765291 (Handle: 44): Unknown', '000000a2-0000-1000-8000-0026bb765291 (Handle: 30): Unknown', 'a92ee200-5501-11e4-916c-0800200c9a66 (Handle: 12): Unknown', 'a92ee100-5501-11e4-916c-0800200c9a66 (Handle: 8): Unknown', '00000045-0000-1000-8000-0026bb765291 (Handle: 119): Unknown', '00000044-0000-1000-8000-0026bb765291 (Handle: 151): Unknown', '00000055-0000-1000-8000-0026bb765291 (Handle: 96): Unknown', '00000096-0000-1000-8000-0026bb765291 (Handle: 164): Unknown', '0000180a-0000-1000-8000-00805f9b34fb (Handle: 21): Device Information']
2023-12-29 22:15:48.403|D|nuki.py:573|Characteristics ['00000220-0000-1000-8000-0026bb765291 (Handle: 91): Unknown', '00000030-0000-1000-8000-0026bb765291 (Handle: 67): Unknown', '00000014-0000-1000-8000-0026bb765291 (Handle: 47): Hardcopy Data Channel', '00000023-0000-1000-8000-0026bb765291 (Handle: 62): Unknown', '00000052-0000-1000-8000-0026bb765291 (Handle: 72): Unknown', '000000a6-0000-1000-8000-0026bb765291 (Handle: 82): Unknown', 'e604e95d-a759-4817-87d3-aa005083a0d1 (Handle: 45): Unknown', '00000021-0000-1000-8000-0026bb765291 (Handle: 57): Unknown', '00000053-0000-1000-8000-0026bb765291 (Handle: 77): Unknown', '00000020-0000-1000-8000-0026bb765291 (Handle: 52): Unknown', '00000037-0000-1000-8000-0026bb765291 (Handle: 33): Unknown', '000000a5-0000-1000-8000-0026bb765291 (Handle: 38): Unknown', 'e604e95d-a759-4817-87d3-aa005083a0d1 (Handle: 31): Unknown', 'a92ee202-5501-11e4-916c-0800200c9a66 (Handle: 16): Unknown', 'a92ee203-5501-11e4-916c-0800200c9a66 (Handle: 19): Unknown', 'a92ee201-5501-11e4-916c-0800200c9a66 (Handle: 13): Unknown', 'a92ee101-5501-11e4-916c-0800200c9a66 (Handle: 9): Unknown', 'e604e95d-a759-4817-87d3-aa005083a0d1 (Handle: 120): Unknown', '00000023-0000-1000-8000-0026bb765291 (Handle: 146): Unknown', '000000a5-0000-1000-8000-0026bb765291 (Handle: 122): Unknown', '0000001d-0000-1000-8000-0026bb765291 (Handle: 128): Unknown', '0000001e-0000-1000-8000-0026bb765291 (Handle: 137): MCAP Control Channel', '00000037-0000-1000-8000-0026bb765291 (Handle: 159): Unknown', '00000019-0000-1000-8000-0026bb765291 (Handle: 154): AVDTP', 'e604e95d-a759-4817-87d3-aa005083a0d1 (Handle: 152): Unknown', '0000004e-0000-1000-8000-0026bb765291 (Handle: 104): Unknown', '0000004c-0000-1000-8000-0026bb765291 (Handle: 99): Unknown', '0000004f-0000-1000-8000-0026bb765291 (Handle: 109): Unknown', '00000050-0000-1000-8000-0026bb765291 (Handle: 114): Unknown', 'e604e95d-a759-4817-87d3-aa005083a0d1 (Handle: 97): Unknown', 'e604e95d-a759-4817-87d3-aa005083a0d1 (Handle: 165): Unknown', '00000068-0000-1000-8000-0026bb765291 (Handle: 167): Unknown', '00000023-0000-1000-8000-0026bb765291 (Handle: 185): Unknown', '0000008f-0000-1000-8000-0026bb765291 (Handle: 173): Unknown', '00000079-0000-1000-8000-0026bb765291 (Handle: 179): Unknown', '00002a26-0000-1000-8000-00805f9b34fb (Handle: 26): Firmware Revision String', '00002a27-0000-1000-8000-00805f9b34fb (Handle: 24): Hardware Revision String', '00002a25-0000-1000-8000-00805f9b34fb (Handle: 22): Serial Number String', '00002a24-0000-1000-8000-00805f9b34fb (Handle: 28): Model Number String']
/home/david/RaspiNukiBridge/./nuki.py:575: FutureWarning: This method will be removed future version, use the services property instead.
  services = await self._client.get_services()
2023-12-29 22:15:48.414|I|nuki.py:248|Device type: DeviceType.SMARTLOCK_1_2
2023-12-29 22:15:48.481|I|nuki.py:582|Connected
2023-12-29 22:15:48.483|D|nuki.py:547|Sending data to a92ee101-5501-11e4-916c-0800200c9a66: b"\x01\x00\x03\x00'\xa7"
2023-12-29 22:15:48.647|D|nuki.py:447|Notification handler: a92ee101-5501-11e4-916c-0800200c9a66 (Handle: 9): Unknown, data: bytearray(b'\x03\x00\xacN\x01I2X\xab\xca\x93)\xaf\x02\\\x19xu\xdd\xfc\x1b\xc1\xb1c\x9e%\xb9\x14\xf7Q\xd12\xe5\rZ\x12')
Task exception was never retrieved
future: <Task finished name='Task-9' coro=<Nuki._notification_handler() done, defined at /home/david/RaspiNukiBridge/./nuki.py:446> exception=AttributeError("'Nuki' object has no attribute '_box'")>
Traceback (most recent call last):
  File "/home/david/RaspiNukiBridge/./nuki.py", line 452, in _notification_handler
    uncrypted = self._decrypt_command(bytes(data))
  File "/home/david/RaspiNukiBridge/./nuki.py", line 287, in _decrypt_command
    decrypted = self._box.decrypt(encrypted)
AttributeError: 'Nuki' object has no attribute '_box'
2023-12-29 22:16:18.495|I|nuki.py:587|Connection timeout
2023-12-29 22:16:18.498|I|nuki.py:591|Nuki disconnecting
2023-12-29 22:16:19.200|I|nuki.py:169|Start scanning

Hi,
what nuki model/version are you using?

xircom commented

Hello, it's a Nuki 3.0 version 3.7.7

Good morning and a happy new year,
having similar problems with Nuki 3.0 version 3.77:

python3.7 . --verbose --pair 54:D2:72:02:45:55 ./nuki.py:135: FutureWarning: This method will be removed in a future version of Bleak. Use the detection_callback of the BleakScanner constructor instead. self._scanner.register_detection_callback(self._detected_ibeacon) 2024-01-02 08:23:00.775|I|__main__.py:278|Generatig keys for Nuki 54:D2:72:02:45:55 2024-01-02 08:23:00.775|I|__main__.py:282|bridge_public_key: 9909d56288aaacff654444b1184ca8cc24a3c796101116af20f42f87xxxxxx 2024-01-02 08:23:00.776|I|__main__.py:283|bridge_private_key: 1c699a752f4b4737107203f9502642519bd4c1c0fa2d8ab1a0d65741xxxxxx 2024-01-02 08:23:00.779|I|nuki.py:173|Stop scanning 2024-01-02 08:23:00.779|I|nuki.py:570|Nuki connecting Task exception was never retrieved future: <Task finished coro=<Nuki.pair() done, defined at ./nuki.py:639> exception=BleakDBusError('org.freedesktop.DBus.Error.AccessDenied', 'Rejected send message, 2 matched rules; type="method_call", sender=":1.174" (uid=1000 pid=10323 comm="python3.7 . --verbose --pair 54:D2:72:02:45:55 ") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination="org.bluez" (uid=0 pid=10142 comm="/usr/lib/bluetooth/bluetoothd ")')> Traceback (most recent call last): File "./nuki.py", line 644, in pair await self.connect() File "./nuki.py", line 571, in connect await self._client.connect() File "/home/pi/.local/lib/python3.7/site-packages/bleak/__init__.py", line 531, in connect return await self._backend.connect(**kwargs) File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/client.py", line 128, in connect backend=BleakScannerBlueZDBus, File "/home/pi/.local/lib/python3.7/site-packages/bleak/__init__.py", line 313, in find_device_by_address **kwargs, File "/home/pi/.local/lib/python3.7/site-packages/bleak/__init__.py", line 369, in find_device_by_filter async with cls(detection_callback=apply_filter, **kwargs): File "/home/pi/.local/lib/python3.7/site-packages/bleak/__init__.py", line 152, in __aenter__ await self._backend.start() File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/scanner.py", line 174, in start manager = await get_global_bluez_manager() File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/manager.py", line 910, in get_global_bluez_manager await instance.async_init() File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/manager.py", line 233, in async_init assert_reply(reply) File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply raise BleakDBusError(reply.error_name, reply.body) bleak.exc.BleakDBusError: [org.freedesktop.DBus.Error.AccessDenied] Rejected send message, 2 matched rules; type="method_call", sender=":1.174" (uid=1000 pid=10323 comm="python3.7 . --verbose --pair 54:D2:72:02:45:55 ") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination="org.bluez" (uid=0 pid=10142 comm="/usr/lib/bluetooth/bluetoothd ")

xircom commented

nothing?