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()
Thank you in advance to any help anyone offers.
-Smerky