Handhelds.org - Open source for handheld devices

UserPreferences

BluetoothHowto


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)

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

restart bluetooth or reboot

check if bluetooth dongle is up

if you get this or nothing from hciconfig command USB bluetooth is not working, then

now hciconfig would have to show something like this

now load bnep.o module

define roles in the bluetooth net

(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

Check out if bluetooth is working like above, then

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#

PC#

Now it should be possible that the nodes ping each other.

PC#

iPAQ#

On the iPaq edit /etc/resolv.conf and add some name servers to DNS translation.

On the host, allow ip forwarding

PC#

or in /etc/sysctl

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.