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

Switchbot Bot not moving #180

Open
djherbis opened this issue Sep 29, 2023 · 2 comments
Open

Switchbot Bot not moving #180

djherbis opened this issue Sep 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@djherbis
Copy link

djherbis commented Sep 29, 2023

I get messages like:

Error talking to Switchbot
Traceback (most recent call last):
  File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/switchbot/__init__.py", line 283, in _sendcommand
    self._connect()
  File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/switchbot/__init__.py", line 232, in _connect
    self._device = bluepy.btle.Peripheral(
  File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/bluepy/btle.py", line 391, in __init__
    self._connect(deviceAddr, addrType, iface)
  File "/switchbot-mqtt/.venv/lib/python3.8/site-packages/bluepy/btle.py", line 439, in _connect
    raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral XX:XX:XX:XX:XX:XX, addr type: random
Cannot connect to Switchbot. Retrying (remaining: 1)
Successfully sent command to Switchbot (MAC: XX:XX:XX:XX:XX:XX)
switchbot XX:XX:XX:XX:XX:XX turned off

Which sounds like it failed, but then succeeded on a retry, however the bot doesn't actually move at all.

I'm running on a raspberry pi 4 if that helps.

@fphammerle fphammerle added the bug Something isn't working label Sep 29, 2023
@fphammerle
Copy link
Owner

According to the stack trace above, you are experiencing an issue within the PySwitchbot library.

switchbot-mqtt currently uses an ancient version of PySwitchbot (<0.13).

Upgrading PySwitchbot might fix the bug, however, I haven't found time yet to adapt switchbot-mqtt to the breaking changes in newer versions of PySwitchbot.

fphammerle added a commit that referenced this issue Nov 5, 2023
…, drop compatibility with python3.8, alpine v3.18.4 base image

#103
#180 (comment)
#127 (comment)
@fphammerle
Copy link
Owner

Pre-release v4.0.0a0 supports pySwitchbot's latest release v0.40.1.

Could you upgrade and retry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants