Written by Administrator |
Wednesday, 24 November 2010 13:16 |
Bluetooth and e-puckThe 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-puckThis 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 LinuxIn order to setup a fake serial connection using bluetooth rfcomm with your e-puck under Linux, you will need the following:
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 You will also need to edit your /etc/bluetooth/rfcomm.conf config file to add entries corresponding to your e-puck robots: rfcomm0 { 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 |