Print This Page

Roomote iPhone App

I have a Roomba 500 series robot from iRobot and when I found out that you can talk to the Roomba and send it commands using a computer, I wanted to try it out. I was also interested in controlling the Roomba with my iPod touch. It's been done with a Wiimote before, why not with an iPhone?

This page contains instructions on how to use the Roomote iPhone app and contains a link to download for the Roomote Server application (for Mac OS X). Follow the steps below to get everything working.

Due to Apple's rules and such, an iPhone cannot talk directly to a Roomba or Create robot through bluetooth, so you'll need a bluetooth-capable computer to talk between the two devices. (Apple doesn't currently allow direct access to the Bluetooth on the iPhone without a special accessory. See the FAQ for more details.)

To use the Roomote iPhone App, you need the following: 

  1. A Roomba 400 or 500 series robot (or Create)
  2. An iPhone or iPod touch (any version)
  3. A serial cable or Bluetooth adapter to connect your robot to your computer
  4. A Mac computer to run a server program and relay commands from the iPhone to the robot (Sorry Windows folks, I haven't ported the server to Windows. If you'd like to do so, though, I've made the source code available. Scroll to the bottom of this page for more information.)

 

 

 

1. Connect your Roomba to your computer

Follow the helpful instructions here.

2. Download and install the Roomote Server application

  1. Download Roomote Server (OS X Leopard or higher)
    • The server program is based heavily on the code found on hackingroomba.com by Tod E. Kurt (who, by the way, wrote the book Hacking Roomba, which is a lot of fun).
  2. Drag the Roomote Server to your Applications directory (or wherever else you'd like)
  3. Run the RXTX setup command script
    • This program sets up a couple of things that let the included Java RXTX libraries to work
    • This is necessary if you want the Demo and Song features to work
    • This only needs to be done once
    1. Download the script and unzip it
    2. Open a Terminal window
    3. Drag the script into the terminal window
    4. Press "return"
    5. Enter your password (assuming you are using an administrator account)

3. Obtain the Roomote iPhone App

Now available on the App Store! Search for "Roomote" or click here.

4. Start the Roomote Server application

  1. Run the application
  2. Click any check boxes that apply to your situation
  3. Click the "Start Server" button
  4. Select the serial port for your Roomba
  5. Click the "Connect" button
    • You should hear your Roomba beep if the connection was successful
  6. (Optional) Customize the songs for your Roomba to play using the RTTTL Songs window

5. Run the Roomote iPhone App

When you start the app, it should automatically jump to the server selection dialog. Select your Roomote Server from the list to connect the app to your computer.

Quick Tutorial

Here are some of the things you can do with the Roomote app:

Roomote Settings View

  • Step 1: Start the Roomote Server application on your computer.
  • Step 2: Press the "Start Server" button in the Roomote Server application to allow the iPhone app to connect.
  • Step 3: Press the "Connect" button in the Roomote Server application to connect to the Roomba (over a serial cable or Bluetooth).
  • Step 4: Push the server select button (labeled "Server:") and choose the Roomote Server from the list.
  • Step 5: Choose your control type: Button, Swipe, or Tilt.
  • Step 6: (Optional) Press the Demo button and select the demo you want the Roomba to run.
  • Step 7: (Optional) Press the Song button and select the song you want the Roomba to sing.
  • Step 8: Press the "Done" button to flip back to the control view.

Roomote Control View

From the control view you can send commands to your Roomba. The upper control interface changes based on the control type selected on the Settings View. The lower control interface includes a scrolling area with many commands as well as a velocity control slider. Press the "i" button to flip over to the Settings View.

  • Button Mode
    • This control type lets you send commands to the Roomba with a simple button interface
    • Tap a button to send a command to the robot
      • Press the buttons to make the Roomba go forward, backward, turn, or spin. Press the "Stop" button to command the Roomba to stop moving.
  • Swipe Mode
    • This control type lets you control the Roomba with swipe gestures
    • Tap in the center to send a "stop" command
    • Swipe up to make the Roomba go forward and down to make the Roomba go backward
    • Swipe up and to the right to make the Roomba go forward while turning to the right
      • The length of your swipe to the right determines the angle at which the Roomba will turn
      • Swipe further to make a tighter turn
    • Swiping directly right or left will command the Roomba to spin in place.
  • "Tilt" Mode (accelerometer mode)
    • This control type uses the iPhone's accelerometer to control the Roomba
    • Hold the phone level to the ground (face up)  to stop the robot
    • Tilt your iPhone forward to command the Roomba to go forward and backward to command the Roomba to go backward
    • The more you tilt forward or backward, the faster the Roomba will go
    • Similarly, the more you tilt to the right or left, the tighter a turn the Roomba will make
      • Use the velocity slider at the bottom of the screen to set the maximum velocity the Roomba will go in this control mode
    • Press the Stop button in the top left corner to stop sending tilt commands to the Roomba
      • Press the Go button to resume sending commands.
    • Tilt the phone to the left to make it spin left
    • etc.
  • Other commands
    • There are also other commands available to send to the Roomba that make the Roomba beep, turn on/off its lights, turn on/off its vaccuum, etc.
    • These commands are available in the middle of the control view screen
    • NOTE: The standard Roomba commands Clean, Spot Clean, Max Clean, and Dock all break the connection between the Roomote Server and the Roomba
      • To restore the connection, press the red Reconnect button on the Roomote iPhone app or reconnect using the Roomote Server app on your computer
    • You can also program custom commands
      • Press the Edit button next to a custom command button
      • Enter a name for the command
      • Enter the raw SCI/OI command to send to the Roomba
        • This will send the bytes you specify directly to the Roomba. I take no responsibility for any damage you may do to your Roomba!

 

Troubleshooting/F.A.Q.

This section will expand as I receive feedback about the app. Please tell me if you have problems and if you've found solutions to them!

Q: Why can't the Roomote app talk to the Roomba directly? The iPhone has Bluetooth, so why do we have to have the Mac, too?

In order to be able to talk directly from the iPhone to the Roomba over Bluetooth, you would need to be able to set up a serial Bluetooth connection ("Bluetooth Serial Port Profile (SPP)"). This is what the server on the Mac does. It creates a serial port for that Bluetooth connection and I can send and receive data on that serial port.

Apple does not provide a library for accessing the iPhone's Bluetooth module as a serial port. There are two ways to get around this:

  1. You can build a custom Bluetooth module for the Roomba that talks to the Roomba over a serial link and to the iPhone using Apple's ExternalAccessory framework (http://developer.apple.com/programs/mfi/)
    • I didn't want to mess with building custom hardware and the point of my project was to share it with whoever wanted to use it. To distribute the hardware I'd have to get a license from Apple and they'd want a cut of the sales, etc. I decided to go with a method that used the existing Bluetooth modules that Roomba hackers out there already have.
  2. You can use some libraries not from Apple to create a Bluetooth SPP link: http://code.google.com/p/btstack/ and communicate with the Roomba directly.
    • I don't do this because you have to "jailbreak" your iPhone to install these libraries. When you use Apple's Xcode tools (the tools to develop iPhone apps), you agree not to developing any jailbreaking or jailbroken apps. I'm not willing to break that agreement and I haven't bothered to find a way around using Apple's development tools. And signing up as an iPhone developer might preclude me from doing it with other tools anyway - I don't remember if the developer agreement states this explicitly or not.

 

Roomote and Roomote Server Source Code

The Roomote and Roomote Server source code is available under the GNU General Public License.You are free to make modifications and redistribute the software under the terms of the GPL.

The code is available on GitHub: http://github.com/brianpratt/roomote

I especially encourage anyone to make a Windows version of the Roomote Server application. I'm sure that a totally Java version of the Roomote Server could be done that would be cross-platform. I initially created this project just to experiment with coding on the Mac OS X platform and don't have enough time or interest to rewrite the project for other platforms. I would be happy to help someone else's efforts, though. Feel free to contact me at roomote 'at` brianhpratt `dot' net. I will happy link to your Windows/Linux port from this page as well.

Scott Gibson has made a first effort at porting the software to Windows/Linux: http://github.com/scottjgibson/roomote

 


Previous page: AccSim iPhone App
Next page: Resume