Skip to content

Instantly share code, notes, and snippets.

@samdbmg
Created August 18, 2016 10:49
Show Gist options
  • Save samdbmg/c1745e07a7feb61f58ad595d0fa720f2 to your computer and use it in GitHub Desktop.
Save samdbmg/c1745e07a7feb61f58ad595d0fa720f2 to your computer and use it in GitHub Desktop.
Configure multiple GoPro Hero4's over wifi (for 360 balls etc)
#!/bin/bash
# Requires goproctl from https://github.com/joshvillbrandt/goprohero
# Expects ssid and password as arguments
# Settings from https://github.com/KonradIT/goprowifihack/blob/master/HERO4/WifiCommands.md
function set_camera {
if [ -e /tmp/gperr ];
then
rm /tmp/gperr
fi
# Connect to wifi network
goproctl $1 $2 status s 1>/dev/null 2>/tmp/gperr
# Confirm we actually connected to a GoPro
if grep -q "Network is unreachable" /tmp/gperr;
then
echo "Failed to connect to $1"
cat /tmp/gperr
rm /tmp/gperr
return
fi
# Configure the camera
echo "Configuring $1"
# Set video primary and video sub-mode
wget -q http://10.5.5.9/gp/gpControl/command/mode?p=0 -O /dev/null
wget -q "http://10.5.5.9/gp/gpControl/command/sub_mode?mode=0&sub_mode=0" -O /dev/null
# Set ProTune on
wget -q http://10.5.5.9/gp/gpControl/setting/10/1 -O /dev/null
# Resolution: 1440p
wget -q http://10.5.5.9/gp/gpControl/setting/2/7 -O /dev/null
# White Balance (1 = 3000K, 2 = 5500K, 3 = 6500K)
wget -q http://10.5.5.9/gp/gpControl/setting/11/1 -O /dev/null
# FOV (0 = Wide, 1 = Med, 2 = Narrow)
wget -q http://10.5.5.9/gp/gpControl/setting/4/0 -O /dev/null
# Color (0 = GOPRO, 1 = FLAT)
wget -q http://10.5.5.9/gp/gpControl/setting/12/1 -O /dev/null
# ISO (0 = 6400, 1 = 1600, 2 = 400)
wget -q http://10.5.5.9/gp/gpControl/setting/13/1 -O /dev/null
# Sharpness (2 = Low, 1 = Med, 0 = High)
wget -q http://10.5.5.9/gp/gpControl/setting/14/2 -O /dev/null
# EV (4 = +0, lower numbers increase by 0.5 steps, higher decrease)
wget -q http://10.5.5.9/gp/gpControl/setting/15/4 -O /dev/null
# Frame Rate (8 = 30fps, 5 = 60fps)
wget -q http://10.5.5.9/gp/gpControl/setting/3/8 -O /dev/null
# Low light off
wget -q http://10.5.5.9/gp/gpControl/setting/8/0 -O /dev/null
# Spot meter off
wget -q http://10.5.5.9/gp/gpControl/setting/9/0 -O /dev/null
# Orientation Up
wget -q http://10.5.5.9/gp/gpControl/setting/52/1 -O /dev/null
# Quick Capture Off
wget -q http://10.5.5.9/gp/gpControl/setting/54/0 -O /dev/null
# Beeps off
wget -q http://10.5.5.9/gp/gpControl/setting/56/2 -O /dev/null
# Video = NTSC
wget -q http://10.5.5.9/gp/gpControl/setting/57/0 -O /dev/null
# Auto off = Never
wget -q http://10.5.5.9/gp/gpControl/setting/59/0 -O /dev/null
# LED Mode (1 = "2", 2 = "4", 0 = "Off")
wget -q http://10.5.5.9/gp/gpControl/setting/55/2 -O /dev/null
# Dump out the camera setup
#goproctl $1 $2 status s
}
set_camera "camera1" "password1"
set_camera "camera2" "password2"
set_camera "camera3" "password3"
set_camera "camera4" "password4"
set_camera "camera5" "password5"
set_camera "camera6" "password6"
#!/bin/bash
# Requires goproctl from https://github.com/joshvillbrandt/goprohero
# Expects ssid and password as arguments
# Settings from https://github.com/KonradIT/goprowifihack/blob/master/HERO4/WifiCommands.md
function wipe_camera {
if [ -e /tmp/gperr ];
then
rm /tmp/gperr
fi
# Connect to wifi network
goproctl $1 $2 status s 1>/dev/null 2>/tmp/gperr
# Confirm we actually connected to a GoPro
if grep -q "Network is unreachable" /tmp/gperr;
then
echo "Failed to connect to $1"
cat /tmp/gperr
rm /tmp/gperr
return
fi
# Wipe the camera
echo "Wiping $1"
wget -q http://10.5.5.9/gp/gpControl/command/storage/delete/all -O /dev/null
}
read -p "Are you sure? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
wipe_camera "camera1" "password1"
wipe_camera "camera2" "password2"
wipe_camera "camera3" "password3"
wipe_camera "camera4" "password4"
wipe_camera "camera5" "password5"
wipe_camera "camera6" "password6"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment