diff --git a/examples/ESP32_FreeRTOS/ESP32_FreeRTOS.ino b/examples/ESP32_FreeRTOS/ESP32_FreeRTOS.ino index 58cf3a8..6563f80 100644 --- a/examples/ESP32_FreeRTOS/ESP32_FreeRTOS.ino +++ b/examples/ESP32_FreeRTOS/ESP32_FreeRTOS.ino @@ -15,7 +15,7 @@ void setup() void loop() { - if (Serial.available() > 0) + if (Serial.available() > 0) { in = Serial.read(); //Serial.write(in); @@ -23,98 +23,98 @@ void loop() 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/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; } in = 0; @@ -122,5 +122,9 @@ void loop() void keep_alive(void *parameter) { - gp.keepAlive(); + while (gp.checkConnection(true)) { + gp.keepAlive(); + Serial.println("KeepAlive sent"); + } + vTaskDelete( NULL ); } diff --git a/src/GoProControl.cpp b/src/GoProControl.cpp index a184092..80c43a2 100644 --- a/src/GoProControl.cpp +++ b/src/GoProControl.cpp @@ -1355,18 +1355,18 @@ void GoProControl::printStatus() if (_camera >= HERO4) { _debug_port->print("GoPro MAC:\t"); - //WiFi.BSSID(mac); - _debug_port->print(mac[5], HEX); + uint8_t* gpMac = WiFi.BSSID(); + _debug_port->print(gpMac[5],HEX); _debug_port->print(":"); - _debug_port->print(mac[4], HEX); + _debug_port->print(gpMac[4],HEX); _debug_port->print(":"); - _debug_port->print(mac[3], HEX); + _debug_port->print(gpMac[3],HEX); _debug_port->print(":"); - _debug_port->print(mac[2], HEX); + _debug_port->print(gpMac[2],HEX); _debug_port->print(":"); - _debug_port->print(mac[1], HEX); + _debug_port->print(gpMac[1],HEX); _debug_port->print(":"); - _debug_port->println(mac[0], HEX); + _debug_port->println(gpMac[0],HEX); _debug_port->print("Board Name:\t"); _debug_port->println(_board_name); }