Daily Archives: May 26, 2013

Bluetooth mouse on Tiny Core Linux

Here is how I connect my bluetooth mouse on Tiny Core Linux:

1. From “Apps” install “bluez”, “dbus”, “python”, “dbus-python-2.7” and “pygobject-2.7”:

bluez

dbus

python

dbus-python

pygobject

2. Check local bluetooth device:

hcitool dev

hcitooldev

3. Press button to make the mouse discoverable and type:

hcitool scan

hcitoolscan

4. Check if we can create connection to the mouse:

sudo hidd --connect 00:02:76:16:14:5C

5. Now we should get connection to the mouse, but we want to automate the connection. Using “simple-agent” we create a new device for the mouse. PIN Code is 0000.

simple-agent hci0 00:02:76:16:14:5C

simple-agent

6. Make the mouse “Trusted”:

dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/4506/hci0/dev_00_02_76_16_14_5C" org.bluez.Device.SetProperty string:Trusted variant:boolean:true

dbus-send

After step 6, please check to make sure that file “trusts” in the device folder exists and mouse address is written in that file. This is important for the automatic connection.

7. At this point if the mouse has lost connection it should be reconnected automatically (for example turn the mouse off and turn it on again). Next step is to make this connection persistent across boots. Install “squashfs-tools-4.x” if it’s not already installed:

squashfs-tools

8. Create device folder for mybluetooth extension:

mkdir mybluetooth
mkdir mybluetooth/var
mkdir mybluetooth/var/lib
mkdir mybluetooth/var/lib/bluetooth

9. Copy folder 00:15:83:12:3E:23 and its content to mybluetooth folder:

cp -R /var/lib/bluetooth/00\:15\:83\:12\:3E\:23/ mybluetooth/var/lib/bluetooth/.

10. Create “mybluetooth” extension:

mksquashfs mybluetooth mybluetooth.tcz

11. Copy extension to tce folder:

cp mybluetooth.tcz /mnt/sda1/tce/optional/.

12. Edit onboot.lst file:

echo mybluetooth.tcz >> /mnt/sda1/tce/onboot.lst

13. Now bluetooth mouse should automatically connected to Tiny Core Linux at boot time. Happy bluetoothing!