Hacking Roomba

Projects Repository

The book contains over a dozen projects. Below are a list of Roomba hacking projects that were either created before the book and more complex projects that build upon the techniques presented in the book.

Reviews of other hacking tools:

34 Comments so far

  1. David November 17th, 2006 6:02 am

    Hi,

    Todd, interesting research you are conducting on the Roomba. We haven’t purchase your book yet, however, it is on our Holiday wishlist.

    We tried your RoombaView application on our Windows 2000 OS System with Processing -0121 Beta processing wrapper and received the following message:

    “Jikes could not find package “mkv.Mygui” in the code folder or in any libraries”

    It then list a number of JAR files searched with no success.

    Any suggestions?

    Thanks,

    D_

  2. todbot November 17th, 2006 8:52 am

    Hi David,
    I go over this in the book in some detail, but the MyGUI library is an optional free library for Processing that lets you create buttons and other GUI elements. It along with many other neat Processing libraries can be found on the Processing .org/reference/libraries page. The exact version of MyGUI used in the book is located here: MyGUI.zip

    Note that without a Roomba, RoombaView won’t be of much use.

    edit: fixed “with” to “without”.

  3. David November 17th, 2006 12:28 pm

    Todd,

    Thank you for the quick feedback to my question.
    We polled Amazon.com and notice your book is being sold at a very reasonable price.

    However, before we complete purchase, please assist us by answering the following questions:

    Your comment “Note that with a Roomba, RoombaView won’t be of much use.” is very interesting quote, can you explain further?

    What are some of the key reasons why purchasing your book is a great incentive to assist the research in the field Robotics using a Roomba?

    The questions have practical value. We are currently doing research on Robotics using the Roomba Discovery with updated SCI and RS-232 serial tether. Your website provide some very good data in helping to jump start our research on the applicability of using the Java Operating System on the Roomba’s SCI.

    A quick response once again will be appreciated. Amazom.com claim they have only 4 copies left in inventory and we would certainly like to obtain a copy if the book’s contents meet our specifications.

    Thanks,

    D_

  4. todbot November 17th, 2006 2:46 pm

    Oops, that was a typo. I meant “without a Roomba, RoombaView won’t be of much use”. I was still half-asleep when I wrote that. I’ve corrected my comment above.

    The book is aimed at beginners, people who are interested in robotics or electronics hacking. If you are a robotics researcher, you may not get much out of the book beyond what is already presented on this site.

    That said, the book may be useful to instructors in robotics who want an inexpensive way to teach robotics. The Roomba is a great instructional robotics platform. The book describes several key aspects of real world robotics (movement and positioning, sensor handling, real-time behaviors, etc.) using the Roomba as the robotics base.

    And it’s “Tod”, btw, with one “D”. :)

  5. David November 17th, 2006 8:58 pm

    Tod,

    Now it’s my turn to “Oops”. Sorry about the mis-spelling .

    We purchased your book from Amazon.com this afternoon at a very generous 34% discount and look forward to continuing this dialog as we progress through the book.

    We will probably focus on developing a “pure” Java application and interface, then download the application to a Parallax Javelin Stamp micro-controller plus circuit card assembly attached to the Roomba. Not necessarily hardwired, but connected via the Javelin’s RS-232 COM interface or a Bluetooth wireless dongle.

    Thanks again!

    D_

  6. Noel December 11th, 2006 3:24 am

    Hello,

    I’m for sure going to get your book!
    Would love to see how you have done the “cam” part.
    I’ve been running my own roomba webcam (A roomba with a view) for about a yean now on http://www.vacuumcleanerlive.com

    Best regards,

    Noel

  7. Ray Pfaff February 22nd, 2007 3:44 pm

    Okay, I’m trying to follow the book. It mentions going to roombahacking.com and getting the RoombaCommTest directory and downloading the app. Maybe I’m dense, but I can’t find the link to the app.

  8. todbot February 22nd, 2007 3:58 pm

    Hi Ray,
    If you go to the RoombaComm part of the
    code section of the site, you can download the RoombaComm code, which contains the RoombaCommTest Java program.

  9. Paul March 30th, 2007 6:55 am

    I went to the code section of RoombaComm. Is the RoombaComm program for downloading called roombacomm-0.95.zip If so, how do you install it into windowsXP to get a panel similar to that illustrated in the book?

  10. Rich Flowers August 13th, 2007 4:06 am

    Hi

    Trying to use a ASAU WL-500gP router with SpaCat but when I try to run it complains and says …

    can’t load library libgcc_s.so.1

    Hoping you can help me.

    Great book and projects !!

    Thanks,
    Rich

  11. todbot August 13th, 2007 8:37 am

    Hi Rich,
    You need to install the libgcc package (assuming you’re using OpenWrt). If you have OpenWrt configured so it can reach the Internet, you should just be able to log into the router via ssh and type:
    ipkg install libgcc

  12. Rich Flowers August 13th, 2007 7:56 pm

    Tod,

    That fixed it. Did I miss a step somewhere?

    Do you know what web server is in OpenWrt? and if I can run multiple websites?

    Also, I put roombapanel.cgi, roombapanel.css, roombapanel.html plus roombacam.html in the /www folder. However, if I access the URL http:192.168.1.111/roombapanel.html I get a split screen but no commands show up on the right half of screen. Any clue? I have a camera plugged in but I don’t think it is supported. I am guessing that is not a requirement to see the rightside pane. Do I need to load something to see CGI files?

    Thanks again,
    Rich

  13. todbot August 13th, 2007 8:28 pm

    Hi Rich,

    Glad that worked for you. Installing libgcc is covered in the previous chapter and I didn’t emphasize that the webcam chapter builds on it. I probably should have.

    It sounds like the .cgi files aren’t set executable. Do a “chmod +x roombapanel.cgi” and that should give you the commands.

    As for the other panel, make sure your camera is listed in: http://mxhaard.free.fr/spca5xx.html You need to make sure the exact USB Vendor Id & Product Ids match. You can see those in ‘dmesg’ I think, or by doing “cat /proc/bus/usb/devices”.

    For another take on installing spcacat on Macsat’s page: http://www.macsat.com/macsat/content/view/36/30/

    OpenWrt’s webserver is part of “BusyBox”, the command-line shell you use when you ssh into OpenWrt. Serving web pages and dealing with a command-line is pretty similar. Just as a command-line shell can run commands and display their output, so can BusyBox’s webserver for CGI shell scripts.

  14. Rich Flowers August 14th, 2007 3:55 am

    Tod,

    I am a little closer. The CGI starts but gives me a message box telling me that I am about to run the file but and prompts me to save or cancel a file… too weird.

    Rich

  15. Rich Flowers August 14th, 2007 1:28 pm

    Tod,

    Can you explain the code …

    me=”$SCRIPT_NAME”
    cmd=”$QUERY_STRING”

    and what values go into ‘me’ & ‘cmd’

    Thanks,
    Rich

  16. Rich Flowers August 14th, 2007 6:53 pm

    Tod,

    Ignore 2 previous messages. I now beleive I don’t have enough of your files installed. Do you have any documentation on how, what and where I need in order to run roombapanel.html?

    Thanks,
    rich

  17. todbot August 14th, 2007 8:14 pm

    Hi Rich,
    Do you have the book? There are two chapters that basically walk through how to install OpenWrt and all the necessary files to talk to a Roomba.

    I’ve been meaning to write up a similar post for the projects site, but I’ve not had much free time. The publisher won’t allow me to post the chapters verbatim.

    However, MacSat’s instructions mentioned above describe how to get a webcam working, and if you’re familar with writing shell scripts in Unix, you can write CGI scripts for OpenWrt (they’re the same thing). Poke around the OpenWrt web interface files in /www/cgi-bin/webif/ to see some working examples.

  18. Rich Flowers August 15th, 2007 7:51 am

    Tod,

    Yes, I bought the book months ago and was originally was going to use a Sharp Zaurus SL-5500. Instead I installed OpenWrt on a new Asus WL-500gP to be used as a bridge/client. OpenWrt seems to works fine once I realized the SSID HAD TO MATCH my Gateway router value.

    The problem is getting the HTML to render correctly the splitscreen with the image on the left and the controls on the right. I downloaded only these files from this site: \usr\bin\roombacmd, \www\roombapanel.html, \www\roomapanel.css, \www\roombapanel.cgi & \www\roombacam.html.

    The CGI file does not seem to work correctly. When I call roombapanel.html, I get a message asking if I want to the run the CGI file and then it asks me to save a file(???). The controls never display on the right frame. The image on left is a broken icon cause my webcam is not recognized which is OK at this time. I will need to get another. I pulled the HTML portion from the CGI file and placed it in a newly created HTML file and the controls display/click fine so I have to believe the CGI file has some other problem or I have some kind of configuration problem. I call it using wireless from a Thinkpad laptop running Kubuntu 7.04.

    I don’t have a flashdrive plugged into the router and don’t plan to use it. I am hoping to modify that part of program later to use mini-sendmail to email the jpg on demand when a button is clicked.

    My USB webcam does not seem to be recognized/supported by dmesg, lsusb or SpcaCat but I would assume the HTML should render correctly in spite of that. Is that assumption correct?

    If you want to take this conversation offline as to not clog up the Comments section, feel free to contact me directly.

    Thanks,
    Rich

  19. Rich Flowers August 16th, 2007 7:37 am

    Tod,

    An update… By chance, do you know if there some iPkg for OpenWrt that I need to display CGI files because I think the default web service (httpd) may not be capable of anything but HTML? I have tried it both with FireFox and IE browsers with similiar results.

    Rich

  20. todbot August 16th, 2007 8:53 am

    Hi Rich,
    If you can use the OpenWrt web interface, it’s running CGI scripts. For instance, the file /www/cgi-bin/webif/info.sh is the script that’s run when you click on “Router Info”.

    Make sure to put your CGI scripts in the “cgi-bin” directory. Your HTML files should be able to go in there too, unless OpenWrt has changed how that works in the last year (I don’t have my OpenWrt Roomba setup available to test)

  21. Rich Flowers August 16th, 2007 10:57 am

    Tod,

    I did not load anything specific regarding web interface. Do you know if the web interface is already installed and enabled in the base OpenWrt firmware?

    I had the CGI file in the www folder which I will move to the chg-bin folder instead.

    Thanks,
    Rich

  22. todbot August 16th, 2007 10:59 am

    Wait, I’m confused, how did you configure OpenWrt if not through its web interface?

  23. Rich Flowers August 16th, 2007 4:41 pm

    Tod,

    Miscommunication. What I am saying is that I did NOT load any iPkg for a web server but it does run HTML so I am guessing some web server/interface is loaded with the default OpenWrt package install. But I don’t believe this roomapanel.cgi can run because the browsers–IE, Firefox, & Konqueror CAN’T currently handle the HTML page in the middle of it. I know because I tried all of them.

    I even load PHP5 and Micoperl–no difference.

    Did you write this code? If so, did you EVER run it? If so, how long ago? Because apparently browsers due to security changes can’t run it anymore without some kind of tweaks–maybe.

    Rich

  24. Rich Flowers August 17th, 2007 6:15 am

    More updates.

    I am able to call the CGI file directly from another Linux PC and it displays. The problem apparently is related to the roomapanel.html code. Also if I put the CGI file in the ‘cgi-bin’ folder, roombapanel.html can NOT find it. Regardless if I qualify it or not. I even reflashed my router to a OpenWrt vanilla status with same results.

    Rich

  25. Rich Flowers August 27th, 2007 12:22 pm

    Tod,

    Finally got a USB webcam that should work. Can you tell me what my /etc/modules file should contain in
    order to use it under OpenWrt? Also, if anything needs to be specific order.

    This is what I have currently but think I need more as It is not yet working…

    wl
    usbcore
    usbserial
    usb2
    pl2303
    videodev
    spca5xx

    Also, can I download the RoombaCmd file from your server? I assume I need to go along wirh the CGI file.

    Still no luck with the CGI file though.

    Thanks, Rich

  26. Rich Flowers March 19th, 2008 5:56 pm

    Todd,
    I am rebuilding my WL-500gP and when I try the following script no link is created.

    ln -s /dev/v41/video0 /dev/video0

    Should /dev/v41video0

  27. Rich Flowers March 19th, 2008 6:01 pm

    Todd,

    I am trying to rebuild my WL-500gP and when I run the following script no link is created.

    ln -s /dev/v41/video0 /dev/video0

    What creates the /dev/v41/video0 path? I have V41 folder in /dev.

    -Rich

  28. Rich Flowers March 19th, 2008 6:19 pm

    Todd,

    Oops, I mean I have no /dev/video0 nor /dev/v4l folder

    Rich

  29. Rich Flowers March 21st, 2008 4:59 pm

    Resolved. Installing Spca5xx instead of Spca5xx_lite fixed it.

  30. todbot March 21st, 2008 5:38 pm

    Hi Rich, Thanks for figuring this out. Which camera are you using, when did you buy it, and what USB VID/PID does it have?

    The state of webcams on Linux is always a moving target, as vendors change what’s inside the cameras all the time. It’s even worse for embedded Linux, which has a smaller subset of cameras it can work with. Fortunately, Michel Xhaard’s work on the SPCAxx-based webcams covers a great many of the cams available. He even tries to make a smaller version of the driver (the “lite” version) for use in memory tight situations like a WRT router. Unfortunately, sometimes the lite version just doesn’t work quite right with certain cams and kernels.

  31. Rich FLowers April 9th, 2008 5:05 pm

    Todd,

    Bought a Microdia camera from Walmart. My next problem is that although I got the html code working to maneuver the Roomba it replies that it can’t see the port. It performs the snapshot function but nothing else. If I click on the INIT link I get the following:

    roomba_init_serialport: Unable to open port : No such file or directory
    error: couldn’t open roomba

    I have tried both a roombstick and also built a unit that you described from a cellphone Future Dial Cable 22 USB sync cable for Nokia. same result either way. I am new to Linux so how do I determine what port I need?

    The code is: PORT=”/dev/usb/tts/0″

    I checked the directory structure don’t see anything in /dev/usb

    Thanks, Rich

  32. todbot April 17th, 2008 11:57 am

    Hi Rich,
    Hmm, that looks like you don’t have the “devfs” stuff loaded on your OpenWRT Linux install. I’m not too familiar with this stuff, but if you have “devfs”, then when device drivers load, the devices will appear in a hierarchy like “/dev/usb/tts/0″ (which reads, right to left, “the first serial device on the usb bus”). If you don’t have “devfs”, then when the driver loads, the devices will appear like “/dev/ttyUSB0″. Apparently devfs is the new way of doing things, but it seems linux distro providers go back and forth between which one they like better. :)

    In short, if you don’t have “/dev/usb/tts/0″ look for “/dev/ttyUSB0″. You’ll then need to change any code to match the new serial port name.

  33. Carl Ragel April 27th, 2008 11:54 am

    Tod

    My Roomba has developed issues with falling off the step and trying to crawl up walls. Unfortunately, it’s just out of warranty. iRobot wants to sell me a new one, and that may be the only option. They say it’s the edge sensor(s) that have gone bad.

    With that, Can those sensors be replaced? If not and I get another one from them under their out-of-warranty program, I’ll still have my original wall climber. Would it be of value with some of the hacks in your book,some of which sound way cool?

    Ideally, I need to keep this solution as affordable as possible - the economy, you know.

    Any thoughts would be appreciated.

    Thanks
    Carl

  34. todbot April 27th, 2008 11:14 pm

    Hi Carl,

    I’m pretty sure you can replace the sensor if you’ve done a little bit of soldering before. I don’t know the exact make-up of the edge sensor, but it is an optical sensor, consisting of an infrared LED & a photodetector. It’s rare for either of these to go bad, but it is possible. You may even get lucky and find that the problem is just a loose connector or bad solder joint to the sensor. But if not, once you remove the sensor, you should find some markings to let you find a replacement.

    As for hacking it, none of the hacks in the book require the edge sensor. In fact, I think a partially functioning Roomba is the best one to use for hacking because you can try to overcome its failed systems, much like the Mars rovers have been compensating for their failing parts.

Leave a reply