switchbot-mqtt icon indicating copy to clipboard operation
switchbot-mqtt copied to clipboard

Switchbot Bot not moving

Open djherbis opened this issue 2 years ago • 2 comments

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.

djherbis avatar Sep 29 '23 15:09 djherbis

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 avatar Sep 29 '23 15:09 fphammerle

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

Could you upgrade and retry?

fphammerle avatar Nov 05 '23 12:11 fphammerle