Internal:Bluetooth Serial

From Brown University Robotics

Jump to: navigation, search

To connect to the Create via Bluetooth:

  1. Establish Bluetooth connection to "Element Serial"
  2. Put the following into the rfcomm configuration file, located at /etc/bluetooth/rfcomm.conf:
 rfcomm0 {
         bind yes;
         device 00:0A:3A:2E:CB:D8;
         channel 1;

The device address should reflect the Bluetooth address of the Element Serial device. If you don't know the address, "hcitool scan" should report the addresses of all Bluetooth elements in range.

  1. Run the following:
 mknod --mode=666 /dev/rfcomm0 c 216 0
 rfcomm connect /dev/rfcomm0
  1. Set the port parameter:
 rosparam set /brown/irobot_create_2_1/port /dev/rfcomm0

or, for a launch file:

 <param name="/brown/irobot_create_2_1/port" value="/dev/rfcomm0" />

Using from Mac OS X

We have been successful connecting via Bluetooth on a VirtualBox Ubuntu running on a Mac. To make this work:

  1. Use the Mac native Bluetooth utility to find and connect to the robot.
  2. Then check out the /dev directory, where you'll find something like /dev/tty.ElementSerial-ElementSe.
  3. Go to the VirtualBox console and click on the "Settings" for your Ubuntu machine. (The machine must not be running.)
  4. Select "Ports", then "Serial Ports" and add a "COM1" device. Set it to be a "Host Device" and specify the name to be the device name you found in the /dev directory.

The next time you start the virtual Ubuntu, you should find it connected to the device called /dev/ttyS0 because everyone knows that ttyS0 is connected to COM1, don't they? VirtualBox tells me that it's limited to two serial ports, which implies that you could connect another to /dev/ttyS1, which is COM2, but this is an exercise left to the reader.

This page was last modified on 6 April 2011, at 18:57. This page has been accessed 88 times.