All Boards Bluetooth Dongle

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

All Boards Bluetooth Dongle

All Boards Bluetooth Dongle

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
        UP RUNNING PSCAN ISCAN
        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 192.168.0.11

Configure BNEP0 IP on i.MX:

$ ifconfig bnep0 192.168.0.10

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

root@freescale ~$ ping 192.168.0.11
PING 192.168.0.11 (192.168.0.11): 56 data bytes
64 bytes from 192.168.0.11: icmp_seq=0 ttl=64 time=12.305 ms
64 bytes from 192.168.0.11: icmp_seq=1 ttl=64 time=27.782 ms
64 bytes from 192.168.0.11: icmp_seq=2 ttl=64 time=16.701 ms
64 bytes from 192.168.0.11: icmp_seq=3 ttl=64 time=36.732 ms
192.168.0.11 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

Tags (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-1122023%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAll%20Boards%20Bluetooth%20Dongle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1122023%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CH1%20id%3D%22toc-hId-382391664%22%20id%3D%22toc-hId-1298470869%22%3E%3CSPAN%20class%3D%22mw-headline%22%3EConnectivity%20-%20Using%20a%20Bluetooth%20Dongle%3C%2FSPAN%3E%3C%2FH1%3E%3CH2%20id%3D%22toc-hId-1072953138%22%20id%3D%22toc-hId-1989032343%22%3E%3CSPAN%20class%3D%22mw-headline%22%3E%20Network%20Connection%20%3C%2FSPAN%3E%3C%2FH2%3E%3CP%3E%3C%2FP%3E%3CP%3EA%20simple%20way%20to%20set%20up%20a%20network%20connection%20using%20a%20Bluetooth%20dongle%20is%20using%20the%20%3CSTRONG%3EPersonal%20Area%20Networking%20(PAN)%3C%2FSTRONG%3E%20profile.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ELoad%20the%20following%20modules%20on%20i.MX%20platform%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3E%23%20modprobe%20ehci-hcd%3CBR%20%2F%3E%23%20modprobe%20hci_usb%3CBR%20%2F%3E%23%20modprobe%20bnep%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3ESet%20hci0%20up%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3E%23%20hciconfig%20hci0%20up%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3ECheck%20if%20the%20hci0%20is%20set%20by%20typing%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3Eroot%40freescale%20~%24%20hciconfig%3CBR%20%2F%3Ehci0%3A%26nbsp%3B%20Type%3A%20USB%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20BD%20Address%3A%2000%3A1E%3A58%3A3F%3A4D%3A09%20ACL%20MTU%3A%20384%3A8%20SCO%20MTU%3A%2064%3A8%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20UP%20RUNNING%20PSCAN%20ISCAN%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20RX%20bytes%3A4813491%20acl%3A53228%20sco%3A0%20events%3A208901%20errors%3A0%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TX%20bytes%3A156025160%20acl%3A410140%20sco%3A0%20commands%3A83%20errors%3A0%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CBLOCKQUOTE%3E%0A%3CP%3Eroot%40freescale%20~%24%20hciconfig%20hci0%20piscan%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3EStart%20the%20Bluetooth%20service%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3Eroot%40freescale%20~%24%20%2Fetc%2Frc.d%2Finit.d%2Fbluetooth%20start%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3EStart%20the%20pand%20service%20as%20Pan%20User%20(PANU)%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3Eroot%40freescale%20~%24%20pand%20-s%20-r%20PANU%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3EOn%20Host%20(PC)%2C%20load%20bnep%20module%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3E%24%20modprobe%20bnep%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3EStart%20the%20pand%20service%20as%20Group%20Ad-hoc%20Network%20(GN)%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3E%24%20sudo%20pand%20--connect%2000%3A1E%3A58%3A3F%3A4D%3A09%20--service%20GN%20-n%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CDIV%20style%3D%22background-color%3A%20%23ffdddd%3B%20padding-left%3A%2030px%3B%20width%3A%2060%25%3B%20margin-left%3A%2020%25%3B%22%3EThe%20target%20address%20(in%20this%20case%2000%3A1E%3A58%3A3F%3A4D%3A09)%20can%20be%20found%20using%20hciconfig%20command%20on%20target%3C%2FDIV%3E%3CP%3E%3C%2FP%3E%3CP%3EA%20BNEP0%20network%20should%20be%20created%20on%20host%20(PC)%20and%20target%20(i.MX)%3A%3C%2FP%3E%3CP%3EConfigure%20BNEP0%20IP%20on%20PC%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3E%24%20sudo%20ifconfig%20bnep0%20192.168.0.11%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3EConfigure%20BNEP0%20IP%20on%20i.MX%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3E%24%20ifconfig%20bnep0%20192.168.0.10%3C%2FP%3E%0A%0A%0A%0A%0A%3C%2FBLOCKQUOTE%3E%3CP%3ENow%20the%20PAN%20network%20is%20set.%20You%20can%20test%20using%20ping%3A%3C%2FP%3E%3CBLOCKQUOTE%3E%0A%3CP%3Eroot%40freescale%20~%24%20ping%20192.168.0.11%3CBR%20%2F%3EPING%20192.168.0.11%20(192.168.0.11)%3A%2056%20data%20bytes%3CBR%20%2F%3E64%20bytes%20from%20192.168.0.11%3A%20icmp_seq%3D0%20ttl%3D64%20time%3D12.305%20ms%3CBR%20%2F%3E64%20bytes%20from%20192.168.0.11%3A%20icmp_seq%3D1%20ttl%3D64%20time%3D27.782%20ms%3CBR%20%2F%3E64%20bytes%20from%20192.168.0.11%3A%20icmp_seq%3D2%20ttl%3D64%20time%3D16.701%20ms%3CBR%20%2F%3E64%20bytes%20from%20192.168.0.11%3A%20icmp_seq%3D3%20ttl%3D64%20time%3D36.732%20ms%3CBR%20%2F%3E192.168.0.11%20ping%20statistics%20---%3CBR%20%2F%3E4%20packets%20transmitted%2C%204%20packets%20received%2C%200%25%20packet%20loss%3CBR%20%2F%3Eround-trip%20min%2Favg%2Fmax%2Fstddev%20%3D%2012.305%2F23.380%2F36.732%2F9.551%20ms%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎08-06-2012 03:15 PM
Updated by: