NickWaterton / Roomba980-Python

Python program and library to control iRobot Roomba 980 Vacuum Cleaner
MIT License
384 stars 108 forks source link

fix password string rstrip #69

Closed patmarion closed 4 years ago

patmarion commented 4 years ago

rstrip() by default removes whitespace but not null bytes

patmarion commented 4 years ago

I had an issue connecting to a roomba i7 with firmware 3.2.4 from Python 3.7 on Mac OSX with paho-mqtt==1.5.0. The error was:

Roomba Connected with result code 4
Please make sure your blid and password are correct

It turns out that the issue was the password written to config.ini had a null byte at the end. This was tricky to debug because when you print the password it looks like a 30 character string, but it actually had length=31. After I fixed the password string then the program connects successfully.

I think the issue might have started here: https://github.com/NickWaterton/Roomba980-Python/commit/811a8064b498a8cdad400494b4e9dd29328571a9