Camera Tools Command Server

The Camera Tools for GoPro Heros app allows you control multiple GoPro® cameras. The command server is a part of the Camera Tools app and allows you to control the app and cameras via HTTP commands by sending JSON commands to the server. This document describes all available commands.

Note: On Android and iOS scripting works only while the app is running in foreground and while the screen in on.

Camera Tools for Heros - ToolsForGoPro.com

Get the camera status

This command gets general and status information of the camera(s).

Request:
{
	"command": "cameraStatus",
	"cameras": ["GP123456"]
}

Note: Leave the "cameras" variable empty if you want to query the status of all cameras.

Response:
{
	"command": "cameraStatus",
	"cameras":
	[
		{
			"name": "GP123456",
			"model": "Hero 8",
			"bluetooth_status": "connected",
			"wifi_ssid": "GP123456",
			"wifi_password": "password1234",
			"camera_recording": false,
			"live_streaming": "idle",
			"preset_id": 1234,
			"camera_mode": 1000,
			"camera_submode": 0,
			"recording_time": "00:14",
			"remaining_photos": 102,
			"remaining_space": 1000000,
			"remaining_recording_time": 1324324,
			"charger_attached": true,
			"battery_level": 99
		}
	]
}			

Update current WiFi information

This command queries the currently connected WiFi name from the system. The result can later be read using the getCurrentWiFiSSID command.

Request:
{
	"command": "queryCurrentWiFiSSIDAsync"
}
Response:
{
	"command": "queryCurrentWiFiSSIDAsync"
}

Get current WiFi SSID

This command returns the WiFi name from the last queryCurrentWiFiSSIDAsync query.

Request:
{
	"command": "getCurrentWiFiSSID"
}
Response:
{
	"command": "getCurrentWiFiSSID",
	"ssid": "wifi_name",
	"message": "Optional error message.",
	"last_updated": "2020-01-20T14:11:25"
}

Connect to a WiFi network

This command connects to the WiFi network using the given credentials.

Request:
{
	"command": "connectToWiFiAsync",
	"ssid": "GP123456",
	"password": "password1234"
}
Response:
{
	"command": "connectToWiFiAsync"
}

Connect to a camera WiFi network

This command connects to the given camera's WiFi network.

Request:
{
	"command": "connectToCameraWiFiAsync",
	"camera": "GP123456"
}
Response:
{
	"command": "connectToCameraWiFiAsync"
}

Query the media list

This command loads the list of media files from the camera. The command requires an active WiFi connection to the camera (e.g. using connectToCameraWiFiAsync). The result can be later read with the getMediaList command.

Request:
{
	"command": "queryMediaListAsync",
	"camera": "GP123456"
}
Response:
{
	"command": "queryMediaListAsync",
	"message": "Optional error message."
}

Get the status of the last media query

This command gets the status of the last queryMediaListAsync call.

Request:
{
	"command": "getMediaQueryStatus"
}
Response:
{
	"command": "getMediaQueryStatus",
	"status": "idle"
}

Get media list

This command returns the last media list for the given cameras queried by queryMediaListAsync command.

Request:
{
	"command": "getMediaList",
	"camera": "GP123456"
}
Response:
{
	"command": "getMediaList",
	"camera": "GP123456",
	"media": 
	[
		{
			"filename": "image.jpg",
			"url": "http://10.5.5.9/DCIM/image.jpg",
			"date": "2020-01-20T14:11:25",
			"size": 123000023
		}
	]
}

Delete media from the camera

This command deletes media files from the camera. The command requires an active WiFi connection to the camera (e.g. using connectToCameraWiFiAsync).

Request:
{
	"command": "deleteMediaAsync",
	"camera": "GP123456",
	"media":
	[
		"100GOPRO/GOPR0573.JPG", "100GOPRO/GOPR0574.JPG"
	]
}
Response:
{
	"command": "deleteMediaAsync",
	"message": "Optional error message."
}

Send camera command

This command sends a specific command to the camera. The following commands are available:

  • connectToCamera: Connects to the camera(s) via Bluetooth.
  • disconnectFromCamera: Disconnects from the camera(s).
  • sleepCamera: Sends the camera(s) into sleeping state.
  • startRecording: Starts recording.
  • stopRecording: Stops recording.
  • tagMoment: Tags the moment.
  • enableWiFi: Enables the camera(s)' WiFi (without connecting to the WiFi!).
  • disableWiFi: Disables the camera(s)' WiFi.
  • startLivePreviewMode: Starts the live preview mode on one camera (this requires an active WiFi connection to the camera!). The live preview video can then be streamed with ffmpeg or other tools.
  • stopLivePreviewMode: Stops the live preview mode on one camera (this requires an active WiFi connection to the camera!).
Request:
{
	"command": "sendCameraCommand",
	"cameras": ["GP123456"],
	"cameraCommand": "startRecording"
}
Response:
{
	"command": "sendCameraCommand",
	"message": "Optional error message."
}

Get a list of camera modes and presets

This command returns a list of supported camera modes, sub-modes (pre Hero 8), and presets (Hero 8 and newer).

Request:
{
	"command": "getCameraModes",
	"camera": "GP123456"
}
Response:
{
	"command": "getCameraModes",
	"camera": "GP123456",
	"modes": 
	[
		{
			"name": "VIDEO",
			"key": "1000",
			"submodes": 
			[
				{
					"name": "looping",
					"key": "1"
				}
			],
			"presets": 
			[
				{
					"name": "Default",
					"key": "0"
				}
			]
		}
	]
}

Set the camera mode group

This command sets the camera mode group (e.g. video, photo, ...).

Request:
{
	"command": "setCameraMode",
	"camera": "GP123456",
	"mode_key": 1000
}
Response:
{
	"command": "setCameraMode",
	"camera": "GP123456",
	"message": "Optional error message."
}

Set the camera sub-mode

This command sets the camera sub-mode (e.g. looping, burst, ...). This command is only intended for Hero 7 and older models.

Request:
{
	"command": "setCameraSubMode",
	"camera": "GP123456",
	"submode_key": 0
}
Response:
{
	"command": "setCameraSubMode",
	"camera": "GP123456",
	"message": "Optional error message."
}

Set the camera preset

This command sets the camera preset (e.g. standard, activity, ...). This command is only intended for Hero 8 and newer models.

Request:
{
	"command": "setCameraPreset",
	"camera": "GP123456",
	"preset_key": 0
}
Response:
{
	"command": "setCameraPreset",
	"camera": "GP123456",
	"message": "Optional error message."
}

Get a list available settings

This command returns a list of all currently available settings for the given camera. Note: The available settings change dynamically.

Request:
{
	"command": "getCameraSettings",
	"camera": "GP123456"
}
Response:
{
	"command": "getCameraSettings",
	"camera": "GP123456",
	"settings": 
	[
		{
			"name": "Resolution",
			"key": "22",
			"values": 
			[
				{
					"name": "1080p",
					"value": "0"
				},
				{
					"name": "720p",
					"value": "1"
				}
			]
		}
	]
}

Change a camera setting value

This command changes settings on the camera.

Request:
{
	"command": "setCameraSetting",
	"camera": "GP123456",
	"setting_key": 22,
	"setting_value": 1
}
Response:
{
	"command": "setCameraSetting",
	"camera": "GP123456",
	"message": "Optional error message."
}