Bluetooth Howto
Starting from Familiar Linux 0.8.0 all necessary bluetooth modules and console tools are in the default image
Configuration
The configuration files are stored in /etc/bluetooth and the startup-parameters for hciattach are in /etc/sysconfig/bluetooth
Quick Test
To quickly test that BT is working, use something like the following:
$ hciattach /dev/ttyS1 any
$ hciconfig hci0 up
$ hciconfig hci0
hci0: Type: UART
BD Address: 08:00:28:xx:xx:x ACL MTU: 339:8 SCO MTU: 0:0
UP RUNNING
RX bytes:87 acl:0 sco:0 events:8 errors:0
TX bytes:38 acl:0 sco:0 commands:8 errors:0
$ hcitool scan
Scanning ...
00:15:xx:6D:xx:xx S0
00:01:xx:xx:C9:xx S55
Networking
Now you can configure networking over bluetooth to your linux box. To do that you can follow what is described here: http://bluez.sourceforge.net/contrib/HOWTO-PAN
Bluetooth Networking Mandrake 10.1
There is nothing new in this mini-HOW-TO, just some hints put all together.Is intended for people who wants connect an iPAQ to a Linux Host via USB Bluetooth dongle.
First of all... PLEASE READ FamiliarReleaseNotes! http://www.handhelds.org/moin/moin.cgi/FamiliarReleaseNotes
Software installed
iPAQ (h3870): Familiar 0.8 (GPE)
-
bluez-dbus-utils updated (2.13 from unstable feed)
Linux Host: Mandrake 10.1 (Kde)
If you are not using mandrake 10.1 you need at least kernel 2.4.21, with integrated bluetooth, also with mandrake you need to install some packages to get bluetooth working. (more info www.bluez.org)
Linux Host side:
Some changes are necessary in linux host /etc/bluetooth/hcid.conf
lm accept, master; #(instead of only lm accept;) security none; #(just testing! then put again auto or user!) #encrypt enable #(just testing! uncomment when you get it working)
restart bluetooth or reboot
check if bluetooth dongle is up
# hciconfig
hci0: Type: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:12 acl:0 sco:0 events:0 errors:0
TX bytes:6 acl:0 sco:0 commands:0 errors
if you get this or nothing from hciconfig command USB bluetooth is not working, then
hciconfig hci0 up
now hciconfig would have to show something like this
hci0: Type: UART
BD Address: 00:22:4F:0C:F0:8A ACL MTU: 128:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:511852 acl:2012 sco:0 events:1110 errors:0
TX bytes:123870 acl:1094 sco:0 commands:48 errors:0
now load bnep.o module
modprobe bnep
define roles in the bluetooth net
pand --listen --role GN
(read this for more info http://bluez.sourceforge.net/contrib/HOWTO-PAN)
now host is listening incoming petitions, and will work as master if needed
iPAQ side: The same changes in /etc/bluetooth/hcid.conf file except lm accept; , restart bluetooth or reboot
To activate bluetooth you can use bluetooth manager ( enable bluetooth or turn radio on) or from a terminal type
hciattach -p /dev/ttySB0 bcsp 230400 #(bluetooth LED starts flashing)
Check out if bluetooth is working like above, then
modprobe bnep pand --connect 00:22:4F:0C:F0:8A #(address of linux host, you can get it also with #hcitool scan)
Now iPAQ and PC are connected, check /var/log/messages if there are any problems
When connected, bnep0 is created in both sides, now you have to configure it like a net.
(You can choose other valid lan ips)
iPAQ#
ifconfig bnep0 10.0.0.2
PC#
ifconfig bnep0 10.0.0.1
Now it should be possible that the nodes ping each other.
PC#
iptables -t nat -I POSTROUTING -j MASQUERADE -s 10.0.0.2 iptables -I FORWARD -s 10.0.0.2 -j ACCEPT iptables -I FORWARD -d 10.0.0.2 -j ACCEPT
iPAQ#
route add default gw 10.0.0.1
On the iPaq edit /etc/resolv.conf and add some name servers to DNS translation.
On the host, allow ip forwarding
PC#
echo "1" > /proc/sys/net/ipv4/ip_forward
or in /etc/sysctl
net.ipv4.ip_forward = 1
This will affect when booting up. It will not change the running
-
system. To change the running system, use:
sysctl net.ipv4.ip_forward=1
If nothing went wrong, iPAQ is connected to the LAN and internet...
Any suggestion or correction is welcome!
Linux host Debian - Sarge
It was pretty simple to setup debian.
On the debian side, edit /etc/default/bluez-utils and change the following lines:
PAND_ENABLED=1 PAND_OPTIONS="--listen --role NAP"
Then restart bluez-utils /etc/init.d/bluez-utils restart This turns on the PAN networking and set's the PC side as the Network Access point.
Then edit the file /etc/bluetooth/pin and put in your pin number.
Then add the following to the end of /etc/network/interfaces on both the ipaq and the debian box, changing the address line so that XXX is replaced with either 1 or 2 for each setup.
iface bnep0 inet static
address 192.168.11.XXX
netmask 255.255.255.0
This creates a network interface for the device.
Then on the ipaq using gpe-bluetooth scan for devices enter the pin when requested and then select PAN from the list of services on the icon of your PC.
Hotplug should then take care of starting the interfaces.