jandebeule / nukiPyBridge

40 stars 19 forks source link

Python 3 support and probably further issues #18

Open monoluser opened 4 years ago

monoluser commented 4 years ago

Thank you for sharing your code. I've ported it to Python 3 as far as I could, but still get errors:

Starting BLE adapter... Init Nuki BLE connection... Nuki BLE connection established Nuki Pairing UUID handle created: 008b Traceback (most recent call last): File "./init.py", line 17, in nuki.authenticateUser(myPublicKeyHex, myPrivateKeyHex, myID, myIDType, myName) File "/home/pi/nukiPyBridge/nuki.py", line 88, in authenticateUser publicKeyReqCommand = publicKeyReq.generate() File "/home/pi/nukiPyBridge/nuki_messages.py", line 50, in generate return array.array('B',msg.decode("hex")) AttributeError: 'str' object has no attribute 'decode'

Can you check my changes and if they're fine, fix the (hopefully) small rest?

nukiPyBridge.diff.txt

giejay commented 4 years ago

I don't think this repo is maintained anymore. I forked it, made it Python3 compatible and fixed a bunch of other stuff. Also added a REST layer to easily communicate with the locks from a browser: https://github.com/giejay/nukiPyBridge

monoluser commented 4 years ago

Thank you so much for your fast answer. I'll close this and continue at your repo

monoluser commented 4 years ago

I can't open a new issue report there so I'll continue here. I'm getting this error:

Starting BLE adapter... Init Nuki BLE connection... Nuki BLE connection established Nuki Pairing UUID handle created: 008b Requesting Nuki Public Key using command: Nuki_REQ Payload: Nuki_PUBLIC_KEY Nuki Public key requested Nuki returned unexpected response (expecting PUBLIC_KEY): Nuki_ERROR Error Code: 10 Command Identifier: 0001

What's the problem? Do you need more information about the SmartLock?

giejay commented 4 years ago

Sometimes it takes two or more efforts before the lock gets recognized.

Is the lock close enough? Did you start pairing mode?

monoluser commented 4 years ago

There was a problem with virtualization. Works now like a charm until the isNewNukiStateAvailable() stuff. lock.txt unlock.txt