RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 2
Goto page 1, 2  Next
GoPro Script - Hero5 Session
Author Message
Reply with quote
Post GoPro Script - Hero5 Session 
Has anybody successfully communicated with the Hero5 Session? I used the example script and although I can get some communications happening, the camera does not start/stop when commanded.

I get the following:

[GoPro WiFi] Initializing
Ready for GoPro
[GoPro Wifi] Start GoPro

but then nothing happens. Actually, I only get the "Ready for GoPro" about 50% of the time, the other times I get:

Could not connect to GoPro

View user's profile Send private message
Reply with quote
Post  
GoPro changed the commands for the hero 5.

There is a thread here that has a link to a wiki that includes all commands for all gopros. You'll need to modify the script to use the new commands for the 5.

View user's profile Send private message
Reply with quote
Post  
I've been frustrated at my attempts to start/stop video on the Hero5 Session via Lua script. Part of it is I do not fully understand the operation of the Wi-Fi module and the responses from it to scipt commands.. Hopefully Brent and crew can step in here. I bought the Hero when I bought the RCP3. I had no idea that the Go-Pro support was only for the Hero3 and lower. The Hero3 has not been for sale for over 1 year now. Either the RCP3 sales documenation should be changed, or all Go-Pro cameras fully supported.

I can get a successful Wi-Fi connection to the camera, but get a "busy P...." back when I try to start the camera.

I have had success communicting with the camera via the Firefox Browser on my Samsung phone. You can obtain the Wi-Fi password once you have successfully connected the camera with the Go-Pro app. Unlike the Hero3, commands do not have the GoPro SSID or Password embedded.

To start video: http://10.5.5.9/gp/gpControl/command/shutter?p=1
To stop video: http://10.5.5.9/gp/gpControl/command/shutter?p=0.

You can obtain camera status, or set any of the camera variables via http commands as well. The camera has to be powered up to accept these commands.

View user's profile Send private message
Reply with quote
Post  
There are some unique things you have to do to the RCP before even running the script. One of which is actually disabling the WIFI. However, I'm not sure the script in the wiki can be used for the Hero 5. You'll need to do your own testing and customizing of the script to work with the 5.

Alternatively, Brent has said GoPro control and integration will be added in the upcoming firmware release. Timeline is unknown, but they are working on it.

In any case, it is only a matter of time before you'll get what you are looking for. Hang in there!

View user's profile Send private message
Reply with quote
Post  
We do have it on our list to test with the Hero 5.

It should be a minor modification to the existing script - however, I understand it requires another step to put the camera into command mode?

Doug, when you tested it manually, did it respond to those URL commands after power up without any other special actions?


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
There are no additional commands required to put it into command mode. Once my phone is connected to the GoPro, it will respond immediately to a URL request.

View user's profile Send private message
Reply with quote
Post  
Update; I have a Gopro Hero 5 for testing. Will update as I discover more. Smile


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Excellent! Do you have a Hero5 Black or Session?

Konrad has done an amazing job of documenting commands.
https://github.com/KonradIT/goprowifihack

However, I was not able to use the numeric control commands to turn video on/off - just the shutter?p=x command.

The Lua script you currently have is able to make the wi-fi connection, but I can't get any further.

One issue will be keeping the camera alive long enough so that the RCP can turn video on before the camera goes to sleep. There appears to be a couple of levels of "sleep". After the display turns off, the RCP can connect via wi-fi for a short period of time. The Go-Pro App can still connect after a longer period of time, but eventually it cannot connect either. I believe it uses the WOL (Wake-up On LAN) capability of the camera which involves sending the MAC address to the camera. Another solution to keeping the camera awake might be to send periodic status requests.

View user's profile Send private message
Reply with quote
Post  
It is the Hero 5 black.

I'll check out those docs. I remember someone mentioning a wake-up command with the Hero5, so that might be related.


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Hey Brent, you may be thinking of me and the WoL discussion. At least some of the GoPros (session in particular) need WoL before you can talk to them. See https://github.com/KonradIT/goprowifihack/blob/master/HERO4/HERO4-Session.md

A while ago I poked about trying to get this to work but you need to send a UDP packet and the Lua on the RCP did not have that module. The latest firmware 2.11.0 still does not have UDP it seems as
udp = assert(socket.udp())
causes the script to fail loading.

Check out https://gist.github.com/maiconio/2865500 for an example of WoL from Lua. Basically need to do something like (not tested)
local macChars = ''
for w in string.gmatch(mac, "[0-9A-Za-z][0-9A-Za-z]") do
macChars = macChars .. string.char(tonumber(w, 16))
end
cameraPowerTime = getUptime()
cameraStatus = 1
local udp = require("socket").udp()
udp:settimeout(1)
udp:setoption("broadcast", true)
udp:sendto(string.char(0xff):rep(6) .. macChars:rep(16), '10.5.5.9', 9)

It would be great if this could be baked into the firmware or if UDP could be exposed. Given the short timeouts on the camera, WoL is the only practical way the RCP can control these GoPros.


_________________
Pro3 #24
View user's profile Send private message
Reply with quote
Post  
Thanks, Jeff - we're looking at it this week, I'll dig in to those examples.

We already send UDP broadcasts as part of the beacon to the RaceCapture app, internal to the firmware. we'll see what we can do to for the GoPro support as well.

One outstanding question might be, how will we get the MAC address of the camera so we can send the WOL?


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Yeah, that (getting the MAC address) is not pretty. There must be a dance for this. Something like when you pair the remote with a camera.

The other thing to look at is how to control multiple cameras. Waking them all and giving them all IP addresses etc.


_________________
Pro3 #24
View user's profile Send private message
Reply with quote
Post  
Drastic measures, like described near the end of this thread might be required: https://community.gopro.com/t5/Cameras/How-to-get-the-MAC-address/td-p/21986


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Yikes?! there should be a better way of doing that. If you have a computer on the same subnet "arp" might help. I suspect that WIFI tools like WIFI analyzer should give you insight into the devices on the net. Either way, not super friendly but...


_________________
Pro3 #24
View user's profile Send private message
Reply with quote
Post  
I got something working for WoL and the GP Session. Here is the rough outline.

After joining the camera's network you tell the camera to wake up using

function wakeGoPro()
local macChars = ''
for w in string.gmatch(mac, "[0-9A-Za-z][0-9A-Za-z]") do
macChars = macChars .. string.char(tonumber(w, 16))
end
local magicPacket = string.char(0xff):rep(6) .. macChars:rep(16);
logMsg('Waking GoPro')
sendAt('AT+CIPSTART="UDP","10.5.5.9",9')
sleep(500)
sendAt('AT+CIPSEND=' ..toInt(#magicPacket))
sleep(100)
sendRaw(magicPacket)
sleep(100)
sendAt("AT+CIPCLOSE")
sleep(2000)
end

If the session is in standby mode, it should wake up.

The thing that messed me up was that the camera's access point is live even though the camera is "sleeping". I kept thinking that the WoL had to be sent first...

I'm working on a better implementation of the whole shebang but am running into some other problems but that's for a separate thread.


_________________
Pro3 #24
View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 2
Goto page 1, 2  Next
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum