Jump to main content | Jump to Primary Navigation | Jump to Sub Navigation


 

Connecting an Epuck to an Ubuntu 7.10 PC over Bluetooth

Introduction

The e-puck acts as a bluetooth master, and defines a PIN which the PC must use during communication. Because this is an unusual setup (where the device is the master rather than the slave), it appears Ubuntu have failed to accomodate for this in their distribution of BlueZ.

Fixing the problem is relatively straightforward.

Step 1:

Plug in the bluetooth dongle to the PC, and switch on the Epuck. Then use hcitool to discover the Bluetooth address of the Epuck.

hcitool scan

Which should output similar lines to the console:

Scanning ...
        10:00:E8:52:AE:BD       e-puck_1177

This tells BlueZ (via D-BUS) to call /usr/bin/bluez-pin if a PIN request is made. It is not set up automatically with any package. The program will stay running and must run throughout the first pairing, but it is not required on subsequent uses of the Epuck.

Step 2:

Copy create a new file called rfcomm.conf with the content as below and copy it to /etc/bluetooth

#
# RFCOMM configuration file.
#

rfcomm0 {
        # Automatically bind the device at startup
        bind yes;

        # Bluetooth address of the device
        device 10:00:E8:52:AE:BD;

        # RFCOMM channel for the connection
        channel 1;

        # Description of the connection
        comment "e-puck";
}

This file probably isn't necessary, but it allows the machine to automatically create the /dev/rfcomm0 device node. Running "rfcomm" should reveal something like:

alex@rascal:/etc/bluetooth$ rfcomm
rfcomm0: 10:00:E8:52:AE:BD channel 1 closed

"Channel 1 closed" means the bluetooth service (/etc/init.d/bluetooth) must be restarted. This is accomplished with the following

sudo /etc/init.d/bluetooth restart

Then rfcomm should yield the following output

alex@rascal:/etc/bluetooth$ rfcomm
rfcomm0: 10:00:E8:52:AE:BD channel 1 clean

Step 3:

minicom -s

Go to "serial port setup" and ensure that "Serial Device" is /dev/rfcomm0. Also ensure that "Hardware" and "Software Flow Control" are disabled. Then quit minicom using Ctrl-A-Q.

Step 4:

minicom

Ubuntu will then ask for a 4-digit PIN which is written on the chip on the top of the Epuck. Be quick! It fails to store the PIN if minicom times out.

The Epuck is now connected to the Ubuntu PC.