OpenWonderLabs / python-host

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

Documentation is too old to be understandable and need some review #42

Open BroZer8360 opened 1 year ago

BroZer8360 commented 1 year ago

Current Situation

I just bought a switchbot... And thought the API will be very quick to use but was not. Can you do a total review of your readme.md to make it more understandable to people, according to your code ?

Tooks many minutes to understand that :

As python3 script and basic python doesn't work really well on Rpi even following your step and review .o in dependant libraries.

And then, show to people how to get easily mac adresse without scanning with the app on the phone (with a screenshot for exemple).

Logs

$ sudo python switchbot.py <mac_adress> Turn On
Usage: "sudo python switchbot.py [mac dev_type cmd]" or "sudo python switchbot.py"
Preparing to connect.
Connection successful.
Unsupported operations
Complete

Configuration

Well all configuration is OK, this is a bug from documentation and message shown using the script, it's not the good command that is asked to.

Environment

Additional Context

No response

dcarrion87 commented 1 year ago

@BroZer8360 did you actually get it to work?

I'm on an RPi4 and although I can connect I am getting nothing but Invalid handle errors when firing commands. Even when using gattool directly. E.g.:

gatttool -t random -b XX:XX:XX:XX:XX:XX --char-write-req -a 0x0016 -n 570101
Characteristic Write Request failed: Invalid handle

Are you using an alternate external bluetooth adapter? Or any other settings you adjusted?

My bot is on firmware version 5.0.

BroZer8360 commented 1 year ago

Well what's your error message when you do : sudo python2 switchbot.py <mac_adress> Bot Turn On This example is for a Switch bot.

And no i'm using Rpi native bluetooth : i just review link for .o in my python lib but depends of error message and version of python2

dcarrion87 commented 1 year ago

I've stopped attempting to use this project and using this one instead: https://github.com/OpenWonderLabs/python-host/issues/43#issuecomment-1398950946