roomba 4110 and python problem

Inside the Roomba and Scooba and more, Cool mods, Repair and Upgrades - including the all new iRobot Create Kit. Let's void that warranty baby!
Post Reply
Smerky
Posts: 2
Joined: January 25th, 2010, 2:39 pm

roomba 4110 and python problem

Post by Smerky »

Hey everyone,

So I'm new to the whole roomba hacking scene. I recently got a 4110 that I decided I wanted to start working with.

I'm trying to communicate to my roomba through a max232 -> serial-usb cable to my laptop. I'm pretty sure I've got my max232 circuit wired up correctly, since I double checked it with a schematic I found online. Then I'm trying to use python and pyserial on a ubuntu 9.04 distro.

Problem: So I am able to wake up my roomba (Which tells me that the RTS to DD works) and I'm able to receive data from the roomba. But, It's almost like the commands I send to it do absolutely nothing and I can't really figure it out.

Here's the code I'm using:

Code: Select all

#!/usr/bin/python
import serial
import time

ser = serial.Serial (
                      port='/dev/ttyUSB0',
                      baudrate=19200,
                      bytesize=serial.EIGHTBITS,
                      parity=serial.PARITY_NONE,
                      stopbits=serial.STOPBITS_ONE,
                      timeout=0.1,
                      xonxoff=0,
                      rtscts=0)
print ser.portstr

ser.open ()
# wake up robot
ser.setRTS(0)
time.sleep(0.1)
ser.setRTS(1)
time.sleep(2)

# pulse device-detect three times
for i in range (3):
  ser.setRTS(0)
  time.sleep(0.25)
  ser.setRTS(1)
  time.sleep(0.25)

time.sleep(1)
ser.write(chr(128)) # start
ser.write(chr(130))  # control
ser.write(chr(133)) # shutdown
ser.close()
exit()
So I'm not exactly sure what's wrong. I thought for a bit that maybe I had firmware that was pre october-2005 (Or whenever that was) but that can't be the case since my roomba wasn't even manufactured until august of 2006.

Thank you in advance to any help anyone offers.

-Smerky
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: roomba 4110 and python problem

Post by mfortuna »

One of the schematics online has an error. Make sure you connect pin 5 of the seral port to ground on your max232 board. By receiving data I assume you are getting the charging info?
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
Neato XV-11
Shark Ion 750
Smerky
Posts: 2
Joined: January 25th, 2010, 2:39 pm

Re: roomba 4110 and python problem

Post by Smerky »

Here's the schematic that I had used:
http://www.flickr.com/photos/todbot/94701997/sizes/o/

Well roughly used. I mapped out the rx/tx and rts/dd pins the same. Otherwise it's slightly different since I'm using a MAX3232CPE.

Uh connect the ground on the pc side to the max232? It's already grounded with the battery so I don't think that is necessary.
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: roomba 4110 and python problem

Post by mfortuna »

X1 pin 5 needs to be connected to ground. Without it you can have issues, especially at higher baud rates.
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
Neato XV-11
Shark Ion 750
Gordon
Robot Master
Posts: 4304
Joined: April 6th, 2005, 2:02 am
Location: Santa Ynez, CA USA
Contact:

Re: roomba 4110 and python problem

Post by Gordon »

Mike, its a good thing you are on tap to straighten out that wiring error, time after bloody time! :clap:
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: roomba 4110 and python problem

Post by mfortuna »

We should probably put it in the read me first section!
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
Neato XV-11
Shark Ion 750
User avatar
vic7767
Robot Master
Posts: 15556
Joined: January 14th, 2006, 7:31 pm
Location: Haughton Louisiana - USA

Re: roomba 4110 and python problem

Post by vic7767 »

Possibly it's time for a READ FIRST sticky in the hacker forum.
User avatar
Fraggboy
Robot Master
Posts: 3661
Joined: March 2nd, 2007, 3:13 pm
Location: In sunny California
Contact:

Re: roomba 4110 and python problem

Post by Fraggboy »

Or, we could add a Hacker section in the main READ FIRST post?! We can copy the READ FIRST post and place it here in the forum as an Annuncement.

If you want certain information to be included in the READ FIRST robotic hacking section, please PM me with the information and I will gladly add it..
Chris

:confusion-shrug:
Website Question? Check out the FAQ section.
Roomba/Scooba Question? Check out the READ FIRST section.
:text-search:
Before posting, check out the improved Search engine. Your question might have been answered already.
Post Reply