Page 101 - Hacking Roomba
P. 101
82 Part I — Interfacing
Configuring the Bluetooth Adapter
Now that the BlueSMiRF in your Roomba Bluetooth adapter is paired up and a virtual serial
port is created, the virtual serial port acts just like a normal serial port. You can connect to it
like any other serial port on your computer. Unlike a normal serial port, the speed at which you
connect to it has nothing to do with the speed at which it sends data over the physical wires
connected to the Roomba. For that you need to configure the BlueSMiRF to the speed
Roomba expects.
As in Chapter 3, open your serial terminal program (for example, ZTerm or RealTerm).
Make sure you connect to the virtual serial port that represents the BlueSMiRF module.
When connected, type +++ and press Return (that’s three plusses and one Return). The
BlueSMiRF should respond with OK. Then type the magic incantation ATSW20,236,0,0,1
and press Return again. The BlueSMiRF should respond with OK again. Type ATMD and
press Return, and if you’ve set up the adapter in a loopback test mode (as in Chapter 3), you
can type characters and see them echoed back to you. (See the following section for more
information on echo tests with BlueSMiRF.) Figure 4-16 shows the results when using
ZTerm.
That magic incantation changes the baud rate of the BlueSMiRF to 57,600 bps 8N1, which is
what Roomba expects.
FIGURE 4-16: Changing BlueSMiRF baud rate to Roomba-compatible 57,600 8N1