Get Roomba Password & BLID Code & App (Plus code change)
4 min read

Get Roomba Password & BLID Code & App (Plus code change)

Get the code fixes and instructions to run the Roomba980-Python script to get your iRobot Roomba device BLID & password locally.
Get Roomba Password & BLID Code & App (Plus code change)

Table of contents

Roomba's are usually controlled via the iRobot App, but what if you wanted local, privacy-focused and offline control? For that, there is a wonderful open-source (and free) app / script called Roomba980-Python just for that.

Here is the GitHub repo (https://github.com/NickWaterton/Roomba980-Python)

GitHub - NickWaterton/Roomba980-Python: Python program and library to control iRobot Roomba 980 Vacuum Cleaner
Python program and library to control iRobot Roomba 980 Vacuum Cleaner - NickWaterton/Roomba980-Python

Install

There are a few requirements and steps to get it installed, thankfully the instructions are rather clear on (most) of the steps. First, let's follow what they say in to repo:

💡
Note: the instructions below are for MacOS and Linux. No idea if it'll work from PowerShell in Windows.

(1) Clone the repo locally:

git clone https://github.com/NickWaterton/Roomba980-Python.git

(2) Inside the newly cloned repo, go into the roomba directory.

(3) Make sure you have Python 3.6 or newer.

(4) If you're lazy like me, simply run the pip3 (or simply pip if you have it linked to py3) to automatically install the requiments:

pip3 install -r ../requirements.txt

Bugs & Errors

I'm writing this article because by following the above and the usage instructions did not work for me. I first got an error that it couldn't find the Roomba, and then when I have it the IP address directly it said it couldn't find the address even though it just did ... and after fixing that: it then gave me an SSL error. Which is weird because we're accessing it directly via a local IP thus there isn't any SSL around.

Either way, you DO NEED TO FIX THE CODE in-order to get it working.

The errors I received

First, it shouldn't find the Roomba on my network:

2024-03-30 19:47:47 INFO [Roomba.Password] Using Password version 2.1
2024-03-30 19:47:47 INFO [Roomba.Password] reading/writing info from config file ./config.ini
2024-03-30 19:47:47 INFO [Roomba.Password] waiting on port: 5678 for data
2024-03-30 19:47:58 WARNING [Roomba.Password] No Roombas found on network, try again...

Though is does also show some sort of error in a non-existant config file, but those seem to be 'ok' to ignore:

❯ ./password.py
/Users/<my home here>/Development/Roomba980-Python/roomba/./password.py:24: SyntaxWarning: invalid escape sequence '\c'
  '''
/Users/<my home here>/Development/Roomba980-Python/roomba/./password.py:39: SyntaxWarning: invalid escape sequence '\c'
  def __init__(self, address='255.255.255.255', file=".\config.ini", login=[]):

The 'fix' for it not finding the IP of the Roomba, or more specifically: not finding a Roomba at all is to find the IP address myself and plug it into the command line script (more on this below).

After that, then it would error out on not finding the address even after finding it:

2024-03-29 00:17:54 INFO [Roomba.Password] 0 robot(s) already defined in file./config.ini, found 1 robot(s) on network
2024-03-29 00:17:54 INFO [Roomba.Password] To add/update Your robot details,make sure your robot (<robot name here>) at IP <it's local ip here> is on the Home Base and powered on (green lights on). Then press and hold the HOME button on your robot until it plays a series of tones (about 2 seconds). Release the button and your robot will flash WIFI light.
Press <Enter> to continue...
s<Enter> to skip configuring this robot:

And upon pressing enter, it would either loop or just error out.

After fixing that, you'll get an SSL error (as copied from the listed GitHub issue about this):


After the device was found, I am asked to press the home button.
Once I press enter on the console, I get this error (link to issue: https://github.com/NickWaterton/Roomba980-Python/issues/122):

Traceback (most recent call last):
File "./password.py", line 294, in <module>
main()
File "./password.py", line 291, in main
get_passwd.get_password()
File "./password.py", line 160, in get_password
data = self.get_password_from_roomba(addr)
File "./password.py", line 196, in get_password_from_roomba
wrappedSocket = context.wrap_socket(sock)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

Solution: Correct Run Instructions & Code fixes

The first 'fix' is to pass an IP to the password.py script, but we'll get to that later because we need to fix code first.

Fix SSL

Open up password.py and on line 194, just below the SSL line add the following two lines:

context.check_hostname = False
context.verify_mode = ssl.CERT_NONE

Thus it'll look like this:

context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE

Fix 'check_hostname` error

Just below the stuff above, change

context.wrap_socket(sock)

so that the full line looks like:

wrappedSocket = context.wrap_socket(sock, server_hostname=addr)

How to pass IP address to script

Normally you can run the script with password.py ... to pass the IP address of the Roomba:

./password.py -R <local ip here>

Thus if your Roomba's IP is 192.168.1.147 then your command would be:

./password.py -R 192.168.1.147

Let it work for a minute to get some initial info, it'll then ask you if you wish to continue AFTER you set the Roomba to wifi pair mode (the press HOME button on the device for 2-3 seconds), then continue and it'll get you the BLID and password (amongst other things).

If this article has helped you, let me know in the comments.

If anyone puts all the latest fixed and additional issue fixes into a new repo or PR let me know and I'll update this article with the latest info.