Skip to content

Commit

Permalink
ready for version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aster94 committed Mar 26, 2019
1 parent 3fbc640 commit 35e1c5d
Show file tree
Hide file tree
Showing 9 changed files with 356 additions and 307 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Have you ever thought about the possibility to control your action camera with y
- HERO5
- HERO6
- HERO7
- Fusion
- FUSION

I made the library with a style which would be quite easy to add other cameras (not only GoPro). I would be very happy to accept pull requests 😃

Expand Down Expand Up @@ -153,9 +153,21 @@ I made the library with a style which would be quite easy to add other cameras (
| 3 || |
| 0 || |

**NOTE:** Not all the options are available for all the cameras (for example on a HERO3 you can't set 1080p at 240 frame per second 😲). You can see the possibilities on the manual of your camera of here for [HERO3](https://github.com/KonradIT/goprowifihack/blob/master/HERO3/Framerates-Resolutions.md) and here for [HERO4 and newer](https://github.com/KonradIT/goprowifihack/blob/master/HERO4/Framerates-Resolutions.md)

## To Do list and known issues

- Missing get status which gives info like mode (photo, video), fow and so on: [see here](https://github.com/KonradIT/goprowifihack/blob/master/HERO5/HERO5-Commands.md#gopro-hero5-commands-status-and-notes)
- Wait for the ESP32 core to make a stable BLE core, right now it has many issues, especially, if used together with wifi: [see here](https://github.com/espressif/arduino-esp32/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+ble)
- No confirm pairing for HERO4: [see here](https://github.com/KonradIT/goprowifihack/blob/master/HERO4/WifiCommands.md#code-pairing)
- Missing some modes for HERO4 and newer camera: [see here](https://github.com/KonradIT/goprowifihack/blob/master/HERO4/WifiCommands.md#secondary-modes)
- The arduino class String() could cause memory leaks (I never had problem yet), move to char array? 🤔
- `BSSID()` and `macAddress()` not perfectly compatible with arduino API: [see here](https://github.com/espressif/arduino-esp32/issues/2613)
- make gopro_mac_address field optional


## Reference

All the commands came from: https://github.com/KonradIT/goprowifihack

The idea cames from another gopro library: https://github.com/agdl/GoPRO which works only on arduino WiFi boards and only with gopro HERO3.
The idea of making a GoPro library for arduino comes from another library https://github.com/agdl/GoPRO which works only on arduino WiFi boards and only with GoPro HERO3.
207 changes: 106 additions & 101 deletions examples/ESP32_FreeRTOS/ESP32_FreeRTOS.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#include <GoProControl.h>
#include "Constants.h"

/*
Control your GoPro with the Serial Monitor: to start edit the file Constants.h and choose your camera
*/

// Choose your camera
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA); // use this if you have a HERO3 or older
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA, gopro_mac_address, BOARD_NAME);

char in = 0;

void setup()
{
gp.enableDebug(&Serial);
Expand All @@ -15,116 +17,119 @@ void setup()

void loop()
{
char in = 0;
if (Serial.available() > 0)
{
in = Serial.read();
//Serial.write(in);
}

switch (in)
{
default:
break;

// connect
case 'C':
gp.begin();
break;

// turn on/off
case 'T':
gp.turnOn();
break;

case 't':
gp.turnOff();
break;

// take a picture of start a video
case 'A':
gp.shoot();
break;

// stop the video
case 'S':
gp.stopShoot();
break;

//set modes
case 'V':
gp.setMode(VIDEO_MODE);
break;

case 'P':
gp.setMode(PHOTO_MODE);
break;

case 'M':
gp.setMode(MULTISHOT_MODE);
break;

// set orientation
case 'u':
gp.setOrientation(ORIENTATION_UP);
break;

case 'd':
gp.setOrientation(ORIENTATION_DOWN);
break;

case 'W':
gp.setVideoFov(MEDIUM_FOV);
break;

case 'E':
gp.setFrameRate(FR_120);
break;

case 'f':
gp.setPhotoResolution(PR_11MP_WIDE);
break;

case 'F':
gp.setVideoResolution(VR_1080p);
break;

case 'L':
gp.setTimeLapseInterval(60);
break;

case 'O':
gp.localizationOn();
break;

case 'I':
gp.localizationOff();
break;

case 'l':
gp.deleteLast();
break;

case 'D':
gp.deleteAll();
break;

case 'X':
gp.end();
break;

case 'p':
gp.printStatus();
break;
default:
break;

// Connect
case 'C':
gp.begin();
break;

// Turn on and off
case 'T':
gp.turnOn();
break;

case 't':
gp.turnOff();
break;

// Take a picture of start a video
case 'A':
gp.shoot();
break;

// Stop the video
case 'S':
gp.stopShoot();
break;

// Set modes
case 'V':
gp.setMode(VIDEO_MODE);
break;

case 'P':
gp.setMode(PHOTO_MODE);
break;

case 'M':
gp.setMode(MULTISHOT_MODE);
break;

// Change the orientation
case 'u':
gp.setOrientation(ORIENTATION_UP);
break;

case 'd':
gp.setOrientation(ORIENTATION_DOWN);
break;

// Change other parameters
case 'W':
gp.setVideoFov(MEDIUM_FOV);
break;

case 'E':
gp.setFrameRate(FR_120);
break;

case 'f':
gp.setPhotoResolution(PR_11MP_WIDE);
break;

case 'F':
gp.setVideoResolution(VR_1080p);
break;

case 'L':
gp.setTimeLapseInterval(60);
break;

// Localize the camera
case 'O':
gp.localizationOn();
break;

case 'I':
gp.localizationOff();
break;

// Delete some files, be carefull!
case 'l':
gp.deleteLast();
break;

case 'D':
gp.deleteAll();
break;

// Print useful data
case 'p':
gp.printStatus();
break;

// Close the connection
case 'X':
gp.end();
break;
}

in = 0;
}

void keep_alive(void *parameter)
{
while (gp.checkConnection(true)) {
while (1)
{
gp.keepAlive();
Serial.println("KeepAlive sent");
}
vTaskDelete( NULL );
}
vTaskDelete(NULL);
}
39 changes: 20 additions & 19 deletions examples/GoProControl/GoProControl.ino
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
#include <GoProControl.h>
#include "Constants.h"

/*
Control your GoPro with the Serial Monitor: to start edit the file Constants.h and choose your camera
*/

// Choose your camera
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA); // use this if you have a HERO3 or older
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA, gopro_mac_address, BOARD_NAME);

char in = 0;

void setup()
{
gp.enableDebug(&Serial);
}

void loop()
{
char in = 0;
if (Serial.available() > 0)
{
in = Serial.read();
//Serial.write(in);
}

switch (in)
{
default:
break;

// connect
// Connect
case 'C':
gp.begin();
break;

// turn on/off
// Turn on and off
case 'T':
gp.turnOn();
break;
Expand All @@ -39,17 +41,17 @@ void loop()
gp.turnOff();
break;

// take a picture of start a video
// Take a picture of start a video
case 'A':
gp.shoot();
break;

// stop the video
// Stop the video
case 'S':
gp.stopShoot();
break;

//set modes
// Set modes
case 'V':
gp.setMode(VIDEO_MODE);
break;
Expand All @@ -62,7 +64,7 @@ void loop()
gp.setMode(MULTISHOT_MODE);
break;

// set orientation
// Change the orientation
case 'u':
gp.setOrientation(ORIENTATION_UP);
break;
Expand All @@ -71,6 +73,7 @@ void loop()
gp.setOrientation(ORIENTATION_DOWN);
break;

// Change other parameters
case 'W':
gp.setVideoFov(MEDIUM_FOV);
break;
Expand All @@ -91,6 +94,7 @@ void loop()
gp.setTimeLapseInterval(60);
break;

// Localize the camera
case 'O':
gp.localizationOn();
break;
Expand All @@ -99,6 +103,7 @@ void loop()
gp.localizationOff();
break;

// Delete some files, be carefull!
case 'l':
gp.deleteLast();
break;
Expand All @@ -107,19 +112,15 @@ void loop()
gp.deleteAll();
break;

case 'X':
gp.end();
break;

// Print useful data
case 'p':
gp.printStatus();
break;

case 'K':
gp.keepAlive();
// Close the connection
case 'X':
gp.end();
break;
}

in = 0;
gp.keepAlive();
}
gp.keepAlive(); // not needed on HERO3
}
Loading

0 comments on commit 35e1c5d

Please sign in to comment.