aster94 / goprocontrol Goto Github PK
View Code? Open in Web Editor NEWArduino library to interface with GoPro cameras
License: GNU General Public License v3.0
Arduino library to interface with GoPro cameras
License: GNU General Public License v3.0
I saw this comment "ESP8266 can't get the BSSID of the camera. So if you want to turn it on you need to manually pass it to the constructor, see the docs" but how do I get it to work and how to get the BSSID form the camera and where to put that information.
My goal is to control a fleet of Hero 8 Black cameras with more reliability and control than the GoPro smart remote. Right now I'm just trying to control a single camera.
I've changed the GoPro's band to 2.4GHz, and entered the camera name and password in the GOPRO_SSID
and GOPRO_PASS
fields in secrets.h respectively.
With the GoProControl.ino
example, when connecting via b
command, the connection times out and I get a Connection failed with status: 6
message.
I've tried on both an ESP8266 module as well as an ESP32 module.
Has this library been tested on a Hero 8, or just speculated working (based on the API being compatible with the Hero 8)?
Any help debugging this would be appreciated. Thanks!
Hi,
Thanks for this library, I had written a remote for my Gopro MAX but stopped using it for a while and now it does not connect anymore, it always fail with code 6 or 5. Thought I try your example but got stuck in the same place, it just won't connect... SSID and PWD are correct, but the camera just ignores any connection. Thought I ask if maybe you know of any new trick needed by Gopro. I suspect you would need to go through Bluetooth first...
Thanks a lot!
Cant connect to my camera - always the same error
After C command -
Attempting to connect to SSID: ALLGP001
using password: bike7632
....................
Connection failed with status: 6
My Constants.h -
#ifndef CONSTANTS_H
#define CONSTANTS_H
// replace the following:
#define GOPRO_SSID "ALLGP001"
#define GOPRO_PASS "bike7632"
#define CAMERA HERO5 // your HERO model
uint8_t gopro_mac_address[6]= {246,221,158,229,124,140}; // the MAC address of your GoPro
#endif
Board
Node MCU v3
What can I do ?
Regards - Robert
Hi, using your latest lib with a gopro8 I'm getting "Connection failed with status: 6" and after pressing "b" for some more time "Connection failed with status: 1"
I couldnt find hints about this errors in the documentation. Could you help me to find a solution?
Hi
I am very new to Github, Arduino and WiFi. Sorry in advance for some some of the stupid questions I may be asking. . . . .
I make YouTubes with up to 3 GoPros (1xHERO6 and 2xHERO8). See channel https://www.youtube.com/channel/UCyqo4XTQlz57-ESk47V6tCg The cameras must shoot video for 3 seconds, wait 57 seconds and then repeat cycle. I manage fine if there is only one camera in front window (using a hacked Yoctop remote control). But when there are also cameras on the side windows, they often go out of sync and record for 57 seconds - that chews up precious SD card space. Therefore I need to address commands individually to each of the cameras, according to their status. I believe that I can do it with an ESP32 and a lot of learning from guys like you on Github. Thank you in advance.
My first problem is with Secrets.h:
// replace the following:
#define GOPRO_1_SSID "YOUR_CAMERA_NAME"
#define GOPRO_1_PASS "YOUR_CAMERA_PASS"
// same for the second camera:
#define GOPRO_2_SSID "YOUR_CAMERA_NAME"
#define GOPRO_2_PASS "YOUR_CAMERA_PASS"
If I look at GoPro Quik on my Android, I see for one of the Hero8's
Name: GP53089464
Password: C>T-BNB-p4Q
(I scrambled them slightly, but correct length and type of characters)
Is it these names and passwords? Must it look like this?
#define GOPRO_1_SSID "GP53089464"
#define GOPRO_1_PASS "C>T-BNB-p4Q"
I have followed all the steps but nothing is showing on wemos d1mini's serial monitor. When I type anything it says, " connect the camera first". The serial monitor is not showing 'connecting to the wifi' even when resetting the d1 mini.
Hello,
First off thank you for taking the time to create this library. I am though running into an issue with Verifying the code. So I went back to just the basic library and tried the example (GoProControl.ino) and get the same error "Compilation error: 'HERO3' was not declared in this scope" I've tried changing #define GOPRO_SSID "HERO3" in secrets.h but that didn't work. What am I missing it's probably something simple.
I've been trying out the GoProControl example, however I noticed that when you issue the turn off command the keep alive ping fails and can't connect again.
From reading Konrad's command list, it looks like it should just sleep:
Power Off: http://10.5.5.9/gp/gpControl/command/system/sleep
I would've thought it would continue to accept the keep alive pings, is this expected behaviour?
Hello ,
Calling setTimeLapseInterval return a error when I call it (wrong parameter).
I think it is necessary to replace OR operations by AND operations in this line:
GoProControl/src/GoProControl.cpp
Line 1095 in 2323f38
When I change this line in :
if (i_option != 0 && i_option != 1 && i_option != 5 && i_option != 10 && i_option != 30 && i_option != 60)
it works OK.
Do you think it is ok ?
Roberto
Hello !
I just want to know what are those functions in your library :
stringSearch()
stringCut()
I don't find any informations about that !
Thank you @aster94 !
Damien
I using esp8266 for first times I can connect and pair with gopro hero7, control perfect at the first times connect, but when I power cycle esp then send "b", esp can connect to wifi but when send command the connect is lost. Plz help me can make 1 remote control gopro just start and stop record.
Hi, is there a way to use another bluetooth module instead of the ESP32 with your libary?
BLE is not planned yet because in the ESP32 core is not so well supported or anyway bug-free
Hi, I'm facing a problem.
I try to get status and media list on my gopro hero3 with ESP8266.
I tried your arduino json gopro and for both it return "EmptyInput".
On Konrad documentation, it says that for hero3 the status is given in bytes returned by http://10.5.5.9/camera/sx?t=PASSWORD
I can obtain a file named sx when i do that in my browser, and this file contain bytes for decoding the status.
Here the library looks only to a json, so i think it cant work for my hero3 (with status).
for the media list, your exemple arduinojsongopro should work because for hero3 the media list is a json.
So I think "getstatus" and "getmedialist" are not returning the values returned by http://10.5.5.9/camera/sx?t=PASSWORD and http://10.5.5.9:8080/gp/gpMediaList
How can I fix that ?
Thank you ! :)
Hi Aster,
First I have to thank you for your amazing working on this project,
I am not a very experienced arduino programmer and I am trying to connect a ESP8266 NodeMcu board to my Gopro Hero6 Black.
I followed all your instructions installing the library on my Arduino IDE, and I tried to use this example, but I can not make it works, and I have no idea why.
I just copy and paste the code, changed the Secrets.h with my camera SSID and Password, and changed the beginning of the code "CAMERA" for "HERO6". After that, I uploaded the code in the board, and until now, everything is ok. Then, I open the Serial Monitor, and try to use the commands in the code ("b", "c", etc), but nothing happen, and nothing appears in the Serial Monitor. In the camera not happens as well.
Any idea what I am doing wrong?
Thank you very much
Just found this library, and loved the concept. However, installed the GoProControl.ino example and tried to make it work. I updated the Secrets.h file, but was not able to connect to the Hero7 Silver at all. KonradIT mentions that the calls work with the Hero7 Silver https://github.com/KonradIT/goprowifihack/tree/master/HERO7 -so not sure what I'm doing wrong. Any help would be appreciated.
Hi,
I'm trying to control multiple GoPro HERO7 cameras simultaneously. When launching the MultiCam example on my Arduino Wifi Rev2 it connects to the first listed camera but gives an error for the second camera: "Connection failed with status: 6".
When I switch the order of the 2 cameras it again only connects to the first camera and pops up the same error for the second camera.
Do you have an idea on what could be causing this problem?
Hello,
tried to connect with GoPro 8 camera. Code is running with Arduino and PlatformIO IDE. Feedback with example code is "Connection failed with status: 6". GoPro Quick App is working fine to control GoPro. Maybe there is a new way to connect to camera because after switch of bluetooth on my mobile phone, can not connect to GoPro with GoPro Quick App. Looks like that GoPro is only able to do Wifi pairing after sending specific bluetooth command.
Greetings
Max
Hi. My apologies. Not an issue but didn't know how to make a suggestion and I'm not familiar much with forking... (there's a joke there I'm sure.. LOL...)... Anyway, I have a GP Hero 7 and added a new function to my code to enable the digital zoom feature in Hero 7's and above. Here's the code (not perfect) but it works:
GoProControl.h added:
int zoomPhoto(const int zoomPct);
GoProControl.cpp added:
`int GoProControl::zoomPhoto(int zoomPct)
{
//Reference: https://github.com/KonradIT/goprowifihack/blob/master/HERO7/HERO7-Commands.md
//http://10.5.5.9/gp/gpControl/command/digital_zoom?range_pcnt=[PERCENTAGE FROM 0 to 100]
char pctAsStr[6];
itoa(zoomPct, pctAsStr, 10);
makeRequest(_request, "/gp/gpControl/command/digital_zoom?range_pcnt=", (char *)pctAsStr);
return handleHTTPRequest(_request);
}
`
Hello, is it planned to add support for Hero 8 camera and when if so? Thanks.
I have this as line 10 of GoProControl.ino :
#define CAMERA HERO8 // Change here for your camera
And then the first error in the compiler is:
C:\Users\Gerald\Documents\Arduino\GoProControl\GoProControl.ino:10:16: error: 'HERO8' was not declared in this scope
#define CAMERA HERO8 // Change here for your camera
I tried HERO6 as well, but still similar error message
Obviously I need to learn some more very basic things . . . . . .
Could have additional options, like
a) last image
b) first image
c) all images
d) specific images
e) direct transfer to google/AWS/one/... cloud
f) direct transfer to ftp/smb/....
Hey,
Trying to get this to work, Got it working on my 4s but my 7s won't connect. I keep getting failed With status 6. I can connect to it from my raspberry pi and laptop, but not his library.
Any suggestions?
Hi,
First off, thanks for your support of the Arduino community!
I am having an unexpected problem simply compiling the example code (GoProControl). I am getting an "invalid conversion" error at the call to the 'GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA);' line. The error message(s) are shown below.
For context, this is using IDE version 1.8.13 on a Mac with an MKR 1010 WiFi. The MKR board otherwise works fine (including WiFi features) with other code. Some observations:
I am using the current version of the GoProControl library (1.2.0), although I get similar errors with older versions of the library.
I tried directly entering the SSID, and password into the main code (rather than using Secrets.h) but get errors for the same line (although the errors change) I.e., GoProControl gp("GP24907984", "cHS-Yy9-9Gv", HERO8);
Any thoughts on what the problem (or solution) is for this conversion problem?
Thanks!
Error Messages:
Arduino: 1.8.13 (Mac OS X), Board: "Arduino MKR WiFi 1010"
GoProControl_Example:16:47: error: invalid conversion from 'const char*' to 'uint8_t {aka unsigned char}' [-fpermissive]
GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA);
^
In file included from /Users/lacomj/Documents/Arduino/GoProControl_Example/GoProControl_Example.ino:7:0:
/Users/lacomj/Documents/Arduino/libraries/GoProControl/src/GoProControl.h:76:3: note: initializing argument 3 of 'GoProControl::GoProControl(const char*, const char*, uint8_t, const uint8_t*, const char*)'
GoProControl(const char ssid,
^~~~~~~~~~~~
exit status 1
invalid conversion from 'const char' to 'uint8_t {aka unsigned char}' [-fpermissive]
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hello guys, I was giving a try to the library, initially i was able to execute all the commands and then from one day to the other without modifying anything I am getting a lot of connection lost, I am using an ESP32 and what I do notice is that if I connect to it via simple Wifi.begin() it does connect but any of the commands respond, they all get "rejected" or not answered, I am using a Hero7 black, if I connect my computer to the camera I am able to access the different APIs, but not on the esp32, I was wondering if there are new headers or something new, I even tested with a more simple script that just pulls the status but on the esp32 seems not to work consistently.
#include <WiFi.h>
#include <HTTPClient.h>
const char* ssid = "Unknown HERO7 Black";
const char* password = "snv-GRX";
String serverName = "http://10.5.5.9:8080/gp/gpMediaList";
unsigned long timerDelay = 7000;
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.println("Connecting");
while(WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to WiFi network with IP Address: ");
Serial.println(WiFi.localIP());
}
void loop() {
if ((millis() - lastTime) > timerDelay) {
if(WiFi.status()== WL_CONNECTED){
HTTPClient http;
String serverPath = serverName;
http.begin(serverPath.c_str());
int httpResponseCode = http.GET();
if (httpResponseCode>0) {
Serial.print("HTTP Response code: ");
Serial.println(httpResponseCode);
String payload = http.getString();
Serial.println(payload);
}
else {
Serial.print("Error code: ");
Serial.println(httpResponseCode);
}
// Free resources
http.end();
}
else {
Serial.println("WiFi Disconnected");
}
lastTime = millis();
}
}
let's discuss here the next steps
I just made two commit. In the first I moved all the defines in a new files, this way we have code and settings separated. I finally added support for esp32 but i also removed the support for not-esp boards. I decided to do so for many reason: first of all a esp board cost a few euros, there is no need to use AT commands and another MCU, second because the library for the AT commands doesn't support http request so with #5 and to be more precise with this changes compatibility has been lost. I may add it in future if i would ever need it
Then i made a commit for formatting, since we both use VSCode i think it would be a problem to mantain the repo with the same code style
To do list
#define
for the settingsBefore pubblishing
keywords.txt
Constants.h
unfortunately even if i like the Constants.h.example
them are not very in the arduino philosophy of the keep it simple so when the lib would be ready i am going to delete them
by the way this won't be never executed: https://github.com/aster94/GoProControl/blob/master/src/GoProControl.cpp#L164 where did you thought it should go? I know a very little about http request ๐
Hi,
Not connected
Attempting to connect to SSID: GP56217423
using password: action2315
..................
Connected to GoPro
Keeping connection alive
Client connected
Request: GPHD:0:0:2:0.000000
Keeping connection alive
To me it seems like the MAC address is not read? I can see that it is set to NULL in the constructor, but where is it changed or read from the camera?
I am fairly new to coding etc. Was just hoping to get this old gopro4 silver to take timelapse of my resin printers.
When I try and compile the sketch in Arduino IDE 2.0.3 I get the following error
Compilation error: 'HERO4' was not declared in this scope
Pointing to this line:
#define CAMERA HERO4 // Change here for your camera
//from my Hero 7: 06 41 69 EF 79 94
byte remote_MAC_ADD[] = { 0x06, 0x41, 0x69, 0xEF, 0x79, 0x94 };
const char* board = "RTLapseCAM"; //ESP Board Name
Also, since I am worried it will come up.....do I need to find my cameras mac address and also insert that? According to the gopro memory card the mac add is "d4d919c91faa"
Hi. First off, thank you for the great effort put into creating this library! Have a challenge with failed connections after the first attempt. I can only get the ESP to trigger picture captures after resetting the GoPro WiFi connection and rebooting it. The first time in, I can connect and take photos. After this, it fails. Regardless of power cycling the ESP or the GoPro Below is the code I am using, and further down is the Serial output:
#include <GoProControl.h>
#include "Secrets.h"
/*
Control your GoPro with the Serial Monitor
edit the file Secrets.h with your camera netword name and password
CAMERA could be: HERO3, HERO4, HERO5, HERO6, HERO7, FUSION, HERO8, MAX
*/
#define CAMERA HERO7 // Change here for your camera
//from my Hero 7: 06 41 69 EF 79 94
byte remote_MAC_ADD[] = { 0x06, 0x41, 0x69, 0xEF, 0x79, 0x94 };
const char* board = "NodeMCU"; //ESP Board Name
GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA, remote_MAC_ADD, board);
void setup()
{
gp.enableDebug(&Serial);
while (!gp.isConnected())
{
gp.begin();
}
for (int i=0; i<5; i++)
{
Serial.println("Attempting a shot.");
gp.shoot();
gp.keepAlive(); // not needed on HERO3
delay(1000);
}
}
void loop()
{
Serial.println("In Main Loop. Keep alive.");
gp.keepAlive(); // not needed on HERO3
}
Attempting to connect to SSID: "GP50039006"
Using password: "kS9-mMx-Rvx"
.......................................................
Connected to GoPro
Attempting a shot.
Connection lost
Attempting a shot.
Connect the camera first
Attempting a shot.
Connect the camera first
Attempting a shot.
Connect the camera first..
I have a solution that works as an access point and can control several cameras at the same time. Maybe interested in you?
https://github.com/sepp89117/GoProRC_ESP32
I would be happy if you had a solution for my case, namely I want to keep the cameras in AP mode switched on while I'm in AP mode myself. An idea?
greetings from Germany
Hi, I am having an issue similar to here
The camera and ESP connect together correctly, until the ESP is reset. It then fails on _wifi_client.connect().
To get the connection working again, the camera WiFi service must be restarted.
Is there any solution to this? I have tried disconnecting wifi and then restarting the ESP8266 but this was not successful.
Thanks!
Other similar issues:
esp8266/Arduino#5552
KonradIT/goprowifihack#193
Hello,
Congratulations for your works about gopro control, it works ok for me and I had a lot of fun with it !
But I would need a way to ensure that the pictures are really made when taking a photo. So I tried to modify the code to get the media list using this command : http://10.5.5.9:8080/gp/gpMediaList
I would parse the response to count the pictures.
Unfortunatly, my knowledge about arduino libraries is too weak to do the job , I didn't even succeed in compiling the modified library ( "multiple definition" errors ) ... 8-((
In addition, I am not sure my idea would works :
_request = "http://10.5.5.9:8080/gp/gpMediaList" ;
String Response=sendHTTPRequest(_request);
Would it be possible to do something like this ?
Many thanks for your help .
Roberto
Hi,
I installed the lib and getting the error Constants.h: No such file or directory
Where do I get that file from?
Hello, i have a NodeMCU ESP8266.
I tried to upload the sketch but i cant':
-find the baud rate (i tried with 74880)
Could you tell me if you tried it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.