GoPro Script - Hero5 Session
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
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
-
- Posts: 138
- Joined: Fri Apr 07, 2017 3:47 pm
- Location: Oakland, CA
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.
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.
-
- Posts: 138
- Joined: Fri Apr 07, 2017 3:47 pm
- Location: Oakland, CA
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!
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!
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?
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?
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.
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.
-
- Posts: 31
- Joined: Sat May 07, 2016 9:26 pm
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/goprowifiha ... 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.
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
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?
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?
-
- Posts: 31
- Joined: Sat May 07, 2016 9:26 pm
-
- Posts: 31
- Joined: Sat May 07, 2016 9:26 pm
-
- Posts: 31
- Joined: Sat May 07, 2016 9:26 pm
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.
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