What do you like in the e-puck robot?
Written by Administrator   
Wednesday, 24 November 2010 13:16

Bluetooth and e-puck

The dsPIC, e-puck's microcontroller, has two uarts. The first one is connected to a bluetooth chip and the second one is physically available through a micromatch connector. The bluetooth chip, LMX9820A, can be used to access to the uart "transparently" using a bluetooth rfcomm channel. Using this mode, one can access the e-puck as it was connected to a serial port, with the exception that the LMX9820A will send special commands upon connection/disconnection. The user application must take them into account.

How to communicate with the e-puck

This section is only about communicating with an e-puck running a user program, not using the bluetooth bootloader.

Setting up a fake serial connection using bluetooth rfcomm under Linux

In order to setup a fake serial connection using bluetooth rfcomm with your e-puck under Linux, you will need the following:

  • A USB bluetooth dongle
  • a recent 2.4 or 2.6 kernel
  • the following packages: bluez-firmware bluez-pin bluez-utils

The lsusb, hciconfig, hcitool and rfcomm commands are very useful to test the presence of a USB bluetooth dongle connected to your Linux box and to setup the connection with the e-puck:

# lsusb
# hciconfig
# hcitool scan
# l2ping
# rfcomm release rfcomm0
# rfcomm bind rfcomm0
# rfcomm connect rfcomm0

You will also need to edit your /etc/bluetooth/rfcomm.conf config file to add entries corresponding to your e-puck robots:

rfcomm0 {
bind yes;
device 08:00:17:2C:E0:88;
channel 1;
comment "e-puck_0006";

And possibly restart the bluetooth service:

# service bluetooth restart

A PIN number will asked to you (by bluez-pin) when trying to establish the connection. This PIN number if a 4 digits number corresponing to the name (or ID) of your e-puck. I.e, if you e-puck is called "e-puck_0006", then, this number is 0006.

If you are not asked for a PIN number and you get a message like: "Can't connect RFCOMM socket: Connection refused", it may be because the PIN number is given automatically by the PC to the e-puck without prompting you. In this case, you should edit your /etc/bluetooth/hcid.conf and change the "security" parameter from "auto" to "user". Then, you may need to restart bluez-util:

# /etc/init.d/bluez-utils restart
Last Updated on Monday, 10 February 2014 16:34
e-puck education robot, Powered by Joomla!