How to connect to the robots via bluetooth and upload a file

From IridiaWiki
Revision as of 13:16, 12 March 2010 by Manubrambi (talk | contribs)
Jump to navigationJump to search

Download the files from the SVN repository (Get all the files you need) then follow this instructions

Bluetooth Configuration

  • bluetooth/rfcomm.conf has to be copied in /etc/bluetooth
  • bluetooth/passwords/ has to be copied in /etc/bluetooth
  • bluetooth/90-local.rules has to be copied in /etc/udev/rules.d/

now you have to restart the services

sudo /etc/init.d/bluetooth stop
sudo /etc/init.d/udev restart (or sudo restart udev)
sudo /etc/init.d/bluetooth start

check if in /dev/ there are some files called rfcomm**, if not do:

sudo rfcomm bind all

you should now have all the necessary files to connect to the robots.

NOTE: The above files have been created by us and are not complete. This means that if you want to use an e-puck that is not in the list you should add it.

To do that you have to first get the MAC address of the epuck you want to add: turn on the selected e-puck and do:

hcitool scan 

modify rfcomm.conf and 90-local.rules using the existing lines as examples.

As a last step you need to add the password file in the passkeys directory. Go in /etc/bluetooth/passwords/ and do (with the correct epuck number and MAC):

echo -n 1442 > 08:00:17:2D:1A:15

Once you have done this please update the corresponding file in the svn. Eventually we will be able to have the complete list for all the e-pucks (or, at least, the most used ones)

Upload the .hex file

Once you are able to connect to the robot you have to upload the file to the Epuck.

In epuck-uploader/ there is a script to upload a file to the E-puck. To do it just write:

./epuckupload -f filename **

where filename is the name of the file to upload (e.g. epuckaseba.hex) and ** is the number of the robot to update (e.g. 42)

When a series of dots are printed on the screen press the reset button of the e-puck and the upload should begin (a series of * are printed)

Example of a successful upload

./epuckupload -f epuckaseba.hex 42
[18:32:43] Reading file epuckaseba.hex                                                                      
[18:32:43] [/dev/rfcomm42] Connecting to /dev/rfcomm42 (robot ID 42)                                        
[18:32:45] [/dev/rfcomm42] Uploading epuckaseba.hex                                                         

NOTE:it seems that the passkeys file are not so useful after all because if you connect to a new robot (one that your pc has never met) a dialog will pop up and ask for the password. In that case just write the four digits of the e-puck and it should work. If you don't have a bluetooth manager on your system (or it's not running) you won't be able to connect to new robots. Under KDE systems you have to start kbluetooth otherwise it does not work.