Posted on

List of GoPro Hero 4 I2C Commands

Hero 4 has a new I2C command set incompatible with old Hero 3+ Black. This post gives a demonstration of controlling a standalone Hero 4 camera from Arduino Monitor.

Here is the list of the commands for Hero 4. You can send these commands from your PC’s terminal or Arduino Monitor to MewPro 2 (or MewPro Cable) board or MewPro Iliad through the default UART lines.


Prerequisites

In order to use MewPro 2 as a GoPro Hero 4 controller you need the following hardwares:

GoPro Hero 4 Black/Silver
NOTE: Hero 3+ Black is supported by a different software: Please refer this post.
MewPro 2
MewPro 2 is ready to use without soldering.
Arduino Pro Mini Temporary FTDI Header
If you buy a MewPro 2 from our shop the header is included in the package.
Sparkfun FTDI Basic Breakout – 3.3V and USB cable
Use 3.3V version of the breakout board. Any compatible board should work.

Softwares:

MewPro 2 is shipped with optiboot as well as MewPro4 software for genlock installed. If you like to modify/update the software you will need to prepare the following IDE and core. To install each software please refer their documentations.

Arduino IDE 1.6.12 or newer
Older versions of Arduino IDE might work but we don’t confirm that.
ATTiny Core
1634, x313, x4, x41, x5, x61, x7, x8 and 828 for Arduino 1.6.x

Lastly grab the MewPro4 application:

MewPro4 application
This is an open source software (MIT license). You can modify and distribute it as you like.

Connection

On your PC launch Arduino IDE that was installed as described in the above. In Arduino IDE [File]→[Open...]→ then open MewPro4.ino.

Connect MewPro 2
connection2

to your PC w/ FTDI board and the temporary header.
conne2

Connecting FTDI please refer the pinout image below:
MewPro2

Then connect them to GoPro Hero 4 Black/Silver (The photo below is stolen from our old blog post and connecting to Hero 3+ Black, but I think you will understand where you should connect to. 🙂 ).
conne1

In Arduino IDE application, select [Tools]→[Board]→[ATTiny1634 (optiboot)] and [Tools]→[Port]→[(the port where you connected the FTDI cable)]. (B.O.D. and Clock settings are “don’t care” as these values are only effective when you burn a bootloader to the microcontroller by using an ISP programmer.)

The MewPro4 source code is originally targeted to users with multiple cameras, so for standalone usage please edit/change the following line in MewPro.h at line 8

...
// undef if MewPro 2 board is used as standalone
#define USE_GENLOCK
...

to

...
// undef if MewPro 2 board is used as standalone
#undef USE_GENLOCK
...

Now you are ready to compile/upload the source code. Click on “check mark” icon at the top left of Arduino IDE window compiles the code. And “Right arrow” icon at the right next uploads the compiled binary to MewPro 2 board.

If you like to use a time alarm function MewPro4 source code has such an example included. In this case you must download Time and TimeAlarms libraries from PJRC site, modify the line #undef USE_TIME_ALARMS in MewPro.h to #define USE_TIME_ALARMS, and also remove two comment-outs ‘//’ located at these two lines:

#include <TimeLib.h> // *** please comment out this line if USE_TIME_ALARMS is not defined ***
#include <TimeAlarms.h> // *** please comment out this line if USE_TIME_ALARMS is not defined ***

Then edit d_TimeAlarms.ino to set your alarms.


Controlling Standalone Hero 4 from Arduino Monitor

Open “Serial Monitor” in Arduino IDE window (click the the top right “magnifier” icon). Set [57600 baud] using the bottom right pulldown, [Newline] the middle pulldown, [Autoscroll] the left box checked.

screen-shot-2017-02-25-at-18-09-17
Type ‘@‘ (one letter representing at sign) in the input area of Serial Monitor, and hit return key.

screen-shot-2017-02-25-at-18-09-37
The message “camera power on” is shown and your GoPro Hero 4 turned its power on.

The messages on “Serial Monitor” shows communication details between Arduino and GoPro. And now you can type in any of I2C commands found in “List of GoPro Hero 4 I2C Commands“.

screen-shot-2017-02-25-at-18-11-59
Try typing “YY000101000100” (change camera mode to video) and hit return key unless your camera is in video mode. Then type “YY00021B0000” (and hit return) and “YY00021C0000” (and hit return). (Start recording! Stop recording!!)

If you finished type “ZZ00030101” (and hit return). (This should power off your GoPro Hero 4.)

Enjoy!


Resources

Posted on

Migrating from Hero 3+ Black to Hero 4

An old genlock rig using MewPro 2 with Hero 3+ Black and Genlock Dongle can be upgraded to Hero 4. The post explains migrating from Hero 3+ Black to Hero 4.

Example Rig Migration

Suppose you have a 6-camera rig that consists of

  • 6 GoPro Hero 3+ Black cameras
  • 5 MewPro 2 boards
  • 1 GoPro Dual Hero
  • 1 Genlock Dongle

and these are connected in single dongle configuration:

Single Dongle Configuration for 6 Hero 3+ Blacks
Single Dongle Configuration for 6 Hero 3+ Blacks

Then the GoPro Dual Hero bacpac and the Genlock dongle are not necessary from now on. And now you’ll need one more MewPro 2 board and one MewPro Iliad as well as 6 Hero 4 (Black or Silver) cameras.

Remove the Dual Hero bacpac and the Dongle from your rig. Replace Hero 3+ Black to Hero 4. Burn the “MewPro4” software (https://github.com/orangkucing/MewPro4) to MewPro 2 boards.
migrate3bto4-inter

The connection to each MewPro 2 board is the same as in single dongle configuration, however, TRIG signal is not used for Hero 4. And since Hero 4 can be fed power from side USB or herobus and works without internal battery the spare wire previously used for TRIG can be reused to connect 3.3V power from Iliad to each MewPro 2 board.

Upgraded Rig

After connecting Iliad to MewPro 2 boards the upgraded sytem is like this:
migrate3bto4-after

Enjoy!

Posted on

Hero 4 Power Supply

In order to avoid camera’s overheat Hero 4 had better be fed with external five volt source and use without internal battery. This post enumerates ways of power supply in MewPro + Iliad system.

Note: If your cameras are located in rather remote places then please avoid ground loop. For good explanation on ground loop and its potential danger, common mode current see this article “What should I do to avoid accidental damage to the device?” written by an engineer of a famous USB logic analyser Saleae.

Ways of Power Supply

The following shows each component (camera, MewPro, and Iliad) is fed with, wiring MewPro board, and remarks.

(Warning: If all cameras and Iliad are powered by one big battery or one wall charger then please notice that there are ground loops. As ground loop itself is not harm, however, care should be taken to avoid accidental large common mode current. It is suggested that you’d better remove GND connection at each MewPro’s RJ45 connector in this case for getting around this.)

Power ON = auto” means a long press of the mode button at Iliad makes camera’s power on. Similarly, “Power OFF = auto” means off.

Power ON = manual” is a special case where we currently can’t power on using Iliad. We don’t know the reason why we can’t and it’s a shame, however, we gave up further experiment on the power method after several days of fruitless effort followed by nearly ruining/burning a Hero 4 Black by carelessly connecting a wrong power line. In this case we can power on cameras as in the following steps:

  1. Connect all cables and wires but power lines. Attach MewPro’s to cameras.
  2. Connect USB wallcharger or battery pack to Iliad (or DC 7-12V to Iliad’s barrel jack).
  3. Apply 5V to USB VBUS pin of MewPro 2 board.
  4. Power on each camera by manually long press camera’s mode button.
  5. Long press Iliad’s mode button

Power on this way also syncs all the settings stored in Iliad.

UPDATE 2 Dec 2016: A workaround is found for the last annoying case of “Power ON = manual“. By using a paper clip (see photo below) or scotch tape or something we can fix camera’s mode button to ON state.
_mg_2762-copy
Then the camera’s power can be controlled by applying 5V to USB VBUS pin. And once the camera powered on then Iliad can control everything of it. The trick is that button “press” is actually recognized by the camera when the button is “released” while “long press” is recognized by its pushed state.

Our recommended power supply method is the connection depicted in Table 2. If you order plug-n-play tailor made sets in our shop then we will use this wiring.

Legends

Table 1
MewPro 2 Iliad
GND GND
VSYNC VSYNC
HSYNC HSYNC
RESET RST
RXI TXO
Table 2
MewPro 2 Iliad
GND GND
VSYNC VSYNC
HSYNC HSYNC
RESET RST
RXI TXO
VCC 3V3
Table 3
MewPro 2 Iliad
GND GND
VSYNC VSYNC
HSYNC HSYNC
RESET RST
RXI TXO
VCC 3V3
USB VBUS *

*: USB VBUS as well as GND is connected to external 5V power supply. It must be “good” source as each camera requires 1A or less while recording.