Setting Up a Bluetooth Connection
Last Modified: 2006-09-21
find:

basket

Acroname Robotics PDF webpage version Setting Up a Bluetooth Connection PDF

Related
Products

Product image for Garcia Robot
Garcia Robot
Product image for Element BAM Create Bluetooth
Element BAM Create Bluetooth
Product image for Blue Tooth Dongle
Blue Tooth Dongle

Contents

Overview

The purpose of this tutorial is to outline the steps testd by Acroname to configure a Garcia Bluetooth connection.  This tutorial assumes you have a Bluetooth enabled computer and all appropriate drivers are installed and working.  Make sure that your Garcia Bluetooth adapter is set to "Discoverable".  Garcias shipped from Acroname are set up in Discoverable mode and detailed, step by step instructions that can be viewed in the Bluetooth Configuration Tutorial

Once a Bluetooth device is configured and registered on a host computer, software can then establish a link to the Bluetooth device.  Software provided by Acroname utilizes configuration files to specifiy communication specifics for a link. 

Following sections of this tutorial will detail the steps taken to create a Bluetooth serial connection to a Garcia robot on various operating systems.  Although these steps have been tested and verified by Acroname, your particular system may vary slightly.  Additional information, details, and discrepancies should be submitted to info@acroname.com

Windows XP Bluetooth Device Setup

Windows XP comes with a Bluetooth configuration utility that you can use to help define a new device that we can connect to.  We will use this utility to set up a virtual serial port that we can use to communicate with the Bluetooth enabled Garcia. 

This configuration utility can be found under the Windows Control Panel, then launch the Bluetooth Devices application. 

Click the "Add" button to begin configuring the virtual serial link as shown in the following image. 

Click on the Add device button in the Bluetooth Setup Wizard
Click on the Add button under the Devices menu.

Make sure your Bluetooth enabled Garcia is turned on and set to discoverable mode.  The Wizard helps verify this question by requiring you to check a box indicating the Bluetooth device is ready.  Now, let the Wizard search and discover any Bluetooth devices that are in Discoverable mode. 

Image of wizard asking to look for any bluetooth devices.
Check the box to search for any discoverable devices.

If the Garcia is properly configured and powered up, the Garcia should be found by the Wizard. 

The Bluetooth Wizard finds the Garcia.
Garcia is found during the Bluetooth device search.

Select the Garcia device and click the Next button.  This begins the process of setting up the necessary information to define what needs to happen to pair a host Bluetooth device with the Garcia. 

Enter the default passkey to connect to the Garcia Bluetooth adapter.
Enter the Bluetooth device passkey information to establish pairing.

The default passkey value for the Garcia Bluetooth adapter is "1234".  You can change this value if necessary for security purposes.  This process is outlined in the Bluetooth Configuration Tutorial

The Wizard will define COM ports on your machine for using the Bluetooth wireless connection.  In this example, the Wizard defined COM6 as a "Generic Serial Port" as shown below. 

Image of wizard informing what COM ports the Bluetooth connection is established on.
The Wizard defines what COM port the Bluetooth connection will take place at.

Now a virtual serial port is defined for Windows to use. 

Mac OS X Bluetooth Setup

The following steps outlines the process to define a Bluetooth device on a Apple computer. 

Image of setup utility for adding bluetooth device.
Click the button to Set Up a New Device.

Click through the dialog message to continue to set up the Garcia Bluetooth device.  We are configuring a Bluetooth serial device so select the Any Device option and click Continue. 

Image of selecting what type of device we are searching for.
Select the option to look for Any Device.

Make sure the Garcia robot is turned on and the Bluetooth adapter is properly configured.  If the Garcia is running, then it should show up in the found device list. 

Garcia is found by the setup utility.
Discoverable devices found by the Bluetooth Setup Utility.

Before progressing to the next screen, check the Passkey Options.  This is where you need to enter the current passkey value.  For a default Garcia with the Bluetooth adapter, the default passkey is "1234". 

Select Use a Specific Passkey Option.
The passkey options for the Bluetooth device.

Continue through the Setup Utility and fill in the Passkey when requested.  A status line should indicate the progress of the device pairing and then indicate that there are no supported services for this device.  This is fine, since it is less common to establish a serial connection.  Click Continue once again and Quit the Setup Utility. 

The last few steps are the details that we are most concerned with for using the Acroname software utilitys and example code.  Select the Devices tab and review the information about the Garcia device we just configured.  Be sure that the Paired indication says Yes.  It should look similar to the one shown in the figure below:

Check the information about the Garcia Bluetooth device.
Review the Garcia Bluetooth information.

Check and review the device information that the Bluetooth Setup Utility has defined.  The device name that gets registered to the computer can be changed here if you so desire. 

Device settings for the Garcia Bluetooth connection.
Serial device settings for the Bluetooth device.

Check to make sure the Bluetooth device that was just created shows up in the system.  You can double check this by opening a Terminal (/Applications/Utilites/Terminal.app) and listing what ports are available.  If the virtual serial port is configured correctly, then it will show up in the list as shown below. 

user$ ls /dev/tty.* /dev/tty.Bluetooth-Modem /dev/tty.Garcia-GenericSerial-1 /dev/tty.Bluetooth-PDA-Sync /dev/tty.modem

Changing Software Configuration Files

After a serial port has been defined you will need to edit the appropriate configuration file for the software that you are running.  For example, if a Bluetooth serial port is configured on a Windows XP system as COM6 like the steps above in this tutorial, then the following information would be included into the garcia.config file:

# garcia.config # Configuration file for the Garcia using Bluetooth serial # baudrate - This determines the speed the application will operate at over # the serial connection. Note, that on power up, the # laser defaults to 9600 so this application first starts # with 9600 and the changes the baudrate to the setting # here. Options are 2400, 9600, 19200, 57600, and 115200 # The Garcia default (and setting here) is 38400. baudrate = 38400 # portname - This determines the computer's port name that will be used # to communicate with the Garcia. This port name is defined # earlier in this tutorial. portname = COM6
Note

It is noticed that after an application has disconnected from the Garcia, it takes a significant amount of time for the connection status to drop.  It has been observed to take around 20 seconds.  Make sure the connection is dropped before trying to reconnect. 

Revision History:

  • 2006-11-02: Tutorial Created

Garcia
Resources

 

Related Links:

Configuring a Bluetooth to Serial Adapter

voice: 720-564-0373, email: sales@acroname.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado. All rights reserved.