learningbydeveloping.com

 

Learning by developing

...because practice teaches you

Along this article I will explain which modules we have to install and how to test that the Bluetooth dongle is actually running. This run for me with 3 different Bluetooth dongles and it is probably a generic method so I expect it to be useful for most of you.

 

1st. Let’s install the necessary libraries for being able to use the Bluetooth modules:

 

Online installation(opkg should install all its dependencies):

$ opkg update

$ opkg install kmod-bluetooth

 

Offline installation:

root@OpenWrt:~# opkg install kmod-input-evdev_2.6.39.4-1_ar71xx.ipk  kmod-hid_2.6.39.4-1_ar71xx.ipk kmod-rfkill_2.6.39.4-1_ar71xx.ipk  kmod-bluetooth_2.6.39.4-1_ar71xx.ipk

Installing kmod-input-evdev (2.6.39.4-1) to root…

Installing kmod-hid (2.6.39.4-1) to root…

Installing kmod-rfkill (2.6.39.4-1) to root…

Installing kmod-bluetooth (2.6.39.4-1) to root…

Configuring kmod-input-evdev.

Configuring kmod-hid.

Configuring kmod-rfkill.

Configuring kmod-bluetooth.

 

Then the device should be already detected(you can check with “$ dmesg”). Then and just for testing purposes we can install the bluez utilities:

 

Installation of libraries:

$opkg install bluez-libs bluez-utils

 

So now we can check that the Bluetooth is running, we first insert the module for Bluetooth with “insmod kmod-bluetooth” and then check that the hardware has been detected with “hciconfig” then try to make a Bluetooth inquiry with “hcitool inq”:

 

root@OpenWrt:~/usbboot# insmod kmod-bluetooth

root@OpenWrt:~/usbboot# hciconfig

hci0:    Type: USB

BD Address: XX:XX:XX:XX:XX:XX ACL MTU: XXX:X SCO MTU: XX:X

DOWN

RX bytes:XXX acl:X sco:X events:XX errors:X

TX bytes:XX acl:X sco:X commands:XX errors:X

root@OpenWrt:~/usbboot# hcitool inq

Inquiring …

Inquiry failed.: No such device

 

It failed, but do not worry it was just a small mistake. I did not put the interface up. In order to do so we have to execute “hciconfig hci0 up”, if no message is shown it was successful. After that we will just try the inquiry again “hcitool inq”:

 

root@OpenWrt:~/usbboot# hciconfig hci0 up

root@OpenWrt:~/usbboot# hcitool inq

Inquiring …

MAC…           clock offset: 0xXXXX           class: 0xXXXXXX

(Believe me, there were MAC addresses and stuff around here)

 

And this was everything about the Bluetooth J. I hope it was useful!

 

I wish you the best!

 

David.


2 Responses so far.


  1. MK says:

    Where to get the IPKs that you installed offline? And how to find openwrt drivers for atheros and broadcom dongles?

    Thanks :)

Leave a Reply