oyooyo / keyble

Command line tools and library for controlling eqiva eQ-3 Bluetooth smart locks
92 stars 29 forks source link

register does not work #1

Closed husqar closed 6 years ago

husqar commented 6 years ago

[root@hawkstar husqar]# keyble-registeruser --qr_code_data XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --user_name hsqr Press and hold "Unlock" button until the yellow light flashes in order to enter pairing mode Registering user on Smart Lock with address "00:1a:22:0a:1c:14", card key "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" and serial "NEQ1064762"...

Nothing morge happens on my system...

oyooyo commented 6 years ago

Sorry to hear that. What operating system and version of Node.js are you using?

The few people that I know of who've tried this software yet did not report any problems with user registration, so I must admit I currently have no clue what might the problem in your case. :-(

You could try placing DEBUG=* ahead of the keyble-registeruser command, like DEBUG=* keyble-registeruser --qr_code_data .... The debug output is not very useful yet, but it's the only thing I can currently think of that might help understanding this issue. Except for some bluetooth MAC addresses, there should be no sensitive information in the actual debug output. So as long as you XXXXXX the QR-Code data and the card key like you already did, it should be okay to post the debug output.

husqar commented 6 years ago

I'm using Fedora28, a UD100 Bluetooth Stick and Node.js v8.11.0.

husqar commented 6 years ago

I've got this output now:

Registering user on Smart Lock with address "00:1a:22:0a:1c:14", card key "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX" and serial "NEQ1064762"... hci setting filter to: 1600000020c10000000000400000 +0ms hci set event mask - writing: 01010c08fffffbff07f8bf3d +3ms hci set le event mask - writing: 010120081f00000000000000 +0ms hci read local version - writing: 01011000 +0ms hci write LE host supported - writing: 016d0c020100 +1ms hci read LE host supported - writing: 016c0c00 +0ms hci read bd addr - writing: 01091000 +0ms hci set scan enabled - writing: 010c20020001 +1ms

oyooyo commented 6 years ago

I just tried reinstalling keyble and may have run into the very same issue. After the Registering user on Smart Lock with address "00:1a:22:0a:1c:14", card key "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" and serial "NEQ1064762"... output, did the program hang, or did it exit?

husqar commented 6 years ago

It exits.

oyooyo commented 6 years ago

Okay, then I'm indeed running into the same issue. I believe to have figured out one part of the problem: Passing the QR-code data directly on the command line doesn't seem to work yet. I guess I never tried that way, I always used the zbarcam --raw | keyble-registeruser version. But apparantly this is not the only problem, I'm now getting another problem instead. I assume I've messed something up when I published one of the recent versions.

I'll try to resolve this issue at the weekend. Thanks a lot for reporting this bug!

husqar commented 6 years ago

ok it works now after I pass the QR Data via pipe but it seem like the UD100 stick does not support LE..

although it should...

I'll try it with a raspberry later..

oyooyo commented 6 years ago

In case you were getting some noble warning: unknown peripheral XXXXXXXXXXX message, everything is fine - that is the issue I'm currently also running in, and that is definitely a bug in the current code.

oyooyo commented 6 years ago

I just published version 0.1.5 which should at least solve the issue that Bluetooth connections no longer worked. I don't understand what the problem was, I just re-installed all dependencies and it worked. The issue with keyble-registeruser not working if the QR-code is passed directly on the command line is not fixed in that version, one still has to use something like zbarcam --raw | keyble-registeruser.

Please try updating to that version by running $ sudo npm install --update -g --unsafe-perm keyble and see if it works now.

If above command quits with an error like Refusing to delete /usr/bin/keyble- (...) symlink target is not controlled by npm, then run $ sudo rm /usr/bin/keyble-* first. I renamed two files and wasn't aware that this would would lead to an error when updating or un-installing keyble. :-(

husqar commented 6 years ago

it works for me now

Ircama commented 6 years ago

I have not verified any issue on a Raspberry Pi Zero W with Raspbian O.S.

I decoded the QR code through a smartphone with a standard QR scan App.

I tested both the -n and the -q options of keyble-registeruser.

(Notice that the registeruser process is currently very slow.)

oyooyo commented 6 years ago

I believe the mentioned issues are all solved in the current version, so I'm closing this issue for now.