Roomba 530 Serial port

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
yvesdm3000
Robot Groupie
Posts: 62
Joined: July 1st, 2009, 4:01 am

Roomba 530 Serial port

Post by yvesdm3000 »

Hello,

I'm trying to interface my Roomba 530 to my PC using an FDTI USB232R adapter which shifts TTL-level 5V into a USB virtual COM port. I've successfully used this cable to interface with an ATMEL AVR PIC so it should work fine...

I've written my own little application (nothing fancy) to do the binary communication. On bootup I get this:
bl-start
STR730
bootloader id: #x47055364 B01D8FFF
bootloader info rev: #xF000
bootloader rev: #x0001
2007-05-14-1715-L
Roomba by iRobot!
str730
2008-05-28-1341-L
battery-current-zero 256

2008-05-28-1341-L
r3_robot/trunk:3085 CLEAN

bootloader id: 4705 5364 B01D 8FFF
assembly: 3.3
revision: 0
flash version: 7
flash info crc passed: 1


processor-sleep
key-wakeup 0000000000000000 0000000000000010
slept for 0 minutes 31 seconds

2008-05-28-1341-L
r3_robot/trunk:3085 CLEAN

bootloader id: 4705 5364 B01D 8FFF
assembly: 3.3
revision: 0
flash version: 7
flash info crc passed: 1

battery-current-zero 256
OK, when I send "128" roomba beeps once and roomba replies with exactly the same command "128". For that matter, roomba always replies with the same command, on occasion it does reply with anything else, for example on a 131 command, it replies me with a 253

I'm really stuck here. It looks like I'm able to read but not able to send any command, just as if the command syntax has changed...

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

Re: Roomba 530 Serial port

Post by mfortuna »

Are you sending ASCII 128 (three characters) or 0x80 hex to the roomba? You appear to have the correct baud rate.
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
yvesdm3000
Robot Groupie
Posts: 62
Joined: July 1st, 2009, 4:01 am

Re: Roomba 530 Serial port

Post by yvesdm3000 »

This is a snippet of the code:
BOOL status;
HANDLE hCom = NULL;
DCB dcb;
unsigned char buffer[128];
int buflen = 0;
DWORD bytesWritten = 0;
DWORD bytesRead = 0;

hCom = ::CreateFile("\\\\.\\COM9",GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
::SetupComm(hCom,16,16);
::GetCommState(hCom,&dcb);
dcb.BaudRate = 115200;
// dcb.BaudRate = 19200;
dcb.fBinary = 1;
dcb.fNull = 0;
dcb.fDtrControl = 0;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
dcb.fAbortOnError = true;
status = ::SetCommState(hCom,&dcb);
buffer[0] = 128;
status = ::WriteFile(hCom,buffer,1,&bytesWritten,NULL);
Sleep(10);
status = ::ReadFile(hCom,buffer,16,&bytesRead,NULL);
So I surely send a clean binary 128 sequence...

-YvesDM
yvesdm3000
Robot Groupie
Posts: 62
Joined: July 1st, 2009, 4:01 am

Re: Roomba 530 Serial port

Post by yvesdm3000 »

Found the problem this morning. I unplugged the PS from my laptop and I get a nice comms. Probably an interference/grounding problem...

The roomba is now able to do scheduled cleanings which was the objective.

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

Re: Roomba 530 Serial port

Post by mfortuna »

That's interesting. Was your 560 docked when you tried to talk to it? If so you could try removing it from the dock and see if it works with your laptop PS plugged in.
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
yvesdm3000
Robot Groupie
Posts: 62
Joined: July 1st, 2009, 4:01 am

Re: Roomba 530 Serial port

Post by yvesdm3000 »

No it was not docked, it was just next to my laptop on the table.

I'll see if I get some time to your test.

-Yves
yhmmc
Robot Addict
Posts: 132
Joined: July 5th, 2009, 9:12 pm

Re: Roomba 530 Serial port

Post by yhmmc »

You wrote this little program. How do you run it? How do you get it into the roomba. What program do you use. I am on windows xp sp2 with a roostick and an arduino and a roomba 530 and I have an 8 pin staight through cable. So far, when i hook it up, I can send commands to the roomba and no matter what i send, it goes forward only.
User avatar
mfortuna
Robot Master
Posts: 5853
Joined: February 5th, 2006, 9:35 am
Location: NH

Re: Roomba 530 Serial port

Post by mfortuna »

The program isn't in the roomba, it is a PC sending commands to the roomba over a serial port.
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
yhmmc
Robot Addict
Posts: 132
Joined: July 5th, 2009, 9:12 pm

Re: Roomba 530 Serial port

Post by yhmmc »

OK, let's assume that the serial port hooked up and communicating to your pc. Where do you go from there to run your program? what is your procedure?

Thanks!
User avatar
vic7767
Robot Master
Posts: 15556
Joined: January 14th, 2006, 7:31 pm
Location: Haughton Louisiana - USA

Re: Roomba 530 Serial port

Post by vic7767 »

yhmmc wrote:OK, let's assume that the serial port hooked up and communicating to your pc. Where do you go from there to run your program? what is your procedure?

Thanks!
Head over to this URL and see if you have an interest. You will be able to write, compile, and execute your own programs to do what you want on your Roomba.

https://www.zagrosrobotics.com/shop/ite ... 92&catid=2
yhmmc
Robot Addict
Posts: 132
Joined: July 5th, 2009, 9:12 pm

Re: Roomba 530 Serial port

Post by yhmmc »

Vic, once again, thanks. Did you know that I am actually from Louisiana. Left there because of the humidity 16 years ago. But, my heart still misses the fishin' and N.O. roast beef po'boy sandwiches. I am a REAL Cajun, but don't speak a word of french, Shaah!
yhmmc
Robot Addict
Posts: 132
Joined: July 5th, 2009, 9:12 pm

Re: Roomba 530 Serial port

Post by yhmmc »

Does this MindControl work with the Roomba530?
User avatar
vic7767
Robot Master
Posts: 15556
Joined: January 14th, 2006, 7:31 pm
Location: Haughton Louisiana - USA

Re: Roomba 530 Serial port

Post by vic7767 »

yhmmc wrote:Does this MindControl work with the Roomba530?
Of course it will. You just use different commands and data rate.
Post Reply