在线观看www成人影院-在线观看www日本免费网站-在线观看www视频-在线观看操-欧美18在线-欧美1级

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

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

3天內不再提示

如何使用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開發軟件的計算機(我假設您有),以及安裝了GoPro應用程序的智能手機。

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

步驟2:配置相機的Wifi

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

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

一旦手機與相機配對,請使用應用程序打開相機的設置,并為wifi網絡提供您選擇的新名稱和密碼。

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

要在相機上查看wifi網絡名稱,請導航至《 Camera Info “,該名稱位于“連接設置”菜單。

步驟3:查找GoPro的MAC地址

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

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

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

http://10.5.5.9/gp/gpControl/info

此網址應打印一個字符串您的網絡瀏覽器中的信息類似于:

{“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:”之后的數字。 這個12位數字和數字字符串是MAC地址。在我的情況下,這是 0641631510c4 。

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

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

步驟4:將Arduino連接到GoPro Hero

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

針腳僅持續3分鐘,所以時間至關重要。

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

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

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

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

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

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

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

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

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

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

使用其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

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

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會話沒有要響應的PIN。然而,它有它自己的特點,使連接它真的很煩人。正如您可能已經注意到的那樣,只要您完成錄制,或者就此而言,只要您使用相機完成大部分操作,它就會關閉并進入睡眠模式。

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

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

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

WOL命令(代碼中的 CameraInitiate()功能)需要在大多數其他命令之前發送,并且通常應該延遲1-2秒。基本上,您需要在需要喚醒相機時(大多數時間)發送它。發送命令后,您需要暫停片刻才能讓相機實際喚醒。

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

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

以下是喚醒相機的代碼:

#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)

int localPort = 7;

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

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

//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:發送GoPro命令

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

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

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

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

發送開始和停止錄制命令的代碼:

#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)

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狀態更新

可以使用此鏈接從GoPro接收狀態更新:

http://10.5.5.9/gp/gpControl/status

當調用此鏈接時,它提供了一個JSON對象,可以使用此Camera Status指南進行解析。

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

它將返回如下內容:

{“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}, “設置”:{ “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”);

}

}

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • Arduino
    +關注

    關注

    189

    文章

    6495

    瀏覽量

    190490
  • Gopro
    +關注

    關注

    0

    文章

    74

    瀏覽量

    29285
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評論

    相關推薦
    熱點推薦

    Arduino與LabVIEW聯合編程指南

    Arduino編程并與LabVIEW上位機結合實現設備的遠程控制與數據采集。
    發表于 06-19 15:54 ?0次下載

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

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

    《ESP32S3 Arduino開發指南》第二章 Arduino基礎知識

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

    STM32、Arduino、樹莓派開發方式差異大嗎

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

    如何使用Arduino實現CAN總線通信呢

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

    芯片設計企業敦泰榮獲國際客戶GoPro“2024年度企業社會責任獎”

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

    Arduino采集雷達模塊數據與串口繪圖

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

    Arduino Nano Matter開發板正式上市

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

    HAL庫在Arduino平臺上的使用

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

    基于Arduino的串口通信項目

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

    stm32與Arduino的比較

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

    如何使用Arduino實現CAN總線通信

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

    樹莓派與Arduino的區別是什么

    在當今的科技世界中,樹莓派(Raspberry Pi)和Arduino是兩個經常被提及的名字。它們都是開源硬件平臺,但它們的目標、功能和用途卻大相徑庭。 1. 目標和用途 樹莓派(Raspberry
    的頭像 發表于 11-11 11:14 ?2253次閱讀

    怎樣用Arduino測試鋰電池容量

    本文詳細介紹了如何用Arduino測量鋰電池的容量。并附有電路圖和Arduino的程序代碼。
    的頭像 發表于 07-30 09:14 ?1613次閱讀
    怎樣用<b class='flag-5'>Arduino</b>測試鋰電池容量

    Arduino自制點焊機

    組裝18650電池組,要用到點焊機,本文介紹用Arduino控制點焊機的點焊時間。
    發表于 07-29 10:14 ?9次下載
    主站蜘蛛池模板: 狠狠五月天 | 国产精品三级国语在线看 | 老湿司午夜爽爽影院榴莲视频 | 国模吧新入口 | 亚洲影视久久 | 午夜黄页网站在线播放 | 看全色黄大色大片免费 | 天天视频一区二区三区 | 久久综合狠狠综合久久综合88 | 欧美人成网站免费大全 | 天天射干| 日本在线视频一区二区 | 爱爱免费 | 日本a级精品一区二区三区 日本a级特黄三级三级三级 | 天天摸天天碰色综合网 | 超黄视频网站 | 在线种子资源网 | 在线看黄色的网站 | 午夜国产精品理论片久久影院 | 日日操天天射 | 亚洲精品综合网在线8050影院 | 国产免费一级高清淫曰本片 | 久久久久久久国产精品电影 | 国产一区在线mmai | 天天夜夜狠狠 | 欧美同性精品xxxx | 国产一区二区三区波多野吉衣 | 成人三级在线播放线观看 | 双性强迫开宫灌满h | 噜噜吧噜噜色 | 日韩毛片高清在线看 | 久久亚洲国产成人影院 | 午夜爱爱小视频 | 1024手机看片国产旧版你懂的 | 日产精品卡二卡三卡四卡乱码视频 | 四虎永久精品免费网址大全 | 日韩专区一区 | 成人免费淫片95视频观看网站 | 粗又长好猛好爽 | 黄色网址播放 | 久99热|