Skip to content

Commit 35e1c5d

Browse files
committed
ready for version 1.0.0
1 parent 3fbc640 commit 35e1c5d

File tree

9 files changed

+356
-307
lines changed

9 files changed

+356
-307
lines changed

README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Have you ever thought about the possibility to control your action camera with y
4242
- HERO5
4343
- HERO6
4444
- HERO7
45-
- Fusion
45+
- FUSION
4646

4747
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 😃
4848

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

156+
**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)
157+
158+
## To Do list and known issues
159+
160+
- 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)
161+
- 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)
162+
- No confirm pairing for HERO4: [see here](https://github.com/KonradIT/goprowifihack/blob/master/HERO4/WifiCommands.md#code-pairing)
163+
- Missing some modes for HERO4 and newer camera: [see here](https://github.com/KonradIT/goprowifihack/blob/master/HERO4/WifiCommands.md#secondary-modes)
164+
- The arduino class String() could cause memory leaks (I never had problem yet), move to char array? 🤔
165+
- `BSSID()` and `macAddress()` not perfectly compatible with arduino API: [see here](https://github.com/espressif/arduino-esp32/issues/2613)
166+
- make gopro_mac_address field optional
167+
156168

157169
## Reference
158170

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

161-
The idea cames from another gopro library: https://github.com/agdl/GoPRO which works only on arduino WiFi boards and only with gopro HERO3.
173+
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.
+106-101
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#include <GoProControl.h>
22
#include "Constants.h"
33

4+
/*
5+
Control your GoPro with the Serial Monitor: to start edit the file Constants.h and choose your camera
6+
*/
7+
48
// Choose your camera
59
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA); // use this if you have a HERO3 or older
610
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA, gopro_mac_address, BOARD_NAME);
711

8-
char in = 0;
9-
1012
void setup()
1113
{
1214
gp.enableDebug(&Serial);
@@ -15,116 +17,119 @@ void setup()
1517

1618
void loop()
1719
{
20+
char in = 0;
1821
if (Serial.available() > 0)
1922
{
2023
in = Serial.read();
21-
//Serial.write(in);
2224
}
2325

2426
switch (in)
2527
{
26-
default:
27-
break;
28-
29-
// connect
30-
case 'C':
31-
gp.begin();
32-
break;
33-
34-
// turn on/off
35-
case 'T':
36-
gp.turnOn();
37-
break;
38-
39-
case 't':
40-
gp.turnOff();
41-
break;
42-
43-
// take a picture of start a video
44-
case 'A':
45-
gp.shoot();
46-
break;
47-
48-
// stop the video
49-
case 'S':
50-
gp.stopShoot();
51-
break;
52-
53-
//set modes
54-
case 'V':
55-
gp.setMode(VIDEO_MODE);
56-
break;
57-
58-
case 'P':
59-
gp.setMode(PHOTO_MODE);
60-
break;
61-
62-
case 'M':
63-
gp.setMode(MULTISHOT_MODE);
64-
break;
65-
66-
// set orientation
67-
case 'u':
68-
gp.setOrientation(ORIENTATION_UP);
69-
break;
70-
71-
case 'd':
72-
gp.setOrientation(ORIENTATION_DOWN);
73-
break;
74-
75-
case 'W':
76-
gp.setVideoFov(MEDIUM_FOV);
77-
break;
78-
79-
case 'E':
80-
gp.setFrameRate(FR_120);
81-
break;
82-
83-
case 'f':
84-
gp.setPhotoResolution(PR_11MP_WIDE);
85-
break;
86-
87-
case 'F':
88-
gp.setVideoResolution(VR_1080p);
89-
break;
90-
91-
case 'L':
92-
gp.setTimeLapseInterval(60);
93-
break;
94-
95-
case 'O':
96-
gp.localizationOn();
97-
break;
98-
99-
case 'I':
100-
gp.localizationOff();
101-
break;
102-
103-
case 'l':
104-
gp.deleteLast();
105-
break;
106-
107-
case 'D':
108-
gp.deleteAll();
109-
break;
110-
111-
case 'X':
112-
gp.end();
113-
break;
114-
115-
case 'p':
116-
gp.printStatus();
117-
break;
28+
default:
29+
break;
30+
31+
// Connect
32+
case 'C':
33+
gp.begin();
34+
break;
35+
36+
// Turn on and off
37+
case 'T':
38+
gp.turnOn();
39+
break;
40+
41+
case 't':
42+
gp.turnOff();
43+
break;
44+
45+
// Take a picture of start a video
46+
case 'A':
47+
gp.shoot();
48+
break;
49+
50+
// Stop the video
51+
case 'S':
52+
gp.stopShoot();
53+
break;
54+
55+
// Set modes
56+
case 'V':
57+
gp.setMode(VIDEO_MODE);
58+
break;
59+
60+
case 'P':
61+
gp.setMode(PHOTO_MODE);
62+
break;
63+
64+
case 'M':
65+
gp.setMode(MULTISHOT_MODE);
66+
break;
67+
68+
// Change the orientation
69+
case 'u':
70+
gp.setOrientation(ORIENTATION_UP);
71+
break;
72+
73+
case 'd':
74+
gp.setOrientation(ORIENTATION_DOWN);
75+
break;
76+
77+
// Change other parameters
78+
case 'W':
79+
gp.setVideoFov(MEDIUM_FOV);
80+
break;
81+
82+
case 'E':
83+
gp.setFrameRate(FR_120);
84+
break;
85+
86+
case 'f':
87+
gp.setPhotoResolution(PR_11MP_WIDE);
88+
break;
89+
90+
case 'F':
91+
gp.setVideoResolution(VR_1080p);
92+
break;
93+
94+
case 'L':
95+
gp.setTimeLapseInterval(60);
96+
break;
97+
98+
// Localize the camera
99+
case 'O':
100+
gp.localizationOn();
101+
break;
102+
103+
case 'I':
104+
gp.localizationOff();
105+
break;
106+
107+
// Delete some files, be carefull!
108+
case 'l':
109+
gp.deleteLast();
110+
break;
111+
112+
case 'D':
113+
gp.deleteAll();
114+
break;
115+
116+
// Print useful data
117+
case 'p':
118+
gp.printStatus();
119+
break;
120+
121+
// Close the connection
122+
case 'X':
123+
gp.end();
124+
break;
118125
}
119-
120-
in = 0;
121126
}
122127

123128
void keep_alive(void *parameter)
124129
{
125-
while (gp.checkConnection(true)) {
130+
while (1)
131+
{
126132
gp.keepAlive();
127-
Serial.println("KeepAlive sent");
128133
}
129-
vTaskDelete( NULL );
130-
}
134+
vTaskDelete(NULL);
135+
}

examples/GoProControl/GoProControl.ino

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
#include <GoProControl.h>
22
#include "Constants.h"
33

4+
/*
5+
Control your GoPro with the Serial Monitor: to start edit the file Constants.h and choose your camera
6+
*/
7+
48
// Choose your camera
59
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA); // use this if you have a HERO3 or older
610
//GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA, gopro_mac_address, BOARD_NAME);
711

8-
char in = 0;
9-
1012
void setup()
1113
{
1214
gp.enableDebug(&Serial);
1315
}
1416

1517
void loop()
1618
{
19+
char in = 0;
1720
if (Serial.available() > 0)
1821
{
1922
in = Serial.read();
20-
//Serial.write(in);
2123
}
2224

2325
switch (in)
2426
{
2527
default:
2628
break;
2729

28-
// connect
30+
// Connect
2931
case 'C':
3032
gp.begin();
3133
break;
3234

33-
// turn on/off
35+
// Turn on and off
3436
case 'T':
3537
gp.turnOn();
3638
break;
@@ -39,17 +41,17 @@ void loop()
3941
gp.turnOff();
4042
break;
4143

42-
// take a picture of start a video
44+
// Take a picture of start a video
4345
case 'A':
4446
gp.shoot();
4547
break;
4648

47-
// stop the video
49+
// Stop the video
4850
case 'S':
4951
gp.stopShoot();
5052
break;
5153

52-
//set modes
54+
// Set modes
5355
case 'V':
5456
gp.setMode(VIDEO_MODE);
5557
break;
@@ -62,7 +64,7 @@ void loop()
6264
gp.setMode(MULTISHOT_MODE);
6365
break;
6466

65-
// set orientation
67+
// Change the orientation
6668
case 'u':
6769
gp.setOrientation(ORIENTATION_UP);
6870
break;
@@ -71,6 +73,7 @@ void loop()
7173
gp.setOrientation(ORIENTATION_DOWN);
7274
break;
7375

76+
// Change other parameters
7477
case 'W':
7578
gp.setVideoFov(MEDIUM_FOV);
7679
break;
@@ -91,6 +94,7 @@ void loop()
9194
gp.setTimeLapseInterval(60);
9295
break;
9396

97+
// Localize the camera
9498
case 'O':
9599
gp.localizationOn();
96100
break;
@@ -99,6 +103,7 @@ void loop()
99103
gp.localizationOff();
100104
break;
101105

106+
// Delete some files, be carefull!
102107
case 'l':
103108
gp.deleteLast();
104109
break;
@@ -107,19 +112,15 @@ void loop()
107112
gp.deleteAll();
108113
break;
109114

110-
case 'X':
111-
gp.end();
112-
break;
113-
115+
// Print useful data
114116
case 'p':
115117
gp.printStatus();
116118
break;
117119

118-
case 'K':
119-
gp.keepAlive();
120+
// Close the connection
121+
case 'X':
122+
gp.end();
120123
break;
121124
}
122-
123-
in = 0;
124-
gp.keepAlive();
125-
}
125+
gp.keepAlive(); // not needed on HERO3
126+
}

0 commit comments

Comments
 (0)