# Many, many bluez issues trying to install keyboard [SOLVED?]

## calavicci

I am trying to get an Apple bluetooth keyboard working with Gentoo. It has worked previously; but I still don't know how I managed to get it set up in the first place; it was always a little odd; and now it's stopped working entirely.

I tried updating to the newest version of the BlueZ packages... that was a mistake.

So here's the summary:

(1) net-wireless/bluez is blocking net-wireless/bluez-libs and net-wireless/bluez-utils, and vice versa. I'd think that I'm not supposed to merge them simultaneously, but revdep-rebuild --library libbluetooth.so.1 (which I was told to run in the emerge output) insists on it.

Assuming that revdep-rebuild is off its rocker, I tried installing one, then the other:

(2) net-wireless/bluez 4 seems useless; how do I actually connect a device? I don't want to use bluez-gnome or one of the other over-inflated desktop environment packages; I have a pretty minimal system, and I don't want to be running even a single daemon or loading a single library more than I have to. If there isn't just a good ol' command-line solution to this, the people at BlueZ just suck.

(3) net-wireless/bluez-libs and net-wireless/bluez-utils 3 seems better in that I can emerge with the "old-daemons" USE flag... I'd rather go ahead and implement the new solution (whatever that is), but I know how to use hidd (at least a little bit). 

There just doesn't seem to be any useful documentation on the new interfaces. The only documentation that seems to address even the right versions of the software are these stupid Ubuntu threads that basically say, "Hey, because we loaded every wasteful package in creation onto your machine, you can just add the appropriate BD_ADDR to some config file, and voila! You won't be using half of what's in memory, but you didn't really want performance anyway, now did you?" The BlueZ wiki is only useful for programming in their API.

(4) I can see they keyboard via hcitool -scan. I can ping it with l2ping.

(5) The keyboard's name was apparently changed from "Apple Wireless Keyboard" to something funky when it connected to my former roommate's laptop. My terminal doesn't even seem to support one of the characters in the new name; is this going to be a hindrance? Does the name entry for the device in hcid.conf need to match the device's actual name?

(6) The material I've been reading doesn't seem to have any consensus on how to implement PINs or passkeys. I honestly don't know which I should use, what helper/agent I should be using, or how the helpers/agents actually work (E.G., /etc/bluetooth/pin-helper had no man page or help output whatsoever.). I've been hacking away at the passkey entry in /etc/bluetooth/hcid.conf and at /etc/bluetooth/pin, but neither seem to have any effect. Additionally, should I be using security=user or security=auto? It seems like user must be preferable to auto, which seems like a security risk. That is complicated by:

(7) The most success I seem to have had is with bluez-libs and bluez-utils 3, USE="old-daemons", passkey="1234", security=auto. At the very least, hidd seems to be waiting for something when I do this; when I change security to user, for example, hidd just immediately spits out: "cannot create HID control channel: connection refused." In the threads documenting how to set up the keyboards, once hidd is waiting, I should type my passkey in on the Apple keyboard and hit return. I do this... and nothing happens. The documentation on that error message seems to say that it most likely means that the device has timed out for the pairing, but the blinky green light on my keyboard proves that this is not the case.

(8) Nobody on #bluez-users has even acknowledged my existence.

What am I doing wrong? What can I do better? It just doesn't seem like there is that much to getting a keyboard to connect to my computer. What am I missing?

EDIT: I couldn't really decide in which forum to put this. Bluetooth seemed like a "networking" thing. Where should I be posting?Last edited by calavicci on Mon Oct 26, 2009 9:32 pm; edited 1 time in total

----------

## Ant P.

Wish I could help you here but I had the same problem...  :Sad: 

I was struggling with a bluetooth keyboard for several months, the only way I could get it to work at all was the bluez-gnome applet (and then it only connected once per boot). In the end I gave up. The situation on Debian wasn't much better either. At first I thought I had a defective keyboard until I borrowed a Mac, and saw it working fine.

Has anyone out there ever got this to work?

----------

## too7

I can't tell you how to do this in command line, but I have my apple keyboard working with bluez-4.55 and blueman.

Maybe you should take a look http://sidux.com/index.php?module=Wikula&tag=hwBluetooth to do this with command line.

----------

## calavicci

Thanks for the suggestion, too7. It complained about the "Connect" method not existing, and I'm investigating that.

I cracked and tried bluez-gnome... and it doesn't even see the keyboard (which hcitool easily does). I'm going to go ahead and say it: bluez is fracking pathetic. I'm not denying that the problem is probably the result of my ignorance, but nobody else seems to know how to do this very simple task, either. A package needs to have serious issues to have this many problems, this much confusion, and this little documentation.

Blueman is still ~amd64, and I think I see why; I can't get it to do anything if I install it.

On a side note, I realized that bluez4 requires dbus. I'm more than a little miffed at that, too... until now, I had managed to keep from installing it.

----------

## dmpogo

 *calavicci wrote:*   

> Thanks for the suggestion, too7. It complained about the "Connect" method not existing, and I'm investigating that.
> 
> I cracked and tried bluez-gnome... and it doesn't even see the keyboard (which hcitool easily does). I'm going to go ahead and say it: bluez is fracking pathetic. I'm not denying that the problem is probably the result of my ignorance, but nobody else seems to know how to do this very simple task, either. A package needs to have serious issues to have this many problems, this much confusion, and this little documentation.
> 
> Blueman is still ~amd64, and I think I see why; I can't get it to do anything if I install it.
> ...

 

yes bluez now requires dbus (you better install d-feet to play with its d-bus interface).  By it iself (close to hardware) bluez seems actually to be pretty good, but totally, totally lacking user interface.

----------

## calavicci

It started working again today. I don't know how or why.

----------

