-
Notifications
You must be signed in to change notification settings - Fork 53
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
flicd hanging after pairing attempt. #117
Comments
Seems like it sends the wrong event Can you please post the output of btmon so that includes when you start flicd until the error occurs? |
@yetzt nah the log starts with a start scan + an advertisement event, which means that flicd had already been started earlier at the time btmon logging was started. |
Can you also see if there is a new firmware/driver for the Bluetooth chip and if that fixes the problem? |
i upgraded my vm to the latest debian and ensured all packages are current and the firmware binary blobs are the ones from the kernel git. i added a second bluetooth dongle just in case.
next i started btmon then i started flicd on the first bluetooth controller:
then i tried to pair my button via
after that i stopped flicd and tried on the second controller
after that i tried again to pair the button with
again, the first attempt ended with after that i stopped flicd again and ended btmon as well. |
Can you please contact the manufacturer of the Bluetooth dongle and file an issue? It is the exact same issue as observed in one of Espressif's chips: espressif/esp-idf#6698. |
In the meantime, please test this version with a workaround and let me know if it works. |
i would give it a try, but the glibc version on debian bookworm is behind the one this was compiled with
i will be trying to run it in a chrooted environment |
Can you try Ubuntu 24.04 or newer? |
i will try and report back. |
this did not work with the output of
output of
however it worked with the output of
output of
|
after some struggle i got four out of six buttons to pair, with the fifth button not pairing after 10 attempts and the sixth button not being seen at all. this might be a limitation of the bluetooth chip though. the other buttons work fine with the flic home assistant integration. thanks for bearing with me and investing your time to help me out. i would appreciate an official build including the workaround that i can run on my existing vm. |
In the first log, if you open it in Wireshark and inspect packet number 290-293, you can see that it very much appears as the LE Connection Complete Event sent by the controller as packet 293 has been delayed until it was "poked" with packet 292. It is very unlikely that it connects immediately when we initiate a timeout based cancellation (in packet 292). Additionally, packet 301 tells us that the button initiated a disconnection, which in its firmware does 15 seconds after connection was established in case it does not receive anything from the central. Since there should thus be at least 15 seconds between the LE Connection Complete event and this event, it is clear that the packets from the Bluetooth controller is getting stuck somewhere. Possibly in the USB driver of the computer or, if you use a VM, somewhere between the VM and the host USB stack. Or in the Linux driver for the USB Bluetooth dongle. For the second log, it appears simply that you didn't press and held the button for 7 seconds so that it started advertising in Public mode, as indicated by the first upper case F rather than lower case f in its advertised name. At least from the info in the log. If there is a maximum connection limit for the Bluetooth chip that you are reaching, you should detect this with the "info" command, see https://github.com/50ButtonsEach/fliclib-linux-hci/blob/master/ProtocolDocumentation.md#evtgetinforesponse. If you try to pair using the simpleclient program, you can issue the "info" command after and see if it indeed has reached the maximum number of connections. Let me know in that case what the maximum number is. (I'm curious) |
I will investigate this further when i find the time. |
I have original Flic buttons (from 2016, not version two), they work fine with the Flic app on MacOS.
I am running the x86_64 version of flicd using an rtl8761b based USB bluetooth adapter. I'm starting flicd
flicd -f flicd.sqlite -s 0.0.0.0
. I connect with the node client. The button is found, but after attempted pairing, i receive a timeout.On subsequent tries no button is found until i restart flicd.
According to btmon, there apears to be some sort of endless loop until flicd is stopped.
I've attached the btmon log in text and btsnoop format:
btmonlog.txt
btmonlog.btsnoop
I hope this issue can be resolved.
I have to express my frustration that the flicd server component is proprietary closed source and offers no way to debug anything. This is stark contrast of the "hackable" advertisement that lead me to buy this product back in 2015. I have waited almost a decade now to use these buttons for anything but making fart noises.
The text was updated successfully, but these errors were encountered: