Python Bluetooth controller for GoPro cameras with BLE connection
Python Bluetooth controller for GoPro cameras starting from the HERO5 Black (successfully tested with the HERO5 Black, HERO6 Black, HERO7 Black, MAX, HERO9 Black)
GoPro released a proper BLE documentation over at opengopro and it matches what I've reverse engineered in the past. But they've done so much stuff I missed, such as getting the status of the camera and doing Protobuf decoding. Their examples are extremely well programmed too.
Enable Wireless Connections on the GoPro and go to connect > connect new > GoPro APP
Then connect your device to the camera via Bluetooth.
On Windows, make sure when you connect to wait for the PC to successfully pair with the camera:
The camera should return to the last mode and exit the pairing screen.
Then run:
python main.py
Then enter the commands.
>> record start
[recv] ...
Commands available:
Settings are parsed as constant strings from my library gopro-py-api.
Settings available:
Pass a list of Bluetooth MAC addresses in the --address
parameter to control multiple cameras.
By default this script runs in interactive mode, but to control camera aspects via the command line or a bash script pass --address
and/or --command
Commands can be passed using the --command
parameter (multi camera supported)
python .\main.py --verbose --address "XX:XX:XX:XX:XX:XX" --command "record start"
python .\main.py --verbose --address "XX:XX:XX:XX:XX:XX" --command "wifi on"
It relied on gatt
library and bluetooth
library, and it was a PITA to work on and install. I decided to move to bleak
which works perfectly on Windows and Raspbian.
https://github.com/KonradIT/goprowifihack/blob/master/Bluetooth/Platforms/RaspberryPi.md
https://gethypoxic.com/blogs/technical/gopro-hero5-interfaces