All Boards Bluetooth Dongle

Document created by jesseg Employee on Aug 6, 2012Last modified by Jodi Paul on May 16, 2013
Version 5Show Document
  • View in full screen mode

Connectivity - Using a Bluetooth Dongle

Network Connection


A simple way to set up a network connection using a Bluetooth dongle is using the Personal Area Networking (PAN) profile.


Load the following modules on i.MX platform:

# modprobe ehci-hcd
# modprobe hci_usb
# modprobe bnep

Set hci0 up:

# hciconfig hci0 up

Check if the hci0 is set by typing:

root@freescale ~$ hciconfig
hci0:  Type: USB
        BD Address: 00:1E:58:3F:4D:09 ACL MTU: 384:8 SCO MTU: 64:8
        RX bytes:4813491 acl:53228 sco:0 events:208901 errors:0
        TX bytes:156025160 acl:410140 sco:0 commands:83 errors:0

root@freescale ~$ hciconfig hci0 piscan

Start the Bluetooth service:

root@freescale ~$ /etc/rc.d/init.d/bluetooth start

Start the pand service as Pan User (PANU):

root@freescale ~$ pand -s -r PANU

On Host (PC), load bnep module:

$ modprobe bnep

Start the pand service as Group Ad-hoc Network (GN):

$ sudo pand --connect 00:1E:58:3F:4D:09 --service GN -n

The target address (in this case 00:1E:58:3F:4D:09) can be found using hciconfig command on target


A BNEP0 network should be created on host (PC) and target (i.MX):

Configure BNEP0 IP on PC:

$ sudo ifconfig bnep0

Configure BNEP0 IP on i.MX:

$ ifconfig bnep0

Now the PAN network is set. You can test using ping:

root@freescale ~$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=12.305 ms
64 bytes from icmp_seq=1 ttl=64 time=27.782 ms
64 bytes from icmp_seq=2 ttl=64 time=16.701 ms
64 bytes from icmp_seq=3 ttl=64 time=36.732 ms ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 12.305/23.380/36.732/9.551 ms