This hack describes everything you need to control the latest GoPro cameras including the new Hero 7 Black directly from the Solex app.
We are using the WiFi command hack of konradIT to control the GoPro via the un-official GoPro WiFi Interface. It provides a reference to all known commands and settings of the different generations of GoPro cameras and is the basis for this mod.
A word of caution before you proceed: All in the following described modifications require a great portion of care since we are modifying some of the core modules of the 3DR Solo software. It is strongly recommended to backup the gopromanager.py file on the IMX before making any changes.
GoPro and Solo are both broadcasting over 2.4 GHz wifi on separate channels. While I have not encountered any issues, it cannot be ruled out that interference could happen under certain circumstances. To eliminate possible interference with the GPS, use the 3DR V2 shield or even better the dedicated 3M EMI protection fabric to shield the GPS and Solo main board from the GoPro. Do NOT USE the stock copper shield or any cardboard mods. The 3M fabric can be purchased at e.g. mRobotics.
- Know how to SSH into Solo and to make modifications on the IMX installation and file system by using WinSCP (when you are on Windows) and PuTTY.
- Familiar with the Arduino IDE
- Knowledge on how to install Python packages
- Some C++ and Python programming skills
Compatible with GoPro Hero 5 Black and Hero 5 Session, Hero 6 Black and Hero 7 Black. All feature settings in Solex are supported. The software supports in addition the major cool features of the Hero 5, 6, and 7 models, such as video stabilization, linear mode, 4K60FPS, Timewarp, Superphoto, and so on. Note that such features are not (yet) accessible through Solex since some extensions to the current camera menus are needed.
- The software recognizes the camera model connected.
- You can hot-swap between up to 3 registered GoPro cameras w/o restarting Solo
- Voice output and text prompt on the connected camera model in Solex.
- GoPro will automatically turn on when Solo is powered on if the camera is in sleep mode
- GoPro battery monitoring in Solex. Since the battery of the camara is not being charged, you get voice feedback in Solex once the GoPro battery is getting low.
- Compatible with 3DR stock firmware, OpenSolo, black and green cube.
Note you must use the Solex app. The original 3DR App does not work with this mod.
The software-based video stabilization of the GoPro Hero 7 Black is awesome. While it doesn't substitute for a 3 axis gimbal, the smoothness around the tilt and yaw axis is incredible - see the example video below. So you can use the Hero 7 even with a hard mount and still get decent footage and pictures.
It is possible to mod the original 3DR Solo Gimbal to fit the newer Hero 6/6/7 cameras. The github repository links to a video which explains how to do this mod. Be aware however that modding the gimbal makes it unusable for the original Hero 4 or 3+. So only do that if you have a spare gimbal available.
We are using an Arduino MKR1000, the cheapest model with a built-in WiFi module.
First, attach the 3DR Solo Breakout board to the accessory bay. Instead of using a breakout board, you may also solder a micro USB jack to the corresponding pins of the accessory bay port. All pin attachments and wiring can be found in the 3DR Solo Dev Guide.
Next, bridge the 3DRID pin on the breakout board to GND to set the Solo IMX as USB host and then connect the Arduino to the USB connector on the breakout board.
To provide a visual status of the GoPro connection, we use two LEDs, connected to the A1 and A3 pins of the Arduino. Therefore solder a red LED to A1, and a green LED to the A3 pin. Make sure you use a 50-100 ohms resistor to avoid overload and subsequent damage of the LED and board.
The Arduino MKR1000 board then can be mounted with double-sided adhesive tape on top of the breakout board as shown on the image below.
The LEDs indicate the following states:
- Red and green LED off, green on board LED on: board is powered, waiting for Solo to finalize GoproManager initialization.
- Blinking red and green LED: wifi card error
- Solid red and no green LED: Initialized but no GoPro in range
- Solid red and solid green LED: connected to GoPro, trying to wake it up if in sleep mode
- Solid green and no red LED: connection to GoPro established.
- Solid green and flashing red LED: indicates data transfer from Solo to GoPro
Download the Arduino sketch from my Git (see Attachments section) and upload it into the Arduino IDE. You need the IDE version 1.8.8 or higher installed. Configure the Arduino MKR1000 board and add the following libraries:
- Wifi101 library,
- ArduinoJSON library 5.13.4
with the Arduino library manager tool.
Then add the Gopro SSID and password for up to three of your GoPros to the arduino_secrets.h file. Then upload the sketch.
B. Pymata Installation
We are using Firmata for the communication between the IMX / Python world and the Arduino. Therefore we need to install the Python implementation of Firmata, "Pymata" on the IMX. To install, take the following steps:
- Download the Pymata 2.1 code (link is in the "Things" section of this blog).
- Unzip the file and copy the PyMata-master directory to Solo root folder by using WinSCP.
- Open PuTTY and run this command in your SSH session:
cd ./PyMata-master/PyMata-master && python setup.py install
This is the result you should get:
For further details, there is a perfect description available by Daniel Nugent here on Hackster on how to setup and install Pymata on Solo.
Unfortunately, Solo is using Python 2.7 which limits us to the old Pymata 2 library and we cannot use the new Pymata-aio features which require Python 3.5+.
It is important that you go ahead with a version no later than 2.1 of Pymata. The newer versions require a different Python install method which is not supported by the Solo Python environment. You find version 2.1 in the Pymata Git referenced in the Things section.
C. Solo gopromanager Modifications
All necessary changes for the Gopro integration are included in the gopromanager.py file. This file is located in the /usr/bin directory of the IMX.
Backup the gopromanager file before you copy the modified file from the git (see link to the git in the Appendix section) to the IMX into the /usr/bin directory so that you can revert back in case something goes wrong. Steps to take:
- Download the gopromanager.py and goproconstants.py files from my Git (see Tools section) to your computer.
- SSH into Solo by using WinSCP (if you are on Windows), go to the /usr/bin directory and upload the new gopromanager.py and goproconstants.py files.
Note: by default, the new gopromanager tries to connect through the Arduino. If you want to switch back to standard functionality with a Hero 4 connected through the 3DR Gimbal, then set the constant:
SOLO_MOD = "GOPRO"
SOLO_MOD = ""
in the gopromanager.py file. Any edits to Python files should be done through a supporting Editor, such as Notepad++.
A current limitation is that Solo does not know the GoPro settings when we turn it on. Therefore, gopromanager assumes a default setting of your GoPro and you need to ensure that you have the following parameters at startup set in your GoPro5, 6 or 7 Black:
- Video mode at startup
- Video Resolution 1080p; FOV Linear, 50FPS, PAL
- Protune and low light: on
- Photo resolution 12MP linear
You may change those defaults of course in the gopromanager.py file as shown in the picture below. All other parameters will be used as set by default in your GoPro.
Don't forget to turn on your GoPro WiFi.
The newer GoPro models differ in several areas from the Hero 4. In order to get it working with the current Solex version, we set the GoPro model to a Hero 4, which causes that some settings are not accessible in the Solex menus:
- Newer video formats along with new frame rates and FOV settings and newer features like Linear, Hyperlapse, EIS, RAW are fully implemented but not yet accessible through Solex
- Whitebalance, ISO, Color, manual exposure settings (also never worked with the original software)
- The GoPro will not turn off automatically when you power-down Solo. (Current limitation is in the Arducopter code - may be fixed with AC3.7)
- The GoPro control will not work from the original 3DR App but required Solex.
The following video shows how it works and how the Hero 7 Black video stabilization performs compared to a fixed Hero 5 camera.
Enjoy and remember to always fly safe!