1

On my Arduino Yun (openwrt-yun, updated to latest version), I have a bluetooth dongle in the usb port; I have installed bluez-libs and bluez-utils (and python-bluez). They show up as version 5.13. hciconfig and hcitool work properly. There does not seem to be any utility installed to pair with a device, nor can I figure out how to get pairing to work by editing config files.

I can find the device with hciconfig and hcitool, but rfcomm can't connect without the pin. If I try the same sequence on my Linux laptop after pairing with the gui, rfcomm is able to connect, so I know the device is working properly (JY-MCU HC-06 on another Arduino).

All the recommendations I can find on the web indicate I should be able to use simple-agent or bluez-simple-agent, but they are not installed with these packages (there is no bluez-tools package for this distro). If I manually copy the python script for the agent to the device and run it, it fails, saying that org.bluez can't be found with dbus. There is no bluetoothd running, and no init script for any bluetooth demon. None of the bt* tools are available.

I also found a description of how to set a pin code in /var/lib/bluetooth/[bt-addr]/pincodes (where bt-addr is my dongle address) containing a line of the form:

[device-addr] [pincode]

but this seems to have no effect.

I have also tried settings in /etc/bluetooth/main.conf and /etc/bluetooth/rfcomm.conf, but I think they may only be for incoming connections.

Any help would be greatly appreciated.

asked Nov 2, 2014 at 1:04

2 Answers 2

1

It takes me some time to make it work :

1) update drivers

opkg update 
opkg install kmod-bluetooth bluez-libs bluez-utils

2) add configuration files in directory /etc/bluetooth

root@Arduino:~# cat /etc/bluetooth/hcid.conf
options {
 autoinit yes;
 security auto;
 pairing multi;
 passkey "0000";
 }
device {
 name "OpenWrt";
 class 0x000100;
 lm accept,master;
 lp rswitch,hold,sniff,park;
 }
root@Arduino:~# cat /etc/bluetooth/rfcomm.conf 
rfcomm0{
 bind yes;
 device 00:1B:C1:02:B0:F5;
 channel 1;
 comment "Holux M-1000";
 }

3) Reboot the card

4) test if all is OK

hciconfig

5) put the interface up

hciconfig hci0 up

6) Search for devices

hcitool scan

7) Look for Serial Port capability on the devices

sdptool search SP

8) bind the serial dev

rfcomm -i hci0 connect /dev/rfcomm0 00:1B:C1:02:B0:F5

9) see the information comming from the device (bluetooth GPS in my case)

cat /dev/rfcomm0
Nick Gammon
38.9k13 gold badges69 silver badges125 bronze badges
answered Oct 10, 2015 at 7:21
-1

Bluetooth support on OpenWRT is broken, simply does not work.

answered Mar 10, 2015 at 21:30
1
  • 3
    Welcome to Arduino SE! Can you please add more information to your post to explain why it doesn't work on the Yun? Is there an alternative? Thanks! Commented Mar 10, 2015 at 22:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.