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 won't connect #38

Open
Roaders opened this issue Mar 20, 2016 · 16 comments
Open

Button won't connect #38

Roaders opened this issue Mar 20, 2016 · 16 comments

Comments

@Roaders
Copy link

Roaders commented Mar 20, 2016

On Raspberry Pi 3 with Bluez 5.37.
I've made sure that hciconfig is up

I'm new to linux so this has all been a bit painful for me - it took most of the morning to get the correct version of Bluez installed.
The situation at the moment is that I can get bluez running, get the daemon running and get flic running.
Running all of this doesn't always work. Sometimes I have to stop them all and start them again.

I did manage to get one button discovered - but only once. After a button has been discovered it will never be discovered again so as I didn't write down the mac address for the first button I can't get it again!

When I try to connect to the button it says connecting to then connection failed.

I also need some help on replacing the bluetooth service that comes with Raspbian with the new version of raspbian that I built - at the moment I need to turn the built in service off then start the new one.
Also how do I run the daemon and flic as a service?

Sorry for all the questions, I know a lot of these are not flic related specifically.

Any help much appreciated.

@fabianbergmark
Copy link
Contributor

I would suggest disabling the bluetooth service and just run bluetoothd from the src folder in bluez, don't forget -nEd flags (you built with --enable-experimental right). Secondly, you can just type list in the flic executable to list any discovered buttons. A good idea is to, in bluetoothctl issue a power off / power on after you start bluetoothd.

@Roaders
Copy link
Author

Roaders commented Mar 20, 2016

Thanks for the reply. I did manage to get a list of the 2 buttons that I registered with list - once but now I get nothing with list.
I did build with exactly the commands listed on the readme.

I don't understand in bluetoothctl issue a power off / power on

I start bluetooth in the folder I compiled:
sudo ./bluetoothd -nEd

in a separate window I can then launch bluetoothctl and I get a [bluetooth] # prompt but I can't type anything.

@fabianbergmark
Copy link
Contributor

if you can't type in bluetoothctl it usually means something is wrong with your bluetooth adapter. I have tried raspberrypi 3 model B and it worked very well for me, so the bluetooth chip is compatible with Flic.

@asabi
Copy link

asabi commented Mar 20, 2016

I have the bluetooth adapter on, everything "looks good" until I run strartScan, at that point I get "Failed to start scan: no adapters". I cannot find any information about this error (running on raspberry pi 3 with raspbian).

@pfink
Copy link

pfink commented Mar 20, 2016

@asabi: Please check with command hciconfig if your BT adapter is up and running. The term UP RUNNING should appear.

@asabi
Copy link

asabi commented Mar 20, 2016

Yes, it does the UP RUNNING.

One thing I noticed is that my bluez version is: 5.23-2+rpi1

Will that be a problem? I am not sure how to upgrade it on the pi 3, all of the tutorials I see assume you install from source, but the pi 3 comes with it.

@Roaders
Copy link
Author

Roaders commented Mar 20, 2016

There are instructions on the readme about how to download, compile and install bluez.

@asabi
Copy link

asabi commented Mar 20, 2016

I understand that 5.38 is broken with flic. I will try with 5.37

@asabi
Copy link

asabi commented Mar 20, 2016

Can I simply grab it from here: https://www.kernel.org/pub/linux/bluetooth/ , or will that be the wrong version?

@pfink
Copy link

pfink commented Mar 20, 2016

Yes, you can grab it from there.

@asabi
Copy link

asabi commented Mar 20, 2016

I was able to make it work with the downloaded bluez 5.37, but it works only when I cd into the src directory and run the bluetoothd there, otherwise it does not run. I suspect that by default the system still uses the default bluez .. any instructions anywhere to make that work as a default?

I am also using that machine to control my August lock, and it uses bluez as well.

@pfink
Copy link

pfink commented Mar 20, 2016

You have to edit the sysv init script. But this is very basic linux knowledge and it would go too far to cover it here. Be aware that fliclib is currently in beta phase (rather alpha in my opinion) which means experimental usage is intended, especially for advanced (linux) users. If you're looking for out-of-the-box instructions how to run everything smoothely for operational use, then it's may better for you to wait for release. Nevertheless, you're free to experiment, find out things and contribute. That's what we all do here.

@gareth-ellis
Copy link

I came across similar issues. I was struggling to get the device to pair - originally with 5.38, and then when I checked on here 5.37.
Part of the issue I think was knowing whether the flic was locked or not.

Eventually it just started working. If the daemon was able to feedback to say that the device was locked - I may take a look at some point to see if it's possible to expose it - as obviously the flic responds somehow for the android app to be able to say that the flic is locked.

Good so far though - managed to get my flic to interact with node-red & wifi plug sockets quite easily

@fabianbergmark
Copy link
Contributor

Nice! I can add a locked notice in the flic executable

@morganm
Copy link

morganm commented Apr 11, 2016

So I got my Flic's in the mail last week and gave this a crack on my RPi3 over the weekend. It ended with me having the button discovered but the samples would not show button presses. I tried Python and C++. Watching the output from bluetoothd or from the flic daemon showed activity, and I can see the device connecting via the flic program and it is listed as a paired device in bluetoothctl. So I have connectivity and am seeing communication in the debug logs, but nothing comes out the other end from the flic python/C++ libraries.

I came here to report an issue and noticed this thread stating that 5.37 of bluez is the version to be used. If this is the current state of affairs, please update the README instructions to state this fact, so new developers don't waste time trying with the latest version only to find out that we need an older version when we come to report an issue hours later.

The latest bluez as of this writing is 5.39 and so is what I attempted to use. I see people reporting problems with 5.38 and success with 5.37. Is it safe to assume then that this was not fixed in 5.39 and I need to revert to 5.37 to achieve success?

@fabianbergmark
Copy link
Contributor

I have now updated the Readme, sorry for the slow update

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

6 participants