# Not able to communicate with Roomba with serial port

I have an IRobot Roomba model number 565 and I am trying to control it with a Wemos D1 mini with Roomba's OI.

I connected the TX and RX pins from my FTDI adapter to the Roombas RX and TX and I can see information (battery firmware and etc) pop up in Termite (a serial terminal) but if I send the commands 128,131,135 in sequence The Roomba doesn't go to clean mode.

I saw somewhere that sending commands to the Roomba with the serial terminal won't work because it will send 128 as three bytes instead of one. So I used a sketch from someone that publishes information about the Roomba into an MQTT server. So I uploaded it to my Wemos D1 mini and connected the RX and TX accordingly, but it sends "no data" and when I do a power reset it gives me a two-tone beep.

I am really confused about what does that beep mean and why isn't it working correctly. I did try two different sketches but neither of them worked.

How can I command my Roomba to go into clean mode using my Wemos D1 mini?

EDIT: sorry for forgetting to add the links of the sketches I tried. The MQTT one is from a Youtuber called The Hook Up here is his GitHub The second one I saw while searching on why it wasn't working, so here is that one. Also, I was trying to upload this one but I was getting a compiling error so I didn't test it. Also, I didn't find anything about the error beep the Roomba is giving me. The closest thing I get while searching for it is the list of error codes and beeps but it doesn't say anything for only 2 beeps and no voice message. I also totally forgot to mention that when I connect my Roomba with a serial adapter, open Termite(a serial terminal) and then press the clean button I get the following response

this tells me that there is a high chance that there is OI support in my Roomba.

I also tried using Python as Austin suggested but still, no luck here is my code if you can find some sort of mistake I did 🤞

import serial
ser = serial.Serial("COM7", 115200) # open serial port
print(ser.name) # check which port was really used
ser.write(bytearray([128, 131, 135]))
print ("commands sent")

• what information have you found about the two-tone beep? Jun 4 '19 at 19:01
• I have edited the question you guys asked for. thanks a lot for letting me know. Also, I was wondering if I should call Irobot and maybe they might help. what do you guys think? And most of the people said that it's my Roomba's fault because theirs are working fine. Jun 6 '19 at 4:17
• The serial terminal your using is representing the numbers as ASCII characters, which means typing 128 is actually sending bytes 49, 50, and 56. Why not try doing this in Python with the pyserial library, this will only be a few lines of code. Import serial, make the serial object (ser = serial.Serial("COM#", <baud_rate>), then do a ser.write(bytearray([128, 131, 135]). Jun 6 '19 at 15:43
• I don't know much about python. If you can show me an example file that will be great. until then I will try to do it myself and give the results I get Jun 6 '19 at 18:55
• Hello @AustinTronics I tried using python and still no luck I posted my code in the question Jun 7 '19 at 4:11

Your code looks good, the device is probably sending you back bytes so you need to read them on the port. Adding to what you have, it would look something like this:

import serial
import time

ser = serial.Serial("COM7", 115200) # open serial port
print(ser.name) # check which port was really used
ser.write(bytearray([128, 131, 135]))
print ("commands sent")

start_time = time.time()
while time.time()-start_time < 10:
if ser.inWaiting() > 0: