OpenWonderLabs / python-host

The python code running on Raspberry Pi or other Linux based boards to control SwitchBot.
Apache License 2.0
376 stars 84 forks source link

MagicSwitchbot -> ConnectionError... why? #23

Closed rasstef closed 3 years ago

rasstef commented 3 years ago

it's not working for me, but why?

MagicSwitchbot Raspberry 3 Model B -> has Bluetooth Low Energy (BLE) on board Raspbian Buster -> bluez 5.50

# hciconfig hci0 down
# btmgmt le on
# hciconfig hci0 up
# hcitool lescan
  ...
  34:14:B5:4A:8E:19 MagicSwitchBot

# sudo python3 switchbot_py3.py -d 34:14:B5:4A:8E:19 -c close
Traceback (most recent call last):
  File "switchbot_py3.py", line 178, in <module>
    main()
  File "switchbot_py3.py", line 173, in main
    driver.run_command(opts.command)
  File "switchbot_py3.py", line 120, in run_command
    with connect(self.device, self.bt_interface, self.timeout_secs) as req:
  File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "switchbot_py3.py", line 51, in connect
    format(device, timeout))
ConnectionError: Connection to 34:14:B5:4A:8E:19 timed out after 5 seconds

cannot connect to the device no matter what I do. I also tried gatttool, nothing works... Have you got an idea? Is an older version of the bluetooth stack needed (stretch?)?

devWaves commented 3 years ago

SwitchBot and MagicSwitchbot are different products made by different companies. This integration is for SwitchBot