Hardware Reference
In-Depth Information
There is a command mode and a data mode. In data
mode, you send the string $$$ to switch to command
mode.
Networks RN-41 radio, if you're searching their site, and
the Bluetooth Mate Silver uses the RN-42 radio). A few of
the commands are covered here. Each Bluetooth modem
manufacturer has its own set of commands; unfortunately,
they're all different. But they all have the same basic
structure as the one you see here.
The commands are all short strings, and the modem
responds with the response AOK . To exit command mode,
send the string ---\r (the \r is a carriage return, ASCII 13),
and the Bluetooth modem switches back to data mode. In
data mode, any bytes you send the modem are sent out
over the radio, and any bytes received over the radio get
sent out the serial connection.
Currently, the module is in command mode. One of the
first things you'd like is to see its settings. Type D and hit
return or enter . You'll get a list of the radio's settings, which
looks like this:
***Settings***
Controlling the Bluetooth Module
Wire the Bluetooth module to the USB-to-Serial converter,
as shown in Figure 2-20. Since the converter and the cable
have identical pin configurations, you'll need to cross
the TX and RX lines to make them connect. Connect the
converter to a USB port on your computer.
BTA=000666112233
BTName=FireFly-7256
Baudrt(SW4)=115K
Parity=None
Mode=Slav
Authen=0
Encryp=0
PinCod=1234
Bonded=0
Rem=NONE SET
For this project, you'll need a serial terminal program that
can open two serial ports at the same time, so the Arduino
Serial Monitor won't do. One serial port will be the wired
connection to the Bluetooth module through the USB-to-
serial adapter. The other will be the wireless connection
via Bluetooth.
The first setting is the Bluetooth address. That's the part
you need in order to make a connection to it. Manufactur-
ers of Bluetooth devices agree on a standard addressing
scheme so no two devices get the same address. The
settings that follow give you information about the radio's
configuration, such as the serial data rate (or baudrate ),
whether authentication's turned on, and what the
passcode or PIN code is.
For Mac OS X and Windows users, CoolTerm will work well.
For Ubuntu Linux users, GNU screen or PuTTY will do.
Open a connection to the USB-to-Serial adapter at 115200
bits per second.
When you first power the Bluetooth Mate, it will be in data
mode. To switch to command mode, send the string:
You may have noticed that you can't see what you type.
That's because the keystrokes in a serial terminal program
aren't echoed back to the screen—they're sent straight
to the serial port. However, the Bluetooth Mate will echo
your characters back to you if you type +\r . This turns
Echo Mode on or off. It's useful to have on while issuing
commands.
$$$
The module will respond like so:
CMD
You're now in command mode. Any time you want to
check that the module is working and in command mode,
type enter or return , and send it. It will respond with ? .
To see a list of all possible commands, type H and then
enter . There's a list of all the commands available for this
module at www.SparkFun.com or www.rovingnetworks.
com (the Bluetooth Mate Gold module uses the Roving
Now that you know something about your own module,
you want it to give you a list of other Bluetooth-enabled
devices in the area. Type I for inquiry. After several
seconds, it will come back with a list like this:
 
Search WWH ::




Custom Search