女人自慰AV免费观看内涵网,日韩国产剧情在线观看网址,神马电影网特片网,最新一级电影欧美,在线观看亚洲欧美日韩,黄色视频在线播放免费观看,ABO涨奶期羡澄,第一导航fulione,美女主播操b

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

如何使用Arduino控制GoPro

454398 ? 來源:工程師吳畏 ? 2019-08-19 09:25 ? 次閱讀

第1步:材料

如何使用Arduino控制GoPro

對于這個項目,你只需要做幾件事。

首先,你顯然需要一臺GoPro相機。這些說明適用于最新型號(GoPro Hero 6)。雖然,我只是用GoPro Hero 4和GoPro Hero Session 5進行了個人測試.Hero Session模型與其他模型的控制略有不同,但我們將在稍后介紹。

您還需要Arduino MKR1000或Arduino MKR Zero。在這些說明中,我使用MKR1000。您可以使用另一個兼容Arduino的無線微控制器板(例如Feather),但我沒有親自嘗試過。

您還需要一根用于Arduino的USB線,一臺運行Arduino開發(fā)軟件的計算機(我假設(shè)您有),以及安裝了GoPro應(yīng)用程序的智能手機。

如果你沒有這樣的東西,或者之前從未使用過Arduino,我強烈建議你在開始這個項目之前先閱讀Arduino類!

步驟2:配置相機的Wifi

您需要做的第一件事就是打開并配置相機的wifi連接。我不打算深入研究這個問題,因為已經(jīng)有很多教程可以做到這一點。

在GoPro Hero4上,最簡單的方法就是將相機連接到按照應(yīng)用中的說明操作您的手機。

一旦手機與相機配對,請使用應(yīng)用程序打開相機的設(shè)置,并為wifi網(wǎng)絡(luò)提供您選擇的新名稱和密碼。

在GoPro上英雄會話5,同樣的方法也適用。首先,按照應(yīng)用中的說明將相機連接到手機。這將自動配置wifi網(wǎng)絡(luò)的名稱和密碼。

要在相機上查看wifi網(wǎng)絡(luò)名稱,請導(dǎo)航至《 Camera Info “,該名稱位于“連接設(shè)置”菜單。

步驟3:查找GoPro的MAC地址

啟用wifi后,您需要確定相機的MAC(媒體訪問控制)地址。在處理傳統(tǒng)的Hero系列GoPros時,這個地址是一個很好的信息。但是,如果您使用的是GoPro Hero Session,則此地址是必須的。

為了獲得它,首先使用上一步中的網(wǎng)絡(luò)名稱和密碼將計算機連接到相機的wifi網(wǎng)絡(luò)。

一旦登錄到您的相機的wifi網(wǎng)絡(luò),打開計算機上的任何舊網(wǎng)頁瀏覽器,并訪問以下網(wǎng)址:

http://10.5.5.9/gp/gpControl/info

此網(wǎng)址應(yīng)打印一個字符串您的網(wǎng)絡(luò)瀏覽器中的信息類似于:

{“model_number”21,“model_name”:“HERO5Session”,“firmware_version”:“HD5.03.02.51.00”,“serial_number”:“C3212365684485 ”, “board_type”: “0×05”, “ap_mac”: “0641631510c4”, “ap_ssid”: “GP54688615”, “ap_has_default_credentials”: “0”, “能力”: “16”}

如果沒有,請確保您的相機已打開,并且仍然連接到wifi。

我們感興趣的字符串中的位是字符串“ap_mac:”之后的數(shù)字。 這個12位數(shù)字和數(shù)字字符串是MAC地址。在我的情況下,這是 0641631510c4 。

一旦確定了地址,每兩個字符將其分開,并按如下格式進行格式化:

0x06,0x41,0x63,0x15,0x10,0xC4

步驟4:將Arduino連接到GoPro Hero

為了讓Arduino與GoPro Hero系列相機通信,它需要使用PIN配對。要獲取引腳,請在手機菜單中導(dǎo)航以將相機與應(yīng)用配對。這應(yīng)該在所有后期型號相機上生成4位數(shù)的PIN(Hero 3及更早版本的PIN有6位數(shù))。

針腳僅持續(xù)3分鐘,所以時間至關(guān)重要。

您需要手動將PIN兩個次插入兩者 它所說的地方:

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。??。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

//在這里輸入你的PINX XXXX在哪里了//!?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?! !!!!?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

一旦輸入了引腳,你只需不到三分鐘就可以將它上傳到Arduino并與相機建立連接。

說到哪個,別忘了輸入GoPro的wifi憑據(jù),其中包含:

//!?。。。。。。。。。。。。。。。。。。。。。。。。?!?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?! ?。。。。。。。?!

//輸入你的WIFI名字,密碼在這里

//!!!!?。。。。。。。。。。。。。。。。?! !?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?! !!?。。。。。。。。。?!

為了所有意圖和目的,一旦您成功上傳了代碼,就不會發(fā)生任何事情。然而,如果您從GoPro的設(shè)置菜單導(dǎo)航回視頻屏幕,您現(xiàn)在應(yīng)該能夠發(fā)送命令(我們將在稍后介紹)。

如果在接下來的步驟中您似乎無法向相機發(fā)送命令,請返回并重復(fù)此步驟。

使用其PIN碼將GoPro與Arduino配對的代碼:

#include

#include

#include

int status = WL_IDLE_STATUS;

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?/p>

//ENTER YOUR WIFI NAME AND PASSWORD HERE

//!?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

char ssid[] = “XXXXXXXXXXXX”; // your network SSID (name)

char pass[] = “XXXXXXXXXXXX”; // your network password (use for WPA, or use as key for WEP)

WiFiClient client;

const char* host = “10.5.5.9”;

const int httpPort = 80;

void setup(){

//Initialize serial and wait for port to open:

Serial.begin(115200);

// check for the presence of the wifi module:

if (WiFi.status() == WL_NO_SHIELD) {

Serial.println(“WiFi not present”);

// don‘t continue:

while (true);

}

// attempt to connect to Wifi network:

while ( status != WL_CONNECTED) {

Serial.print(“Attempting to connect to SSID: ”);

Serial.println(ssid);

// Connect to WPA/WPA2 network. Change this line if using open or WEP network:

status = WiFi.begin(ssid, pass);

// wait 8 seconds for connection:

delay(8000);

}

Serial.println(“Connected to wifi”);

printWifiStatus();

// START PIN

StartPin();

delay(10000);

// FINISH PIN

FinishPin();

}

void loop(){

//Nothing to do here!

delay(1000);

}

void StartPin(){

Serial.print(“connecting to ”);

Serial.println(host);

if (!client.connect(“10.5.5.9”, httpPort)) {

Serial.println(“connection failed”);

return;

}

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

//ENTER YOUR PIN HERE WHERE IT SAYS XXXX

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

String StartUrl = “/gpPair?c=start&pin=XXXX&mode=0”;

Serial.print(“Requesting URL: ”);

Serial.println(StartUrl);

client.print(String(“GET ”) + StartUrl + “ HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println(“Started”);

}

void FinishPin(){

Serial.print(“connecting to ”);

Serial.println(host);

if (!client.connect(“10.5.5.9”, httpPort)) {

Serial.println(“connection failed”);

return;

}

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

//ENTER YOUR PIN HERE WHERE IT SAYS XXXX

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

String StopUrl = “10.5.5.9/gpPair?c=finish&pin=XXXX&mode=0”;

Serial.print(“Requesting URL: ”);

Serial.println(StopUrl);

client.print(String(“GET ”) + StopUrl + “ HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println(“Finished”);

}

void printWifiStatus() {

// print the SSID of the network you’re attached to:

Serial.print(“SSID: ”);

Serial.println(WiFi.SSID());

// print your WiFi shield‘s IP address:

IPAddress ip = WiFi.localIP();

Serial.print(“IP Address: ”);

Serial.println(ip);

// print the received signal strength:

long rssi = WiFi.RSSI();

Serial.print(“signal strength (RSSI):”);

Serial.print(rssi);

Serial.println(“ dBm”);

}

步驟5:將Arduino連接到GoPro Hero會話

GoPro會話沒有要響應(yīng)的PIN。然而,它有它自己的特點,使連接它真的很煩人。正如您可能已經(jīng)注意到的那樣,只要您完成錄制,或者就此而言,只要您使用相機完成大部分操作,它就會關(guān)閉并進入睡眠模式。

在您發(fā)送GoPro Hero任何類型的命令之前,您需要將其喚醒。最簡單的方法是手動按下攝像機背面的菜單按鈕,并在幾秒鐘的窗口中發(fā)出命令。然而,這很煩人,并且在任何方面都不是特別實用。

喚醒GoPro的更好方法是使用WOL數(shù)據(jù)包或“魔術(shù)數(shù)據(jù)包”。這個首字母縮寫詞代表Wake-on-Lan,是遠程喚醒計算機從睡眠模式的協(xié)議。它需要使用UDP協(xié)議從Arduino發(fā)送字節(jié)到GoPro以喚醒它。這有點煩人,因為它與您發(fā)送所有其他控制命令的協(xié)議不同。如果你不熟悉編程,代碼也不那么漂亮,處理起來會有點復(fù)雜。

然而,當(dāng)它工作時,它真的像魔術(shù)一樣工作。通過向Arduino發(fā)送命令,看到我的相機醒來后,我從未停止驚訝。

WOL命令(代碼中的 CameraInitiate()功能)需要在大多數(shù)其他命令之前發(fā)送,并且通常應(yīng)該延遲1-2秒?;旧?,您需要在需要喚醒相機時(大多數(shù)時間)發(fā)送它。發(fā)送命令后,您需要暫停片刻才能讓相機實際喚醒。

在下面的示例中,在設(shè)置中調(diào)用WOL功能,因此它只會喚醒第一次運行時使用相機。

不要忘記在提示的代碼中輸入GoPro的wifi憑據(jù)和MAC地址!

以下是喚醒相機的代碼:

#include

#include

#include

int status = WL_IDLE_STATUS;

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

//ENTER YOUR WIFI NAME AND PASSWORD HERE

//!!!?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?/p>

char ssid[] = “XXXXXXXXXXXX”; // your network SSID (name)

char pass[] = “XXXXXXXXXXXX”; // your network password (use for WPA, or use as key for WEP)

int localPort = 7;

byte broadCastIp[] = { 10,5,5,9 };

//?。。。。。。。。。。。。。。。。。。。。。。。。。。?/p>

//ENTER YOUR MAC ADDRESS HERE

//!?。。。。。。。。。。。。。。。。。。。。。。。。。?/p>

byte remote_MAC_ADD[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

int wolPort = 9;

WiFiUDP Udp;

WiFiClient client;

const char* host = “10.5.5.9”;

const int httpPort = 80;

void setup(){

//Initialize serial and wait for port to open:

Serial.begin(115200);

// check for the presence of the wifi module:

if (WiFi.status() == WL_NO_SHIELD) {

Serial.println(“WiFi not present”);

// don’t continue:

while (true);

}

// attempt to connect to Wifi network:

while ( status != WL_CONNECTED) {

Serial.print(“Attempting to connect to SSID: ”);

Serial.println(ssid);

// Connect to WPA/WPA2 network. Change this line if using open or WEP network:

status = WiFi.begin(ssid, pass);

// wait 8 seconds for connection:

delay(8000);

}

Serial.println(“Connected to wifi”);

printWifiStatus();

delay(1000);

// WAKE UP YOUR SLEEPY CAMERA!

CameraInitiate(){

// NOTE: If this does not seem to be working,

// turn your camera on and off and try again.

}

void loop(){

//Nothing to do here!

delay(1000);

}

// FUNCTION TO WAKE UP THE CAMERA

void CameraInitiate(){

//Begin UDP communication

Udp.begin(localPort);

//Send the magic packet to wake up the GoPro out of sleep

delay(2000);

SendMagicPacket();

delay(5000);

// Absolutely necessary to flush port of UDP junk for Wifi client communication

Udp.flush();

delay(1000);

//Stop UDP communication

Udp.stop();

delay(1000);

}

// Function to create and send magic packet

// Taken and translated from here:

// https://www.logicaprogrammabile.it/wol-accendere-computer-arduino-wake-on-lan/

void SendMagicPacket(){

//Create a 102 byte array

byte magicPacket[102];

// Variables for cycling through the array

int Cycle = 0, CycleMacAdd = 0, IndexArray = 0;

// This for loop cycles through the array

for( Cycle = 0; Cycle 《 6; Cycle++){

// The first 6 bytes of the array are set to the value 0xFF

magicPacket[IndexArray] = 0xFF;

// Increment the array index

IndexArray++;

}

// Now we cycle through the array to add the GoPro address

for( Cycle = 0; Cycle 《 16; Cycle++ ){

//eseguo un Cycle per memorizzare i 6 byte del

//mac address

for( CycleMacAdd = 0; CycleMacAdd 《 6; CycleMacAdd++){

magicPacket[IndexArray] = remote_MAC_ADD[CycleMacAdd];

// Increment the array index

IndexArray++;

}

}

//The magic packet is now broadcast to the GoPro IP address and port

Udp.beginPacket(broadCastIp, wolPort);

Udp.write(magicPacket, sizeof magicPacket);

Udp.endPacket();

}

void printWifiStatus() {

// print the SSID of the network you‘re attached to:

Serial.print(“SSID: ”);

Serial.println(WiFi.SSID());

// print your WiFi shield’s IP address:

IPAddress ip = WiFi.localIP();

Serial.print(“IP Address: ”);

Serial.println(ip);

// print the received signal strength:

long rssi = WiFi.RSSI();

Serial.print(“signal strength (RSSI):”);

Serial.print(rssi);

Serial.println(“ dBm”);

}

步驟6:發(fā)送GoPro命令

在本例中,我將展示如何發(fā)送命令開始和停止視頻錄制。

也就是說,使用此處演示的相同方法,您可以為攝像機內(nèi)的每個功能發(fā)送命令。 GoPro Hero 4命令似乎是所有后續(xù)型號的標準設(shè)置。但是,一些較新的相機具有新功能和特定于攝像頭的命令,值得研究。您可以通過單擊特定相機型號的鏈接在Unofficial GoPro WiFi API github頁面上找到相機特定命令。

以下示例使用5秒鐘錄制,停止錄制,等待5個以上秒,然后重新開始。如果您正在使用Hero Session,請務(wù)必取消喚醒GoPro的代碼行。

再次,不要忘記輸入您的GoPro的wifi憑據(jù)和MAC地址!

發(fā)送開始和停止錄制命令的代碼:

#include

#include

#include

int status = WL_IDLE_STATUS;

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

//ENTER YOUR WIFI NAME AND PASSWORD HERE

//?。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。?!

char ssid[] = “XXXXXXXXXXXX”; // your network SSID (name)

char pass[] = “XXXXXXXXXXXX”; // your network password (use for WPA, or use as key for WEP)

int localPort = 7;

byte broadCastIp[] = { 10,5,5,9 };

//?。。。。。。。。。。。。。。。。。。。。。。。。。?!

//ENTER YOUR MAC ADDRESS HERE

//?。。。。。。。。。。。。。。。。。。。。。。。。。?!

byte remote_MAC_ADD[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

int wolPort = 9;

WiFiUDP Udp;

WiFiClient client;

const char* host = “10.5.5.9”;

const int httpPort = 80;

void setup(){

//Initialize serial and wait for port to open:

Serial.begin(115200);

// check for the presence of the wifi module:

if (WiFi.status() == WL_NO_SHIELD) {

Serial.println(“WiFi not present”);

// don‘t continue:

while (true);

}

// ADD THIS TO LOOP??????????????

// MAKE ITS OWN FUNCTION???????

// attempt to connect to Wifi network:

while ( status != WL_CONNECTED) {

Serial.print(“Attempting to connect to SSID: ”);

Serial.println(ssid);

// Connect to WPA/WPA2 network. Change this line if using open or WEP network:

status = WiFi.begin(ssid, pass);

// wait 8 seconds for connection:

delay(8000);

}

Serial.println(“Connected to wifi”);

printWifiStatus();

}

void loop(){

// Add code to check to see if wifi is still on. If not, stop and keep trying to connect

// WAKE UP CAMERA FROM SLEEP AND CONNECT

CameraInitiate();

// Add code to make sure that camera recognized (status 31)

// START RECORDING

StartRecording();

delay(5000);

// STOP RECORDING

StopRecording();

delay(5000);

}

void StartRecording(){

Serial.print(“connecting to ”);

Serial.println(host);

if (!client.connect(“10.5.5.9”, httpPort)) {

Serial.println(“connection failed”);

return;

}

//Command for starting recording

String StartUrl = “/gp/gpControl/command/shutter?p=1”;

Serial.print(“Requesting URL: ”);

Serial.println(StartUrl);

client.print(String(“GET ”) + StartUrl + “ HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println(“Recording”);

}

void StopRecording(){

Serial.print(“connecting to ”);

Serial.println(host);

if (!client.connect(“10.5.5.9”, httpPort)) {

Serial.println(“connection failed”);

return;

}

//Command for stopping recording

String StopUrl = “/gp/gpControl/command/shutter?p=0”;

Serial.print(“Requesting URL: ”);

Serial.println(StopUrl);

client.print(String(“GET ”) + StopUrl + “ HTTP/1.1 ” +

“Host: ” + host + “ ” +

“Connection: close ”);

Serial.println(“Stopped”);

}

// FUNCTION TO WAKE UP THE CAMERA

void CameraInitiate(){

//Begin UDP communication

Udp.begin(localPort);

//Send the magic packet to wake up the GoPro out of sleep

delay(2000);

SendMagicPacket();

delay(5000);

// Absolutely necessary to flush port of UDP junk for Wifi client communication

Udp.flush();

delay(1000);

//Stop UDP communication

Udp.stop();

delay(1000);

}

// Function to create and send magic packet

// Taken and translated from here:

// https://www.logicaprogrammabile.it/wol-accendere-computer-arduino-wake-on-lan/

void SendMagicPacket(){

//Create a 102 byte array

byte magicPacket[102];

// Variables for cycling through the array

int Cycle = 0, CycleMacAdd = 0, IndexArray = 0;

// This for loop cycles through the array

for( Cycle = 0; Cycle 《 6; Cycle++){

// The first 6 bytes of the array are set to the value 0xFF

magicPacket[IndexArray] = 0xFF;

// Increment the array index

IndexArray++;

}

// Now we cycle through the array to add the GoPro address

for( Cycle = 0; Cycle 《 16; Cycle++ ){

//eseguo un Cycle per memorizzare i 6 byte del

//mac address

for( CycleMacAdd = 0; CycleMacAdd 《 6; CycleMacAdd++){

magicPacket[IndexArray] = remote_MAC_ADD[CycleMacAdd];

// Increment the array index

IndexArray++;

}

}

//The magic packet is now broadcast to the GoPro IP address and port

Udp.beginPacket(broadCastIp, wolPort);

Udp.write(magicPacket, sizeof magicPacket);

Udp.endPacket();

}

void printWifiStatus() {

// print the SSID of the network you’re attached to:

Serial.print(“SSID: ”);

Serial.println(WiFi.SSID());

// print your WiFi shield‘s IP address:

IPAddress ip = WiFi.localIP();

Serial.print(“IP Address: ”);

Serial.println(ip);

// print the received signal strength:

long rssi = WiFi.RSSI();

Serial.print(“signal strength (RSSI):”);

Serial.print(rssi);

Serial.println(“ dBm”);

}

步驟7:接收GoPro狀態(tài)更新

可以使用此鏈接從GoPro接收狀態(tài)更新:

http://10.5.5.9/gp/gpControl/status

當(dāng)調(diào)用此鏈接時,它提供了一個JSON對象,可以使用此Camera Status指南進行解析。

最簡單的方法是使用計算機連接到GoPro的wifi網(wǎng)絡(luò),并使用Web瀏覽器加載上述鏈接。

它將返回如下內(nèi)容:

{“status”{“1”:1,“2”:2,“3”:0,“4”: 0, “6”:0, “8”:0, “9”:0, “10”:0, “13”:0, “14”:0, “15”:0, “16”:0, “17”:1, “19”:0, “20”:0, “21”:0, “22”:0, “23”:0, “24”:0, “26”:0,“27 “:0,” 28 “:82,” 29 “:” “ ”30“: ”“, ”31“:0, ”32“:0, ”33“:0, ”34“:2796,” 35 “:1917,” 36 “:0,” 37 “:1,” 38 “:0,” 39 “:1,” 40 “:” %12%05%13%0℃%04%0E”, “41” :0, “42”:0, “43”:0, “44”:0, “45”:0, “46”:1, “47”:1, “48”:1, “49”:0 , “54”:15476384, “55”:1, “56”:0, “57”:3927, “58”:0, “59”:0, “60”:500, “61”:2“, 62 “:0,” 63 “:0,” 64 “:0,” 69 “:1,” 71“ :12 , “72”:19, “73”:20, “74”:0}, “設(shè)置”:{ “1”:0, “2”:1, “3”:8 “4”:0” 5 “:0,” 6 “:1,” 7 “:1,” 8 “:1,” 9 “:0,” 10 “:0,” 11 “:0,” 12 “:0,” 13” :1, “14”:0, “15”:4, “16”:0, “17”:4 “18”:1, “19”:0, “20”:0, “21”:1 , “22”:0, “23”:0, “24”:0, “25”:0, “26”:4 “27”:0, “28”:4 “29”:5“, 30 “:0,” 31 “:0,” 32 “:3601,” 33 “:0,” 34 “:0,” 35 “:0,” 36 “:0,” 37 “:0,” 38“ :0, “39”:4 “40”:0, “41”:13, “42”:8, “43”:0, “44”:8, “45”:8中, “46”:0 , “47”:0, “48”:0, “52”:1, “54”:1, “57”:0, “58”:1, “59”:6中, “60”:8,” 61 “:1,” 62 “:2500000,” 63 “:7,” 64 “:4”,65 “:0,” 66 “:0,” 67 “:0,” 68 “:0,” 69” :1, “70”:0, “71”:0, “73”:0, “74”:0, “75”:3, “76”:3, “78”:1, “84”:0 , “85”:0, “86”:1, “87”:40 “89”:12, “91”:0, “92”:12, “95”:1, “96”:0}}

老實說,每次我試圖用我的Arduino工作都會讓我的GoPro崩潰。由于我沒有真正需要這個功能用于我正在進行的大型項目,我在這部分停止了我的輪子。

但是,由于nes3dprinting,這里有一些代碼可以用于ESP8266板:

// Code by https://www.instructables.com/member/nes3dprinting/

// This is for an ESP8266, not the MKR1000

// Made this for a GoPro Hero+. Should work for Hero4- Latest(Hero7)

//https://github.com/KonradIT/goprowifihack/blob/master/HERO/CameraStatus.md

#include ESP8266WiFi.h

// ArduinoJson Version 5.13

#include ArduinoJson.h

#include ESP8266HTTPClient.h

//########################## Enter GoPro WiFi Details Here #############################

const char* ssid = “GoProHero+”;

const char* pass = “GoProHero+”;

//######################################################################################

const char* host = “10.5.5.9”;

const int httpPort = 80;

void setup() {

Serial.begin(115200);

WiFi.mode(WIFI_STA);

WiFi.begin(ssid,pass);

}

void loop() {

if (WiFi.status() == WL_CONNECTED) {

// Prints the Current Mode of the Camera: Video-0, Photo-1, MultiShot-2

// https://github.com/KonradIT/goprowifihack/blob/master/HERO/CameraStatus.md

// Pick desired status from function below

GetStatus();

}

}

void GetStatus() {

//Serial.println(“Getting Status Updates”);

HTTPClient http; //Object of class HTTPClient

http.begin(“http://10.5.5.9/gp/gpControl/status”);

int httpCode = http.GET();

//Serial.print(“httpCode: ”);

//Serial.println(httpCode);

//Check the returning code

if (httpCode 》 0) {

// Parsing - Created Using ArduinoJson Assistant

// https://arduinojson.org/v5/assistant/

const size_t bufferSize = JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(55) + JSON_OBJECT_SIZE(64) + 730;

DynamicJsonBuffer jsonBuffer(bufferSize);

String str = http.getString();

//Serial.println(str);

JsonObject& root = jsonBuffer.parseObject(str);

JsonObject& status = root[“status”];

int status_1 = status[“1”]; // 1

int status_2 = status[“2”]; // 4

int status_3 = status[“3”]; // 0

int status_4 = status[“4”]; // 0

int status_6 = status[“6”]; // 0

int status_8 = status[“8”]; // 0

int status_9 = status[“9”]; // 0

int status_10 = status[“10”]; // 0

int status_11 = status[“11”]; // 0

int status_13 = status[“13”]; // 0

int status_14 = status[“14”]; // 0

int status_15 = status[“15”]; // 0

int status_16 = status[“16”]; // 0

int status_17 = status[“17”]; // 1

int status_19 = status[“19”]; // 0

int status_20 = status[“20”]; // 0

int status_21 = status[“21”]; // 0

int status_22 = status[“22”]; // 0

int status_23 = status[“23”]; // 0

int status_24 = status[“24”]; // 0

int status_26 = status[“26”]; // 0

int status_27 = status[“27”]; // 0

int status_28 = status[“28”]; // 0

const char* status_29 = status[“29”]; // “”

const char* status_30 = status[“30”]; // “GoProHero+”

int status_31 = status[“31”]; // 0

int status_32 = status[“32”]; // 0

int status_33 = status[“33”]; // 0

int status_34 = status[“34”]; // 4431

int status_35 = status[“35”]; // 4860

int status_36 = status[“36”]; // 0

int status_37 = status[“37”]; // 0

int status_38 = status[“38”]; // 0

int status_39 = status[“39”]; // 1

const char* status_40 = status[“40”]; // “%12%0B%0C%17%1E%08”

int status_41 = status[“41”]; // 0

int status_42 = status[“42”]; // 0

int status_43 = status[“43”]; // 1

int status_44 = status[“44”]; // 0

int status_45 = status[“45”]; // 0

int status_46 = status[“46”]; // 0

int status_47 = status[“47”]; // 0

int status_48 = status[“48”]; // 0

int status_49 = status[“49”]; // 0

long status_54 = status[“54”]; // 15899787264

int status_55 = status[“55”]; // 1

int status_56 = status[“56”]; // 4

int status_57 = status[“57”]; // 0

int status_58 = status[“58”]; // 0

int status_59 = status[“59”]; // 0

int status_60 = status[“60”]; // 500

int status_61 = status[“61”]; // 2

int status_62 = status[“62”]; // 0

int status_63 = status[“63”]; // 0

int status_64 = status[“64”]; // 2215

JsonObject& settings = root[“settings”];

int settings_1 = settings[“1”]; // 0

int settings_2 = settings[“2”]; // 11

int settings_3 = settings[“3”]; // 5

int settings_4 = settings[“4”]; // 0

int settings_5 = settings[“5”]; // 0

int settings_6 = settings[“6”]; // 1

int settings_7 = settings[“7”]; // 0

int settings_8 = settings[“8”]; // 0

int settings_9 = settings[“9”]; // 0

int settings_10 = settings[“10”]; // 0

int settings_11 = settings[“11”]; // 0

int settings_12 = settings[“12”]; // 0

int settings_13 = settings[“13”]; // 0

int settings_14 = settings[“14”]; // 4

int settings_15 = settings[“15”]; // 0

int settings_16 = settings[“16”]; // 0

int settings_17 = settings[“17”]; // 0

int settings_18 = settings[“18”]; // 0

int settings_19 = settings[“19”]; // 0

int settings_20 = settings[“20”]; // 0

int settings_21 = settings[“21”]; // 0

int settings_22 = settings[“22”]; // 0

int settings_23 = settings[“23”]; // 0

int settings_24 = settings[“24”]; // 0

int settings_25 = settings[“25”]; // 0

int settings_26 = settings[“26”]; // 0

int settings_27 = settings[“27”]; // 0

int settings_28 = settings[“28”]; // 0

int settings_29 = settings[“29”]; // 3

int settings_30 = settings[“30”]; // 0

int settings_31 = settings[“31”]; // 0

int settings_32 = settings[“32”]; // 10

int settings_33 = settings[“33”]; // 0

int settings_34 = settings[“34”]; // 0

int settings_35 = settings[“35”]; // 0

int settings_36 = settings[“36”]; // 0

int settings_37 = settings[“37”]; // 0

int settings_38 = settings[“38”]; // 0

int settings_39 = settings[“39”]; // 0

int settings_49 = settings[“49”]; // 100

int settings_50 = settings[“50”]; // 0

int settings_51 = settings[“51”]; // 2

int settings_52 = settings[“52”]; // 1

int settings_53 = settings[“53”]; // 1

int settings_54 = settings[“54”]; // 0

int settings_55 = settings[“55”]; // 3

int settings_56 = settings[“56”]; // 0

int settings_57 = settings[“57”]; // 0

int settings_58 = settings[“58”]; // 0

int settings_59 = settings[“59”]; // 0

int settings_60 = settings[“60”]; // 8

int settings_61 = settings[“61”]; // 1

long settings_62 = settings[“62”]; // 700000

int settings_63 = settings[“63”]; // 1

int settings_64 = settings[“64”]; // 2

int settings_68 = settings[“68”]; // 0

int settings_69 = settings[“69”]; // 0

int settings_70 = settings[“70”]; // 0

int settings_72 = settings[“72”]; // 0

int settings_73 = settings[“73”]; // 0

int settings_74 = settings[“74”]; // 0

int settings_75 = settings[“75”]; // 0

int settings_76 = settings[“76”]; // 0

int settings_77 = settings[“77”]; // 0

//########################### Set Desired State to Update Here ##########################################

Serial.print(“The Current State is: ”);

Serial.println(status_43);

//######################################################################################################

} else {

Serial.println(“No Response From Camera”);

}

}

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • Arduino
    +關(guān)注

    關(guān)注

    188

    文章

    6491

    瀏覽量

    190084
  • Gopro
    +關(guān)注

    關(guān)注

    0

    文章

    74

    瀏覽量

    29258
收藏 人收藏

    評論

    相關(guān)推薦
    熱點推薦

    免費分享Arduino入門+進階(全套例程+書籍)

    創(chuàng)意,比如控制燈光、傳感器、電機等。以下是Arduino入門+進階學(xué)習(xí)資料1.Arduino編程語言說明(相關(guān)文件可在下文掃碼領(lǐng)?。?.Arduino系列學(xué)習(xí)例程
    的頭像 發(fā)表于 05-22 11:40 ?83次閱讀
    免費分享<b class='flag-5'>Arduino</b>入門+進階(全套例程+書籍)

    《ESP32S3 Arduino開發(fā)指南》第二章 Arduino基礎(chǔ)知識

    的發(fā)展,在Arduino出現(xiàn)以前,雖然也有很多公司在推廣一些簡單易用的可編程控制器,但是由于開發(fā)平臺種類繁多,而且使用這些控制器基本上都需要對電子技術(shù)、數(shù)字邏輯、寄存器等內(nèi)容進行多方面的了解和學(xué)習(xí),才能
    發(fā)表于 05-13 09:28

    STM32、Arduino、樹莓派開發(fā)方式差異大嗎

    異同點 STM32、Arduino、樹莓派是三種不同的硬件平臺,各自具有獨特的特點和適用場景。 ? 一、硬件特性 ? 硬件平臺 STM32 Arduino 樹莓派 類型 微控制器 開源電子原型平臺
    的頭像 發(fā)表于 01-02 11:33 ?1176次閱讀

    如何使用Arduino實現(xiàn)CAN總線通信呢

    CAN(Controller Area Network)總線是一種常用于汽車和工業(yè)控制系統(tǒng)的串行通信協(xié)議,以其高可靠性和實時性而聞名。Arduino,作為一種流行的開源微控制器平臺,可以通過附加
    的頭像 發(fā)表于 12-23 09:06 ?1589次閱讀

    芯片設(shè)計企業(yè)敦泰榮獲國際客戶GoPro“2024年度企業(yè)社會責(zé)任獎”

    綠色創(chuàng)新? 永續(xù)發(fā)展 全球知名運動相機品牌客戶GoPro向敦泰頒發(fā)“2024年度企業(yè)社會責(zé)任獎”,以此表彰敦泰在推動綠色產(chǎn)品和履行ESG承諾上的卓越表現(xiàn)。 ? GoPro產(chǎn)品在沖浪、滑雪、自行車
    的頭像 發(fā)表于 12-17 10:19 ?780次閱讀
    芯片設(shè)計企業(yè)敦泰榮獲國際客戶<b class='flag-5'>GoPro</b>“2024年度企業(yè)社會責(zé)任獎”

    Arduino采集雷達模塊數(shù)據(jù)與串口繪圖

    Arduino采集雷達模塊數(shù)據(jù)與串口繪圖
    的頭像 發(fā)表于 12-14 11:44 ?743次閱讀
    <b class='flag-5'>Arduino</b>采集雷達模塊數(shù)據(jù)與串口繪圖

    Arduino Nano Matter開發(fā)板正式上市

    Silicon Labs(芯科科技)和Arduino在近日共同宣布Arduino Nano Matter開發(fā)板現(xiàn)已正式上市。這是延續(xù)今年3 月芯科科技和Arduino釋出Arduino
    的頭像 發(fā)表于 12-10 13:50 ?783次閱讀

    HAL庫在Arduino平臺上的使用

    HAL庫在Arduino平臺上的使用 Arduino平臺是一個開源的電子原型平臺,它包括硬件(基于微控制器的電路板)和軟件(Arduino IDE)。
    的頭像 發(fā)表于 12-02 14:04 ?1436次閱讀

    基于Arduino的串口通信項目

    基于Arduino的串口通信項目涉及多個方面,包括硬件連接、軟件編程、串口參數(shù)配置等。 一、硬件準備 Arduino開發(fā)板 :確保你有一塊Arduino開發(fā)板,如Arduino Uno
    的頭像 發(fā)表于 11-22 09:24 ?1941次閱讀

    stm32與Arduino的比較

    在微控制器的世界里,STM32和Arduino是兩個經(jīng)常被提及的名字。STM32是一系列由STMicroelectronics生產(chǎn)的高性能微控制器,而Arduino則是一個開源電子原型
    的頭像 發(fā)表于 11-19 15:45 ?3839次閱讀

    如何使用Arduino實現(xiàn)CAN總線通信

    CAN總線(Controller Area Network)是一種多主控制的串行通信協(xié)議,廣泛應(yīng)用于汽車電子、工業(yè)自動化等領(lǐng)域。它以其高可靠性、實時性和靈活性而受到青睞。Arduino作為一個
    的頭像 發(fā)表于 11-12 10:09 ?2476次閱讀

    Arduino自制點焊機

    組裝18650電池組,要用到點焊機,本文介紹用Arduino控制點焊機的點焊時間。
    發(fā)表于 07-29 10:14 ?9次下載

    利用Arduino的自動風(fēng)扇速度控制電路設(shè)計

    自動風(fēng)扇速度控制電路Arduino LM35編程非常容易實驗,可用于根據(jù)溫度水平通過繼電器控制任何目標設(shè)備。對于這里的溫度測量,我們使用 LM35,這是一種精密集成電路溫度器件,其輸出電壓與攝氏度
    的頭像 發(fā)表于 06-22 16:39 ?2915次閱讀
    利用<b class='flag-5'>Arduino</b>的自動風(fēng)扇速度<b class='flag-5'>控制</b>電路設(shè)計

    idf-arduino component組件怎么設(shè)置 ?

    idf -arduino component組件該怎么設(shè)置 ,。 CMake Warning at E:/COMPILE/Othert/IDF4.4/esp-idf-v4.4/tools
    發(fā)表于 06-12 07:27

    求助,在esp-idf中使用arduino作為組件后怎樣使用arduino的庫?

    在esp-idf中使用arduino作為組件后怎樣使用arduino的庫,例如我此時需要使用arduino的第三方庫blinker,怎樣使用?
    發(fā)表于 06-12 07:21