You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the same Bot can be controlled successfully via the app no response occurs when using sudo python switchbot.py. Note that the device is discovered and connects just fine. It's just that nothing happens on the Bot (no Press).
After many hours of trying various methods to send this command via BLE I have come to the conclusion that this recent firmware has changed the command structure as even this simple script will not work:
I seem to have this same issue. I've never been able to try an earlier firmware to confirm if that works, my switchbot turned up with 6.3 installed. Did you ever find a workaround for it @tojannaon ?
Yes i retried it and it seemed i also had a outdated pip installation, however the program fails to build cryptography with this error
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cryptography Failed to build cryptography ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
the rest of the packages seem to all have installed correctly
Create a virtual environment first and work in there so you don't mess with your system wide pip packages.
python -m venv venv
. venv/bin/activate
Then do your pip things.
You might need to do some googling of that error to make sure you have build-essentials, upgrade pip version, downgrade setuptools if necessary etc... (I've not be doing this from raspbian).
Maybe apt-get install build-essentials and a pip3 install --upgrade pip might get you going.
@reestr Sorry for not chiming in earlier. I ended up having to bail as the Switchbot folks felt that the Bluetooth LE dongle that I was using (expensive and state-of-the-art) was somehow not compatible (even though it works for other applications). I didn't have another to try and wasn't about to purchase one in case there actually were other issues causing the problem.
I found out that atleast for me this api does not send the command properly, but it does connect nicely.
I then found another api that does the exact opposite, so i combined then into a working program
Activity
reestr commentedon Jan 16, 2023
I seem to have this same issue. I've never been able to try an earlier firmware to confirm if that works, my switchbot turned up with 6.3 installed. Did you ever find a workaround for it @tojannaon ?
dcarrion87 commentedon Jan 20, 2023
@tojannaon @reestr
Can you guys can any commands to send including on/off?
I'm on bot version 5.0 and I just get invalid handle errors from gatt.
dcarrion87 commentedon Jan 21, 2023
@reestr try this project instead: https://github.com/Danielhiversen/pySwitchbot
I was only able to get it working through that project.
E.g.:
You can also set change mode with:
TForest-UwU commentedon Feb 10, 2023
Hello,
i have the same issue as @tojannaon, however i the software @dcarrion87 provided gives me this error
I have cloned the git through git clone however i cant seem to find a solution to both these problems.
I am using switchbot version 6.3 and a raspberry pi 3 on the raspbian OS
dcarrion87 commentedon Feb 10, 2023
@TForest-UwU have you:
Also you'll need these pip packages too. But they should come down with that one ^
TForest-UwU commentedon Feb 10, 2023
Yes i retried it and it seemed i also had a outdated pip installation, however the program fails to build cryptography with this error
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cryptography Failed to build cryptography ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projectsthe rest of the packages seem to all have installed correctly
dcarrion87 commentedon Feb 10, 2023
Create a virtual environment first and work in there so you don't mess with your system wide pip packages.
Then do your pip things.
You might need to do some googling of that error to make sure you have build-essentials, upgrade pip version, downgrade setuptools if necessary etc... (I've not be doing this from raspbian).
Maybe
apt-get install build-essentialsand apip3 install --upgrade pipmight get you going.tojannaon commentedon Feb 13, 2023
@reestr Sorry for not chiming in earlier. I ended up having to bail as the Switchbot folks felt that the Bluetooth LE dongle that I was using (expensive and state-of-the-art) was somehow not compatible (even though it works for other applications). I didn't have another to try and wasn't about to purchase one in case there actually were other issues causing the problem.
TForest-UwU commentedon Feb 27, 2023
If anyone is still having issues check out https://github.com/TForest-UwU/Switchy
I found out that atleast for me this api does not send the command properly, but it does connect nicely.
I then found another api that does the exact opposite, so i combined then into a working program
reestr commentedon Feb 28, 2023
@TForest-UwU - thank you for following up with this, despite reporting an error after each press of the switch, it works as expected! :-)