Sep 122006
 

Ever since Bluetooth adapters for Roombas appeared, I’ve wanted to control my Roomba with a cell phone. All my recent phones have had Bluetooth. But getting a devkit for a phone was expensive and phone-specific. Trying to develop J2ME (aka “JavaME”) applications for cell phones has been a mess, especially for non-Windows users. Thankfully, Mobile Processing wraps up the ugly details, like Processing does for normal Java. It makes writing little programs for your phone pretty easy, and makes whipping up a program to control a Roomba possible.

So here’s “RoombaCtrl”, a small Java program for your Bluetooth- and J2ME-compatible phone that works with the build-your-own Bluetooth adapter shown in the book “Hacking Roomba” or the pre-built RooTooth.

RoombaCtrl Demo

Now you can drive your Roomba with your cellphone like so:

Download

You can download RoombaCtrl compiled, ready to install:
roombactrl-1.0.jar
roombactrl-1.0.jad
The “jad” file is if you’re doing “over-the-air” (OTA) installation. Don’t worry about that though. Just grab the jar file and copy it over with Bluetooth file transfer.

You can also download the Mobile Processing source:
roombactrl-1.0-src.zip
Unzip that into your MobileProcessing sketch folder, open Mobile Processing, and choose RoombaCtrl from the available Sketches. Or if you want to see the entire source code right now:
roombactrl.pde

You’ll also need a slightly patched Mobile Processing Bluetooth library:
mobileprocessing-bluetooth-patched.zip
In the “libraries” directory of the Mobile Processing application, move the existing “bluetooth” library directory out of the way and unzip the above zipfile in its place.

Mobile Processing Bluetooth Library Patch

The patch for Mobile’s Bluetooth library is only a few lines long:
Mobile-0005-Bluetooth.patch
All the patch does is allow one to specify short UUIDs when searching for services. The standard Bluetooth Serial Port Profile (SPP) has a short UUID of 0x1101. All the Roomba Bluetooth adapters appear as normal serial ports using SPP.

This patch allows you to search for Bluetooth serial ports (instead of other Mobile Processing apps) by doing:

Bluetooth bt = new Bluetooth(this, Bluetooth.UUID_SERIALPORT);

Conceivably, you could add additional static defines for the other pre-defined Bluetooth UUIDs.

RoombaCtrl Buildling and Installation

Installing a program on a cell phone can be mysterious; some cell providers even prohibit you from downloading programs. If you have Bluetooth on your phone, installation becomes a simple file transfer.

Building MIDlets (Java applets for cell phones) can also be a little puzzling. Mobile Processing makes it easier, but it still assumes a little too much knowledge. Mobile Processing is still pretty new so perhaps as it ages it’ll get easier. Of course, it doesn’t help that Sun doesn’t make a cross-platform toolkit for developing MIDlets.

Below is a small movie showing how, if everything is configured correctly, building and installing a new Mobile Processing program on your phone can be pretty quick. It uses Mac OS X, but the techniques are the same for any OS.

Useful Links

I had a real time trying to figure out why Mobile Processing wouldn’t let me talk to Bluetooth Serial Devices. I ended up learning how to write Java MIDlets by hand. Here’s some of the links I got knowledge from:

 Posted by at 11:21 pm

  41 Responses to “RoombaCtrl: Drive your Roomba with your cell phone”

  1. I tried doing this but its not working .. please help :) e mail me if posible .. thank you

  2. […] Here are some links to Roomba projects that will show that the Roomba is not all work and no play. A big list of hacks reside here. Here is a look at the robot’s guts. Here is a guys blog posting about his Roomba hacking that includes this remote controled (via a bluetooth cellphone) roomba. Here is a musical Roomba with video included. Of course, my Roomba hacking will be feature only on the billstron blog. Stay tuned… […]

  3. […] Here’s a fun DIY project for a lazy weekend: a phone-controlled Roomba hack using “RoombaCtrl”, “a small Java program for your Bluetooth- and J2ME-compatible phone.” More information here. Ever since Bluetooth adapters for Roombas appeared, I’ve wanted to control my Roomba with a cell phone. Thankfully, Mobile Processing wraps up the ugly details, like Processing does for normal Java. It makes writing little programs for your phone pretty easy, and makes whipping up a program to control a Roomba possible […]

  4. gugalux, that’s very strange, especially considering that ‘*’ only resets the Roomba and shouldn’t affect the Roomba LEDs at all.

    Have you verified your Roomba Bluetooth adapter works with a computer first?

  5. Thanks for the source code – this indeed opens the doors to infinite roomba hacking!
    However, I’m having a problem with the program. I’ve downloaded roombaCTRl jar file to my Nokia Series 60 phone (6620), but allI can do with it is to turn off all roomba lights when pressing “*”. It wouldn’t respond to any other command. Any ideas how to debug this?

    thanks!

  6. […] Here’s a fun DIY project for a lazy weekend: a phone-controlled Roomba hack using “RoombaCtrl”, “a small Java program for your Bluetooth- and J2ME-compatible phone.” Videos after the jump. More information here. Ever since Bluetooth adapters for Roombas appeared, I’ve wanted to control my Roomba with a cell phone. Thankfully, Mobile Processing wraps up the ugly details, like Processing does for normal Java. It makes writing little programs for your phone pretty easy, and makes whipping up a program to control a Roomba possible […]

  7. todbot, compiling should not be a problem, even with non-standard stuff. Phone emulation also works fine, but I can’t remember whether the emulators that come with Sun’s toolkit do BT and camera.

    Emulating the non-standard stuff is a whole another story tho… (is Wine cheating? :P)

  8. Lumpio, I meant mostly that developing J2ME apps is a mess because of the variability of the J2ME implementations on the phones. This variability is often reflected in the development environments. For instance, on Linux can you compile and simulate J2ME code that uses the Bluetooth or Camera APIs?

  9. “Trying to develop J2ME applications for cell phones has been a mess, especially for non-Windows users.”

    How come? The tools are all in Java and run just fine under Linux, for example. I don’t remember having any trouble with the tools.

  10. […] [Todbot] Permalink | Tell a Friend | Print | Like what you see? Subscribe to ourfeed! […]

  11. […] RoombaCtrl: Drive your Roomba with your cell phone [todbot via Gadgetell] […]

  12. […] He’s pimping his book a bit, but Tod sent in his hack for controlling his bluetooth roomba with a bluetooth phone. He released the bluetooth interface hack Now he’’s whipped up a phone application that lets him fully control the roomba via bluetooth. […]

  13. Great project, I can think of lots of other applications!

  14. Great!! Now I can´t help to buy one!!

  15. but does it serve drinks?

  16. very cool! makes me want to buy a roomba.

    darn some one just said that.

  17. Nice! Makes me want to buy a Roomba just for that! Remote Control! Keep up the good work man!

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)