Simple problem. I have a bluetooth keyboard, I want to use it at work (Thinkpad T61) and home (eeePC 1001P), both machines running Debian (hardware and OS details). I want to find a good way to get this keyboard connected and running full time. Here goes.
Bluetooth Doesn't Seem To Be Working At All!
First I install blueman. Start it up, most everything is disabled (greyed out). Ok, why is that?
hmm... maybe hcitool will tell me something different
$ hcitool scan
Device is not available: No such device
ok... I guess that means there is no device available, check the startup via
$ dmesg | grep Blue
lots of Bluetooth entries there.
next check the bluetooth kernel module is loaded
$ lsmod | grep blue
bluetooth 41795 6 sco,bnep,rfcomm,l2cap
rfkill 13012 4 bluetooth,cfg80211
Looks like the module is loaded. Time to Google my error message
http://forum.soft32.com/linux/Bluetooth-ftopict440233.html
Provides a hint that I need to install the userspace package, in Debian this means
$ sudo aptitude install bluetooth
that installed a bunch of packages. Trying my tests again
$ hcitool scan
(same result)
Blueman (same result)
$ /etc/init.d/bluetooth restart
(maybe it'll help... nope)
Hmmm.. sort of feels like the bluetooth adaptor is turned off. The 1001P doesn't really have a hardware switch that I can see for turning bluetooth on.
Further Googling is talking making me feel like I should really have an entry in the output of lsusb that says something pretty clear about bluetooth, and I'm not seeing that. This really makes me think it isn't on.
I know I shouldn't have to... but I''ll try a reboot to get a fresh dmesg to look at and this laptop has been in and out of suspend a lot, I see that has fouled others up in that past. Nope that didn't help.
eeePC Gotcha: Bluetooth is Controlled in the BIOS
Okay, Got a tip from a site that bluetooth on the 1001P can only be controlled via the bios (are you serious!?!) So I boot into the bios and sure enough under Advanced -> Onboard Settings (I think) there is Onboard Bluetooth and it is disabled. Enable that, save and exit. Reboot.
$ lsusb
now has an extra line in it... promising.
Bus 005 Device 002: ID 0b05:1788 ASUSTek Computer, Inc.
Bluetooth is Working, Now for the Keyboard
Straight for the throat, starting blueman, YES we have an adapater. Double checking with hcitool.
$ hcitool scan
Scanning....
alright!!
Now just to get the keyboard working. Put the keyboard into discovery mode.
Into Blueman, and searching for the device. It shows up! Good sign. Attempt to pair with the device. My secret code is requested. I enter it. "1111" (the usual) and I go to the keyboard type "1111" Enter. Looks like we're paired. Uh oh it looks like it disconnected. Hmm... reconnect, which works, and then click on the trust icon. Still connected good, good. Start typing, it's working!! (I'm sure this could all be done from the command line with hcitool as well, I'm not exactly sure how.)
Awesome.
Testing, The Use Cases
Now the two remaining tests. At work I'm doing some frustrating hack using
hidd --connect MAC ADDRES GOES HERE
and if I leave the computer for 10-20 minutes the keyboard dies. It totally sucks. Secondarily, if I restart the computer the keyboard isn't connected. Both of these things didn't weren't a problem in the past, but they are now. So let's see if the problem is the same here.
- Coming back the next morning and it is still working!!
- Suspending and restoring and it is still working.
- And it even works (with a minor delay after a reboot) in the gdm screen.
Hurray!! Complete Success.
Bonus: killing the Blueman applet doesn't kill the connection, I suspected this would be true but just wanted to confirm.
Bluetooth Files
I previously had attempted to edit a bunch of files in the /etc/bluetooth/ and /etc/default/bluetooth, but none of those files appear changed in this case and the keyboard is working fine. Being curious I snooped around and found that the specific device information related to the connection with my keyboard can be found in /var/lib/bluetooth/ but looking at a few of the files. I can see that they are definitely not meant to be editted by hand. AKA leave it to the tools in this case blueman. I'm sure hcitool also refers to and edits these files although I have not confirmed that.
Hardware and Operating System Details
- Keyboard : Microsoft Wireless Entertainment Keyboard 7000
- Debian squeeze (pre stable release)
- Linux Kernel Linux 2.6.32-3-amd64
- And of course my eeePc 1001P
Now to see if I can get it working on my work computer! Thinkpad T61.