Robot App Store Developer Program

robots-app-store-developer-program

Knowledge Base

How to send commands to Roomba

  By Anna Sandler

Let's play a bit with the commands by sending them directly to Roomba’s serial port.
We will demonstrate connection using a simple freeware RealTerm Serial Capture Program,
available from: http://realterm.sourceforge.net/
(This is a Windows-based terminal software. However, every terminal software can do the work).
Please refer to this chapter if you are a new RealTerm user, before you continue reading this post;

Assuming you know how to configure your connection with Roomba,
keep reading to learn some simple examples how to send commands using the terminal.

Let's send commands to Roomba!

Connect the Bluetooth device/cable into your Roomba and then turn on your Roomba.
Make sure it is fully charged, but not connected to the charger or to the docking station, and we are ready to send some commands:

The "beep" example

In this example we will send Roomba commands that will cause the robot to “beep”.
Type the following commands:
  • 128 132 (Press the “Send Numbers” button)
  • 140 0 1 62 32 (Press the “Send Numbers” button)
  • 141 0 (Press the “Send Numbers” button)
Cool, right? :-)

(If you did not hear the “beep” or if Roomba started to clean around, you probably connected with a wrong baud rate.
Please follow the instructions on Baud Rate configuration chapter before you continue).

So, what these commands mean?
  • 128- Start the command stream;
  • 132- Change Roomba into "Full" mode it’s a mode that allows Roomba to get the play command stream;
  • 140- It means that we are about to send MIDI notes;
  • 0- It means that this song number will be 0. You can save up to 16 songs (from 0 to 15 as a song number) for Roomba 4XX, Create and Dirt dog. The rest models can get up to 4 songs (from 0 to 3 as a song number);
  • 1- The next byte array contains only 1 MIDI note. You can save up to 16 notes per song;
  • 62 32- 62 is the "beep" sound and 32 is its half a second duration. These commands of the song are actually saved on the Roomba (until Roomba is power OFF);
  • 141- Play pre saved song;
  • 0- Song number to play;
That was easy, right? Let’s continue to another example: driving! so buckle-up!

The driving example

Let's try another bunch of commands before we get deeper into Roomba programming:
Type the following commands:
  • 128 131 (Press the “Send Numbers” button)
  • 137 0 100 128 0 (Press the “Send Numbers” button)
Roomba is driving!
To stop it – lift it in the air, the cliff sensors will trigger the stop command.

Explanation:
  • 128- Start the command stream;
  • 131- Change Roomba into "Safe" mode. We could have used the 132 command ("Full" mode), but It's just that I don't trust you enough to give you full control at this point :-)
  • 137- Drive Roomba, drive!
  • 0 100 128 0- Direction forward and velocity normal;
So we’ve learned how to control Roomba, and how to send commands to the robot.
It wasn’t that hard, right?

What's next?

Let's talk about Roomba "Modes"

married men cheat wife cheated on me how to cheat husband
will my wife cheat again go meet and cheat
my wife cheated on me now what online why are women unfaithful



Comments