Controlling a GoPro via REST APIs
- 2 minutes read - 354 words“I recently ran across this post explaining how to hack your GoPro camera over wifi and thought it would be awesome to control my GoPro with my Amazon Echo. I imagined being able to set up a home security system that I could control with the power of my own voice.
Sadly, GoPro’s “API”, which is really more of a hacked http request, only works when directly connected to the camera via wifi. Technically you could connect the Echo to the GoPro’s wifi network, but I think without access to the internet, Alexa can’t read the custom “skills”. For more information on building you own Alexa “skill” using the SDK, check out my blog post.
Still, playing with the GoPro over wifi and the command line is fun, and can have some interesting uses. You could probably even control it with the Apple Watch or any other device with Wifi.
Here’s how to go about using it.
Connect to the GoPro’s wifi
Turn wifi on on the GoPro, typically on the device itself. Then connect to the wifi network, which is probably password protected. You’ll need the same password you use in the app.
You’ll lose internet connection now, but have access to the camera and it’s functionality.
The GoPro is always configured with a static ip address of 10.5.5.9. This makes is very easy to script the controls.
Command Line Control
Start with powering on the camera
You’ll need to put in your password (same as the wifi one) for some reason. Yes in clear text over http. Ok GoPro.
The next most basic command is controlling the shutter, for the default video mode, this starts recording. If in photo mode, this takes a picture.
curl -v -L -X GET “http://10.5.5.9/bacpac/SH?t=&p=%01”
You can then stop recording with
curl -v -L -X GET “http://10.5.5.9/bacpac/SH?t=&p=%00”
Change modes to the camera with
curl -v -L -X GET “http://10.5.5.9/camera/CM?t=&p=%01“
Then you can use the shutter commands to take pictures.
Lastly, shut the camera off:
curl -v -L -X GET “http://10.5.5.9/bacpac/PW?t=&p=%00”
Simple, no?
Now you are the master of your GoPro destiny!