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
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