2011-06-14, 23:34
For long I have been struggling to enable bluetooth in Ubuntu.
Ubuntu started using bluez4 from of version 10.04, and the old methods got broken. Normally on the desktop there are applets to ease pairing etc, but on the command line (CLI) there is not such a method.
This thread Learned me how simple and easy it was all the time, however it is poorly documented.
I tested this with an Eminent USB bluetooth dongle and a Logitech Mediaboard Pro on Ubuntu 10.04 and Ubuntu 11.04 (both minimal edition)
What to do:
Get your bluetooth device MAC or BT ADD or BlueTooth Address: XX:XX:XX:XX:XX:XX
Ubuntu 10.04:
libbluetooth3 will also be installed.
Press the reset or pair button on your keyboard, simple-agent will ask to specify a pin like 1111, then type that pin on the bt keyboard and your bt keyboard is paired.
Now your device should be working
Check
The last messages should be about the paired keyboard (and mouse in my case)
Ubuntu 11.04:
libbluetooth3 will also be installed.
On 11.04 these were installed already, don't know if that came with bluez or not (was not a clean install)
Press the reset or pair button on your keyboard, simple-agent will ask to specify a pin like 1111, then type that pin on the bt keyboard and your bt keyboard is paired.
Now your device should be working
Check
The last messages should be about the paired keyboard (and mouse in my case)
Ubuntu 12.04:
After upgrade to 12.04, the keyboard did not reconnect anymore, so i purged bluez, thereafter I followed below steps:
Press the reset or pair button on your keyboard, simple-agent will ask to specify a pin like 1111, then type that pin on the bt keyboard and your bt keyboard is paired.
If the device is not connected now (thanks blandoon):
After a restart, it should reconnect now.
Some background:
(bluez-)simple-agent is a python script, bluetooth support is in the kernel nowadays. You have to communicate via D-BUS with the bluetooth daemon (bluetoothd). That is the reason why you have to install python-gobject python-dbus as well.
Ubuntu started using bluez4 from of version 10.04, and the old methods got broken. Normally on the desktop there are applets to ease pairing etc, but on the command line (CLI) there is not such a method.
This thread Learned me how simple and easy it was all the time, however it is poorly documented.
I tested this with an Eminent USB bluetooth dongle and a Logitech Mediaboard Pro on Ubuntu 10.04 and Ubuntu 11.04 (both minimal edition)
What to do:
Get your bluetooth device MAC or BT ADD or BlueTooth Address: XX:XX:XX:XX:XX:XX
Ubuntu 10.04:
Code:
#sudo apt-get install bluez
libbluetooth3 will also be installed.
Code:
#sudo apt-get install python-gobject python-dbus
Code:
#cd /usr/share/doc/bluez/examples/
Code:
#sudo ./simple-agent hci0 XX:XX:XX:XX:XX:XX
Press the reset or pair button on your keyboard, simple-agent will ask to specify a pin like 1111, then type that pin on the bt keyboard and your bt keyboard is paired.
Code:
#sudo ./test-device trusted XX:XX:XX:XX:XX:XX yes
Code:
#sudo /etc/init.d/bluetooth restart
Now your device should be working
Check
Code:
#dmesg|tail
The last messages should be about the paired keyboard (and mouse in my case)
Ubuntu 11.04:
Code:
#sudo apt-get install bluez
libbluetooth3 will also be installed.
Code:
#sudo apt-get install python-gobject python-dbus
On 11.04 these were installed already, don't know if that came with bluez or not (was not a clean install)
Code:
#sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX
Press the reset or pair button on your keyboard, simple-agent will ask to specify a pin like 1111, then type that pin on the bt keyboard and your bt keyboard is paired.
Code:
#sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes
Code:
#sudo /etc/init.d/bluetooth restart
Now your device should be working
Check
Code:
#dmesg|tail
The last messages should be about the paired keyboard (and mouse in my case)
Ubuntu 12.04:
After upgrade to 12.04, the keyboard did not reconnect anymore, so i purged bluez, thereafter I followed below steps:
Code:
#sudo apt-get install bluez
Code:
#bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX
Press the reset or pair button on your keyboard, simple-agent will ask to specify a pin like 1111, then type that pin on the bt keyboard and your bt keyboard is paired.
Code:
#bluez-test-device trusted XX:XX:XX:XX:XX:XX yes
If the device is not connected now (thanks blandoon):
Code:
#bluez-test-input connect 00:07:61:FF:3C:6D
After a restart, it should reconnect now.
Some background:
(bluez-)simple-agent is a python script, bluetooth support is in the kernel nowadays. You have to communicate via D-BUS with the bluetooth daemon (bluetoothd). That is the reason why you have to install python-gobject python-dbus as well.