core: Roomba 960 not able to connect

The problem

I’ve had my Roomba 960 set up for about 18 months now, and it has been unable to connect for a while now.

I’m not sure what version actually broke it (or it could have even been an update to the Roomba itself 😬), but I noticed an error when updating to 2022.4.0 this morning. I’ve attached it down below.

I also attempted to simply reload the integration, and I see two errors… I’ve attached them down below as well.

My Roomba is definitely on the network (can ping from terminal), so I’m not sure why it wouldn’t be able to connect 🤔

What version of Home Assistant Core has the issue?

2022.4.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Roomba

Link to integration documentation on our website

https://www.home-assistant.io/integrations/roomba

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-04-07 07:24:25 ERROR (Thread-16) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
    rc = self._loop(timeout)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1164, in _loop
    rc = self.loop_read()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1556, in loop_read
    rc = self._packet_read()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2439, in _packet_read
    rc = self._packet_handle()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3033, in _packet_handle
    return self._handle_publish()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3327, in _handle_publish
    self._handle_on_message(message)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3570, in _handle_on_message
    on_message(self, self._userdata, message)
  File "/usr/local/lib/python3.9/site-packages/roombapy/roomba.py", line 188, in on_message
    log_string, json_data = self.decode_payload(msg.topic, msg.payload)
  File "/usr/local/lib/python3.9/site-packages/roombapy/roomba.py", line 296, in decode_payload
    return formatted_data, dict(json_data)
TypeError: 'NoneType' object is not iterable
2022-04-07 07:24:40 ERROR (SyncWorker_10) [roombapy.remote_client] Can't connect to 192.168.1.192, error: _ssl.c:1112: The handshake operation timed out
2022-04-07 07:24:40 ERROR (SyncWorker_0) [roombapy.remote_client] Can't connect to 192.168.1.192, error: [Errno 111] Connection refused
2022-04-07 07:24:40 ERROR (SyncWorker_0) [roombapy.remote_client] Can't connect to 192.168.1.192, error: [Errno 111] Connection refused
2022-04-07 07:24:40 ERROR (SyncWorker_0) [roombapy.remote_client] Can't connect to 192.168.1.192, error: [Errno 111] Connection refused
2022-04-07 07:24:40 ERROR (SyncWorker_0) [roombapy.remote_client] Unable to connect to 192.168.1.192
2022-04-07 07:25:00 ERROR (SyncWorker_1) [roombapy.remote_client] Can't connect to 192.168.1.192, error: [Errno 111] Connection refused
2022-04-07 07:25:00 ERROR (SyncWorker_1) [roombapy.remote_client] Can't connect to 192.168.1.192, error: [Errno 111] Connection refused
2022-04-07 07:25:01 ERROR (SyncWorker_1) [roombapy.remote_client] Can't connect to 192.168.1.192, error: [Errno 111] Connection refused
2022-04-07 07:25:01 ERROR (SyncWorker_1) [roombapy.remote_client] Unable to connect to 192.168.1.192

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22

Most upvoted comments

There hasn’t been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

There hasn’t been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

There hasn’t been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Had similar issue (running laterst version - as of today - of HA in a docker container)

Trying to add the Roomba 980 continously failed with lots of: 2023-02-09 17:44:48.165 ERROR (roombapy) [roombapy.remote_client] Can’t connect to 10.0.121.104, error: [Errno 111] Connection refused

In the end I did the password retrieval from the cloud: https://github.com/koalazak/dorita980

Downloaded the files from https://github.com/NickWaterton/Roomba980-Python and connected directly to the Roomba using BLID, password and host ip without problem (so pointing at HA integration as the culprit)

After enabling debugging of the component roombapy in the logger I found that HA could actually connect but somehow tried multiple parallell connections / which obviously failed since the MQTT server in the 980 only could handle one. This screwed up the entire addition of the integration

I added some debug code to verify that the same roomba python object was reused and then a quick fix was to check in the code if we already has a connection and returned True from the connection function immediately (setting ‘is_connected’ to True/False in the internal_connect and disconnect functions passed to mqtt client):

/usr/local/lib/python3.10/site-packages/roombapy/remote_client.py

--- remote_client.py.old
+++ remote_client.py
@@ -15,8 +15,10 @@
     password = None
     log = None
     was_connected = False
+    is_connected = False
     on_connect = None
     on_disconnect = None
+    mqtt_client = None

     def __init__(self, address, blid, password, port=8883):
         """Create mqtt client."""
@@ -43,6 +45,9 @@
         self.on_disconnect = on_disconnect

     def connect(self):
+        if self.is_connected:
+            self.log.info("Already connected to %s", self.address)
+            return True
         attempt = 1
         while attempt <= MAX_CONNECTION_RETRIES:
             self.log.info(
@@ -111,6 +116,8 @@
             "Connected to Roomba %s, response code = %s", self.address, rc
         )
         connection_error = MQTT_ERROR_MESSAGES.get(rc)
+        if rc == 0:
+            self.is_connected = True
         # If response code(rc) is 0 then connection was succesfull.
         if rc != 0 and connection_error is None:
             self.log.warning(
@@ -125,6 +132,8 @@
         self.log.debug(
             "Disconnected from Roomba %s, response code = %s", self.address, rc
         )
+        if rc == 0:
+            self.is_connected = False
         connection_error = MQTT_ERROR_MESSAGES.get(rc)
         # If response code(rc) is 0 then connection was succesfull.
         if rc != 0 and connection_error is None:

Update: I added some more details after I saw ferdyvi’s comment below in the hope that helps.

This issue thread is a bit convoluted (Can’t connect Roomba and Roomba no longer connects after update). I am reporting on the latter: I have today updated from 2023.1.4 to 2023.2.1 and lost the Roomba connection. As pointed out in the thread higher up, restarting the Roomba and retry of the integration brought everything back. Maybe there should be some update the docs to that extend (Known workaround to resolve if you have lost the connection after a HA update). Happy to give it a shot via PR if that is helpful, pls let me know. to make this more detailed what I have on my side:

  1. open the phone (Android in my case) app, select the device and then -> “Product Settings” -> “Reboot <vaccum name>” -> “Reboot <vaccum name>”
  2. Wait for it to come back (check in phone app when it has status “connected”)
  3. Go to HA “Settings” -> “Devices & Services” -> select the “iRobot Roomba and Braava” integration
  4. Select “configure” on the integration tile and make sure “Continuous” is selected; delay in my case is set to 1
  5. Select the hamburger menu -> “System Options” and make sure “enable newly added entities” is enabled
  6. I then had a option to reload or reconfigure the integration (as it is working now I can’t describe it in detail, sorry)
  7. After that, the 3 entities for the Roomba came back and it worked

Something else to note (not sure it matters): I still have a config for the Roomba in the configuration.yml which looks like the below. The Roomba is on a fixed IP in my network to avoid any confusion across updates, new installs etc.

#Roomba
roomba:
  - host: !secret roomba_ip
    blid: !secret roomba_user
    password: !secret roomba_password
    continuous: True    #needs to be true (default) as the vacuum otherwise won't start on commands 

This is still a problem for me. Cannot add the Rooma. Manually retrieved my password via dorita980. Says failed to connect. A few different errors in the logs:

Logger: roombapy.roomba
Source: /homeassistant/lib/python3.10/site-packages/roombapy/roomba.py:166
First occurred: 11:31:14 AM (2 occurrences)
Last logged: 11:33:11 AM

Unexpectedly disconnected from Roomba 192.168.0.114, code Unable to connect to Roomba at 192.168.0.114
Logger: roombapy.remote_client
Source: /homeassistant/lib/python3.10/site-packages/roombapy/remote_client.py:58
First occurred: 11:35:31 AM (3 occurrences)
Last logged: 11:35:31 AM

Can't connect to 192.168.0.114, error: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:997)
Can't connect to 192.168.0.114, error: [Errno 111] Connection refused

It does seem like rebooting the robot from the app helped (integration set up successfully), but connection must be getting dropped somewhere along the way, because it also seems like I have to reload the integration before starting the vacuum, or it won’t run.