my Pi the same address. At outreach events, we
rarely have Wi-Fi access at all.
I ended up buying an inexpensive Belkin
N150 Wi-Fi router ($10 at Amazon) to dedicate
to the robots. I configured the router to reserve
IP addresses for all my bots, so they always have
known addresses. I carry the router with me to
outreach events and to robotics clubs.
I also pack a few TP-Link N150 USB Wi-Fi
adapters (also $10 each at Amazon) to take to
club events. These let the students connect to
their school Wi-Fi network and to the robotics
Wi-Fi network at the same time. You can never be
connected to too many networks!
There are plenty of free tools that you can
install on your computer to talk to the RaspPi over
the network. The simplest is PUTTY, which allows
you to open a remote command terminal on the
Pi. You can then use Nano or VI on the Pi to edit
code files on the Pi’s file system. When your code is
ready, run it from the PUTTY command line.
WinSCP is another useful free tool. It presents
a graphical file system viewer that lets you drag
and drop files between machines. You edit the files on
your PC, then use WinSCP to copy them to the Pi. You still
need PUTTY to execute the code on the remote Pi, but with
WinSCP, you can edit code on your computer using your
You can also configure WinSCP to watch for changes in
a directory. Whenever you save your files on your computer,
WinSCP automatically copies them to the Pi.
My personal favorite free tool is the Eclipse integrated
development environment (IDE). Its ‘Remote System
Explorer’ lets you move files, edit code, and run code all in
the same tool. Figure 3 shows a sample coding session.
On the left, you can see the Raspberry Pi’s file system in
a graphical tree explorer. Double-click on a file in the tree to
open it in the text editor, which performs syntax highlighting
for whatever code language you’re editing. In the upper
right corner of Figure 3, I’m editing a Python file right on
the remote file system. I then use the command line window
(lower right of Figure 3) to run the updated code.
The robotics students like having all the tools together in
the same window. They can focus on the code in a colorful
editor, without having to keep up with different tools and
how/when to use them.
The OI Serial Protocol
The Open Interface specification document describes 29
different commands you can send to the Roomba or Create.
All commands start with a single-byte opcode followed
by several data bytes depending on the command. The
Drive Wheels command, for instance, is opcode 145 followed
by two words (four bytes): right-motor velocity and left-motor velocity. This command gives you raw control of the
The Drive command is opcode 137 followed by two
words: velocity and turn radius. This command tells the
robot to do the math and set the wheel speeds based on
the velocity and radius you provide.
Some models of the Roomba have seven-segment
displays used for entering a cleaning schedule. The Create2
doesn’t have these displays, but the spec describes how to
control the LEDs if you’re using a Roomba that does.
The Create can store up to four short songs in memory.
The official iRobot Create site with 3D printer files,
project resources, and complete documentation (including
a detailed PDF document describing the serial protocol):
Roomba Open Interface Specification:
The official Raspberry Pi Foundation:
My Github Repo for Code Challenges:
Figure 3. Eclipse lets you move files between a Pi and PC. Develop your
code in the editor, and run programs at the LINUX command line — all
without leaving the graphical IDE.
SERVO 09/10.2018 39