Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roomba firmware 3.0.11 appears to break roomba component #27028

Closed
kbx81 opened this issue Sep 28, 2019 · 13 comments · Fixed by #29042
Closed

Roomba firmware 3.0.11 appears to break roomba component #27028

kbx81 opened this issue Sep 28, 2019 · 13 comments · Fixed by #29042

Comments

@kbx81
Copy link
Contributor

kbx81 commented Sep 28, 2019

Home Assistant release with the issue:
0.99.3

Last working Home Assistant release (if known):
0.99.3

Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io 189 on RPi 3 B+

Component/platform:
https://www.home-assistant.io/components/roomba/

Description of problem:
My iRobot Roomba i7+ received a firmware update to version 3.0.11 on September 27th. It appears that, since this update, the component fails (or causes the cloud component to fail?) at startup.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

vacuum:
  - platform: roomba
    host: 10.9.8.7
    username: [redacted]
    password: [redacted]

Removing this configuration results in HA starting normally.

Traceback (if applicable):

2019-09-27 20:53:41 ERROR (MainThread) [homeassistant.setup] Error during setup of component cloud
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 566, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 534, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1771, in _run_once
    handle._run()
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/components/roomba/vacuum.py", line 108, in async_setup_platform
    await hass.async_add_job(roomba.connect)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 283, in connect
    sys.exit(1)
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 168, in _async_setup_component
    hass, processed_config
  File "/usr/src/homeassistant/homeassistant/components/cloud/__init__.py", line 189, in async_setup
    user = await hass.auth.async_get_user(prefs.cloud_user)
  File "/usr/src/homeassistant/homeassistant/auth/__init__.py", line 135, in async_get_user
    return await self._store.async_get_user(user_id)
  File "/usr/src/homeassistant/homeassistant/auth/auth_store.py", line 72, in async_get_user
    await self._async_load()
  File "/usr/src/homeassistant/homeassistant/auth/auth_store.py", line 289, in _async_load
    await self._async_load_task()
  File "/usr/src/homeassistant/homeassistant/auth/auth_store.py", line 296, in _async_load_task
    self._store.async_load(),
concurrent.futures._base.CancelledError

After restoring onto a new SD card, the error is slightly different:

2019-09-28 04:04:34 ERROR (MainThread) [homeassistant.components.binary_sensor] octoprint: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 566, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 534, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1771, in _run_once
    handle._run()
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/components/roomba/vacuum.py", line 108, in async_setup_platform
    await hass.async_add_job(roomba.connect)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/roomba/roomba.py", line 283, in connect
    sys.exit(1)
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 441, in async_device_update
    await self.hass.async_add_executor_job(self.update)
concurrent.futures._base.CancelledError

Additional information:
Things I've tried in an effort to fix:

  • Restart HA and Hass.io
  • Restart Roomba
  • Verified that robot credentials have not changed
  • Verified that robot IP has not changed
  • Verified that robot is connected to wifi
  • Disabled all custom_components (except hacs)
  • Restored a snapshot onto a new SD card with a fresh Hass.io and HA installed

It is absolutely possible that the firmware update breaking the component is somehow a coincidence, however I can say with absolute certainty it has was working the day prior to the firmware update. No HA updates or configuration changes were made between when it was last working and when it stopped working so I'm not sure what else to attribute this new error to.

@rccoleman
Copy link
Contributor

I have the same issue with the same firmware update and Roomba version. As with you, commenting out the Roomba section in configuration.yaml allows HA to start. For me, I believe there was an ERROR 104 When first connecting to the Roomba and preceding the cascading failures.

@probot-home-assistant
Copy link

Hey there @pschmitt, mind taking a look at this issue as its been labeled with a integration (roomba) you are listed as a codeowner for? Thanks!

@rccoleman
Copy link
Contributor

The MQTT port (1883) is showing up as "filtered" when probed with nmap, so presumably that's why it's failing.

@ratsputin
Copy link

I'm having a similar problem with 0.98.5. Commenting out the Roomba section was the only recourse. Interestingly, HA continued to talk to my Roomba 980. Apparently there wasn't an update for it.

As a side note, in my case I'm running the Roomba980-Python library rather than the Roomba support built into HA (that doesn't work for me). I just checked the status and nobody has reported issues with the library as yet.

@kbx81, are you running the stock component? I was under the impression it was not compatible with the 980 nor the i7.

@rccoleman
Copy link
Contributor

rccoleman commented Sep 29, 2019

I’m running the stock Roomba component and it’s been working fine with my i7+ since I got it last year. It also worked with my 980.

@kbx81
Copy link
Contributor Author

kbx81 commented Sep 30, 2019

@ratsputin I will assure you that the stock component has been working flawlessly with the i7(+) I have for months now -- this is not a new setup that randomly doesn't work (or that broke after an HA upgrade/reconfig). :) I'm familiar with Roomba980-Python as well as dorita but haven't tried to pull either of them into HA. I actually used dorita to determine (and verify the other day) my robot's credentials for its config in HA. It was still able to communicate with the robot although I didn't try to use it for control.

@mcaminiti
Copy link

I just ran into the same issue today as my Roomba i7 updated to the same firmware. Been using it with the 980 python code since it came out.

@namachieli
Copy link

namachieli commented Oct 10, 2019

Same issue with my S9+, same error. commenting it out of configuration.yaml lets everything start up normally.

@namachieli
Copy link

namachieli commented Oct 10, 2019

So i found NickWaterton/Roomba980-Python#39 (comment)
Which lead me to zhouF96/Roomba980-Python@ede7e95

And that does seem to be the issue. I manually edited the following in HA

/usr/local/lib/python3.7/site-packages/roomba/roomba.py
/usr/local/lib/python3.7/site-packages/roomba/password.py  

and changed TLSv1 to TLS, and when i started back up, everything was happy again.

You can run the following to fix it. The first line makes a backup of all .py files, the second uses sed to make a global inline replacement.

for file in /usr/local/lib/python3.7/site-packages/roomba/*.py; do cp "$file" "${file}.bak"; done
sed -i 's/PROTOCOL_TLSv1/PROTOCOL_TLS/g' /usr/local/lib/python3.7/site-packages/roomba/*.py

Looks like @NickWaterton patched it, so we just need https://pypi.org/project/roombapy/ updated, and https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/roomba/manifest.json updated to that version.

@ratsputin
Copy link

@namachieli Thanks so much for tracking this down. I made the suggested changes and my i7+ is once again working.

@crkochan
Copy link
Contributor

I opened a PR on the roombapy repository to try to get the package authors attention.

@kbx81
Copy link
Contributor Author

kbx81 commented Nov 21, 2019

Bump. 😄

@kbx81
Copy link
Contributor Author

kbx81 commented Nov 22, 2019

FWIW I made the above fixes/patches to password.py and roomba.py in my (now) 0.102 HA container and the robot is back and working in HA.

Is anyone able to act on the PR and get the fix merged in so it can get released? 😄

pschmitt added a commit to pschmitt/home-assistant that referenced this issue Nov 25, 2019
cgtobi pushed a commit that referenced this issue Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants