Wifimanager: ESP32 and GoPro Hero 6 CONNECTION LOST

Created on 18 Feb 2019  Â·  29Comments  Â·  Source: tzapu/WiFiManager

Hi.

I have established a connection where the ESP32 connects to the wifi hotstop of the GoPro but it loses connection after exactly 10 minutes and I don't know how to stop that.
The ESP32 connects to the hotspot created by the GoPro. I use http commands to control the GoPro.
I sent http command to record and after 10 minutes the connection fails and I can't stop the gopro from recording with another http command.

Why is this happening and how can I stop the connection from getting cut.

The connection is lost exactly after 10 minutes, is the GoPro the problem where it goes into some kind of sleep mode or turns off wifi and turns on bluetooth?

Thanks

Question wontfix

Most helpful comment

Just in case someone stumbles across this issue and wants to solve this problem:

I'm the maintainer of multiple GoPro API related repositories so I've had this issue before and I know how to solve it. GoPro cameras, when the WiFi is turned on, can either be turned on or off. When the camera is turned off, the WiFi turns off after 10 minutes (in the case of HERO6 and onward, older cameras keep the WiFi on indefinitely). Bluetooth is kept on for roughly an hour in case you need to wake it up (via BT commands of course).

When the camera is turned on with wifi on, the client needs to send a keep-alive message every 2.5 seconds to avoid the camera from killing the wifi uplink after 10 minutes of inactivity. If that message is not sent the camera will turn off after a few minutes and then the wifi will be deactivated after 10 minutes. This is a measure to save power.

All 29 comments

You are connecting to what to what exactly?

this may need more Details

who is the AP in this Scenario, how are you sending the requests?

There is a lot room for assumptions to make here :)

edited: the template when opening an issues is there for a reason

Heh “between” means nothing here.

this may need more Details

who is the AP in this Scenario, how are you sending the requests?

There is a lot room for assumptions to make here :)

edited: the template when opening an issues is there for a reason

first time using this sorry, I added more detail

Heh “between” means nothing here.

is that better?

From the gopro forum

You should also remember that the GoPro has battery conservation feature that turns off the WiFi signal after about 10 min. There is no way to disable this so what I do is touch the LCD screen every few minutes to let the camera know I'm still using it even if its not recording

Out of luck i guess, some people claim the 7 behaves better

@mindforger it happens even when it is recording, to fix the problem it is wasn t recording I would wake it up and put it to sleep every 5 minutes, because it turns of wifi when it is sleeping too, but after 10 minutes exactly after recording starts it loses connection

@alinscodes this is a known issue and even happens when directly connected via the phone

but that issue with the 6 aside, is it a capacitive touch? can one stimulate the touch with pure electronics and without moving parts?! would be a funny idea to put a virtual finger on the display and fake a touch every 5 minutes or so XD

@mindforger the GoPro will be put on commercial UAV, so that idea sounds funny but stupid for this application haha, so the HERO 7 doesn't have this problem ?

I also fixed this using a silly solution, saving the video after 9 minutes and starting it again after 1 second to keep the wifi connection alive

Are you sending a Keep Alive packet every 3 seconds? This keeps the GoPro on and the WiFi active. Alternatively try connecting to the GoPro via BLE.

so the HERO 7 doesn't have this problem ?

i have read people writing this but please don't go out and buy one on my comment here, check the gopro forums first for more insight, I just did a quick search for your issue there to get hints

Literally all GoPros have this problem. It's probably that @alinscodes is not sending the keep alive message periodically.

Do gopros have a io port that you could make a device that keeps it awake by sending harmless commands? Like fake button presses, shrug

@KonradIT I leave it to sleep and then I send WoL packet when I wake it up in order to save battery power. But if I wait more than 10 minutes it loses connection so I try wake it up and put it to sleep every 5 minutes but the problem is when I record for more than 10 minutes it loses connection too, therefore every 9 minutes during recording I have to send command to stop recording and start again,

@mindforger that was the information I needed, now I have to work around that gopro issue to make it do whatever I need.

@tablatronix you can t really send WoL packet when it is recording can you?

did you try to use a HTTP keepalive?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive

this would include to not drop the TCP from the request and requires to set a keep-alive flag in the request header as far as i remember (had this stuff in college last time, so can not give insight, but maybe that helps?)

PS: maybe it also requires the gopro to support this, which maybe not the case

PPS: since you are the author of this topic, you can close it whenever you feel so yourself :)

Sounds like this is a hardware level sleep, keep alive is probably not going to help

yeah, not going to help, I fixed it by waking it and putting it back to sleep every 5 minutes, and then when it is recording for long duration I stop recording and start again every 9 minutes to keep wifi connection alive.

thanks guys for your replies. I appreciate it.

Just in case someone stumbles across this issue and wants to solve this problem:

I'm the maintainer of multiple GoPro API related repositories so I've had this issue before and I know how to solve it. GoPro cameras, when the WiFi is turned on, can either be turned on or off. When the camera is turned off, the WiFi turns off after 10 minutes (in the case of HERO6 and onward, older cameras keep the WiFi on indefinitely). Bluetooth is kept on for roughly an hour in case you need to wake it up (via BT commands of course).

When the camera is turned on with wifi on, the client needs to send a keep-alive message every 2.5 seconds to avoid the camera from killing the wifi uplink after 10 minutes of inactivity. If that message is not sent the camera will turn off after a few minutes and then the wifi will be deactivated after 10 minutes. This is a measure to save power.

Sounds easy enough, sending a keepalive using esp8266 is outside the scope of this library, BUT if anyone wants to follow up and post keep alive solutions here feel free for posterity.

Should be easy to combine, thank you @KonradIT

@KonradIT is the keep alive message something different from sending WoL packets?
and where would I put this command and how would I send it to GoPro if I am using http commands to communicate with it ? I am a begginer so I out appreciate your help.

Yes it's different. This weekend I plan to add some more code to GoProControl and fnally get to work on gopro32 (a BLE client for ESP32 to control multiple gopro cameras).

@KonradIT could you direct me to an example of sending this keep alive message from esp32 to gopro please

void loop()
{
    WiFiClient client;
    if (!client.connect('10.5.5.9', 8554)) {
        Serial.println("Connection to host failed");
        delay(1000);
        return;
    }
    client.print("_GPHD_:0:0:2:0.000000" );
    client.stop()
}

Is that the keep alive message?

That is the keep alive message. Please continue this issue on my ESP8266 library fork or my ESP32 BT library project

8554 is the port where we send the keep alive messages and we receive the UDP live stream.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gjt211 picture gjt211  Â·  7Comments

CWempe picture CWempe  Â·  10Comments

Andreafoxalarm picture Andreafoxalarm  Â·  12Comments

e-music picture e-music  Â·  8Comments

tablatronix picture tablatronix  Â·  7Comments