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

Button not detected - Using recommended bluetooth adapter #111

Open
pollev opened this issue Nov 21, 2022 · 8 comments
Open

Button not detected - Using recommended bluetooth adapter #111

pollev opened this issue Nov 21, 2022 · 8 comments

Comments

@pollev
Copy link

pollev commented Nov 21, 2022

Hi,

I am currently unable to get my flic buttons to pair with the flic service.
I even went as far as to order the exact bluetooth adapter recommended on this page: (Sena Technologies Parani-UD100-G03).
There is very little debug options available so I am currently stuck :(.
Any advise would be recommended.

I am taking the following steps:

  1. Start the service
  2. Start the simple client
  3. Start the scanning wizard
  4. Click (and hold for 7s) the flic button

Terminal outputs and btmon output attached. Thank you for any help you can give me.

Terminal 1:

sudo /media/warm_storage/home_assistant/flicd/flicd -f /media/warm_storage/home_assistant/flicd/db -s "0.0.0.0" -p 5551 -h hci1
Available HCI devices found:
hci1
hci0

Trying hci1
hci1 is busy, shutting down and retrying...
Successfully bound HCI socket
Flic server is now up and running!
Warning: Bluetooth controller does not support pending connection and scanning at the same time. Will emulate this as good as possible.
Initialization of Bluetooth controller done!
Accepted new client

Terminal 2:

/tmp/flicd/fliclib-linux-hci/simpleclient$ sudo ./simpleclient localhost
Available commands:
getInfo - get various info about the server state and previously verified buttons
startScanWizard - start scan wizard
cancelScanWizard - cancel scan wizard
startScan - start a raw scanning of Flic buttons
stopScan - stop raw scanning
connect xx:xx:xx:xx:xx:xx id - first parameter is the bluetooth address of the button, second is an integer identifier you set to identify this connection
disconnect id - disconnect or abort pending connection
changeModeParameters id latency_mode auto_disconnect_time - change latency mode (NormalLatency/LowLatency/HighLatency) and auto disconnect time for this connection
forceDisconnect xx:xx:xx:xx:xx:xx - disconnect this button, even if other client program are connected
getButtonInfo xx:xx:xx:xx:xx:xx - get button info for a verified button
createBatteryStatusListener xx:xx:xx:xx:xx:xx id - first parameter is the bluetooth address of the button, second is an integer you set to identify this listener
removeBatteryStatusListener id - removes a battery listener
delete xx:xx:xx:xx:xx:xx - delete button
help - prints this help text

startScanWizard
Please click and hold down your Flic button!
Scan wizard done with status WizardFailedTimeout

Terminal 3 (see attached file):

sudo btmon > /tmp/btmon_out

btmon_out.txt

@Emill
Copy link
Collaborator

Emill commented Nov 21, 2022

I see that your button is advertising as expected.

Could it be that your button is already added? You can execute getInfo to check that. In that case you can connect to it using connect [xx:x:xx:xx:xx:xx] [id].

Otherwise try to kill bluetoothd so it doesn't "override" flicd.

@pollev
Copy link
Author

pollev commented Nov 22, 2022

Hi Emill,

Thank you for your feedback.
I can confirm that the button is NOT yet connected. No output from getInfo and it also still flickers red when I press it.
The behavior is also identical when I uninstall (or disable) the bluetooth deamon.

Can you suggest another test I could perform to debug this situation?

@Emill
Copy link
Collaborator

Emill commented Nov 22, 2022

It's very strange. I've not seen this issue before. Could you potentially try a different Flic button or another computer/dongle? Is the button working in the iOS/Android app?

@pollev
Copy link
Author

pollev commented Nov 22, 2022

The button is working as expected when using the app. It connects immediately. (just tried it)
I have tried 2 seperate bluetooth dongles, the latter being advertised on this github.
Neither seems to allow the button to be detected, though both bluetooth dongles work properly and can detect any other devices if I enable the bluetooth deamon.

I initially wanted to add some debug statements to the library but noticed that it is not open source. So my debugging capabilities are now limited to asking for your support. Any other recommendations to try? Are there any verbose flags I could enable to get to the bottom of this?

@Emill
Copy link
Collaborator

Emill commented Nov 22, 2022

I guess you tried deleting the database file and restart flicd?

@pollev
Copy link
Author

pollev commented Nov 22, 2022

I had not tried deleting the db file. But I just tried and same result sadly :/

@pollev
Copy link
Author

pollev commented Jan 2, 2023

Hi Emill, any other debugging you can advise me. I was really hoping to actually get to use these buttons :(

@treegartner
Copy link

treegartner commented Jan 3, 2023

Have you tried using another implementation? When I was setting up the fliclib, I used the python implementation, which worked quite well.

# start the service as usual (in my case) !! do you use the correct version for your system e.g. armv6l or x86_64?
~/dev/fliclib-linux-hci/bin/armv6l/flicd -d -f ~/.flic/buttons.db
# start the testclient in python
python3 ~/dev/fliclib-linux-hci/clientlib/python/test_client.py
# in another terminal (or screen) i start the scan wizard
python3 ~/dev/fliclib-linux-hci/clientlib/python/scan_wizard.py

One thing I stumbled upon was, that I need a working internet connection for whatever reason to connect the button. So therefore you might also check network, proxy and firewall settings.

Hope that helps a bit, getting a step closer to your solution.

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

3 participants