Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hero 4 Session LiveStream in v02.00 #47

Closed
ivanmkc opened this issue Jul 20, 2016 · 27 comments
Closed

Hero 4 Session LiveStream in v02.00 #47

ivanmkc opened this issue Jul 20, 2016 · 27 comments

Comments

@ivanmkc
Copy link

ivanmkc commented Jul 20, 2016

Problem:

Livestream GET request has no effect.

Side-note: I would like to help investigate this. What's the best way to set up the packet sniffing on Android to do that? Thanks!

Details:

I sent the GET request:
http://10.5.5.9/gp/gpControl/execute?p1=gpStream&a1=proto_v2&c1=restart

I get the response:
{status: "0"}

Live stream mode does not start. I can confirm this by no change on the Hero 4 Session Display, as well as no UDP packet stream for video.

  • GoPro Camera(s):
    Hero 4 Session
  • Firmware Version:
    v02.00
  • Steps to reproduce:
    I sent the GET request:
    http://10.5.5.9/gp/gpControl/execute?p1=gpStream&a1=proto_v2&c1=restart
  • Happens every time? [Y/N]:
    Y
@KonradIT
Copy link
Owner

Hi @ivanmkc, use the GoPro App to make sure your camera is up to date. I recently played around with a HERO4 Silver and used the URL you mentioned to get a live feed using FFplay.

@ivanmkc
Copy link
Author

ivanmkc commented Jul 20, 2016

Thanks for the quick response @KonradIT. It is brand new and up-to-date.

From the official site (https://gopro.com/update/hero4_session), the Hero 4 Session runs the HERO4 Session v02.00 firmware (March 31, 2016) and the Hero 4 Black\Silver run firmware v03.00.00 (July 30, 2015). Given the 8 month difference in release, I'm not surprised that there are discrepancies between them.

I'd love your help resolving this, but I don't mind helping either if you tell me how I can best contribute.

Thanks,
Ivan

@ivanmkc
Copy link
Author

ivanmkc commented Jul 20, 2016

For reference here is the output from: http://10.5.5.9/gp/gpControl

The GET request looks to be as your guide says them to be, but the GoPro4 Session just doesn't react to the command.
hero4SessionReference.txt

@KonradIT
Copy link
Owner

@ivanmkc crap I read it as HERO4 Silver, I am aware of this problem as I have a HERO4 Session myself and cannot get to stream. I tried using Charles Proxy but didn't get anything relevant. I have the Session with me now, will see what I can do

@ivanmkc
Copy link
Author

ivanmkc commented Jul 20, 2016

@KonradIT Ya I picked the session as its form factor makes it great for mounting on a drone. I think I read that you had interest in drones as well ;)

How do you set up Charles proxy to view the Android traffic? I used Wireshark on my Mac (on promiscuous mode) and couldn't see it. Would love to help.

@KonradIT
Copy link
Owner

If your Android phone is rooted, try Termux or Terminal Emulator with tcpdump or mitmdump, that should help. Or decompile the GoPro smarty apk

@KonradIT
Copy link
Owner

KonradIT commented Jul 20, 2016

OK I know what's happening here (I guess). My phone being pity does not let me run tcpdump/mitmdump because of some PIE setting. I used "Packet Capture" app from the Play Store and got some interesting requests. The app is wonderful: no root needed, material design...

Screenshots here:

http://i.imgur.com/VviiGhB.png

http://i.imgur.com/bmLKIRX.png

That is 3 methods of turning the preview ON

@KonradIT
Copy link
Owner

Forgot to mention /gp/gpControl/camera/PV/2 gives 500 Internal Error. /camera/PV/2 is used in HERO2 and HERO3 cameras but not in HERO4, I think they just messed up (being GoPro, it does not surprise me at all)

@ivanmkc
Copy link
Author

ivanmkc commented Jul 20, 2016

I used the app like you suggested. It shows me what you screenshotted.

So is the answer to send a preview ON request after sending the stream request?

@KonradIT
Copy link
Owner

I will need to reproduce everything in the right order later

@ivanmkc
Copy link
Author

ivanmkc commented Jul 20, 2016

Ok, let me know when you do and I'll test it out. Thanks!

On Wed, Jul 20, 2016 at 2:50 PM, Konrad Iturbe notifications@github.com
wrote:

I will need to reproduce everything in the right order later


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABgzgZow9CVm0eO0_hOkoeteoMrg63Geks5qXm4DgaJpZM4JQ_U6
.

@KonradIT
Copy link
Owner

@ivanmkc have you gotten anything? just got home so I'll see if I can get a working stream

@KonradIT
Copy link
Owner

I'd take a bet and say that maybe they keep preview alive by using /gp/gpControl/status every second?

@KonradIT
Copy link
Owner

GoPro app also sends outdated or bad requests, such as the pairing success and the /camera/PV/2 from HERO3... why?

@ivanmkc
Copy link
Author

ivanmkc commented Jul 24, 2016

Ya, I wonder if the outdated requests are actually being used for some
side-effect that keeps the connection alive. I'm bogged down with work this
week but I'll try this out later on in the week.

Ivan

On Sat, Jul 23, 2016 at 7:44 AM, Konrad Iturbe notifications@github.com
wrote:

GoPro app also sends outdated or bad requests, such as the pairing success
and the /camera/PV/2 from HERO3... why?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABgzgUkFvSexRO2kdLWhNkRYZyxbvdh2ks5qYf6VgaJpZM4JQ_U6
.

@KonradIT
Copy link
Owner

Got the preview working in FFplay after using the GoPro App on mobile. They still use udp 8554, although I didn't check any variable status in /gp/gpControl/status

https://i.sli.mg/FEq7IG.png

All its missing is a preview ON url

@ivanmkc
Copy link
Author

ivanmkc commented Jul 25, 2016

Ah I should have mentioned that was what I was doing to get it working in
the meantime.
Seems like the stream is working fine as you say.

On Mon, Jul 25, 2016 at 5:51 AM, Konrad Iturbe notifications@github.com
wrote:

Got the preview working in FFplay after using the GoPro App on mobile.
They still use udp 8554, although I didn't check any variable status in
/gp/gpControl/status

https://i.sli.mg/FEq7IG.png

All its missing is a preview ON url


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#47 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABgzgfESMCNrVLbOTKfrCaC_nvdYrNuPks5qZIcugaJpZM4JQ_U6
.

@chengsam
Copy link

chengsam commented Aug 4, 2016

Hi guys, I am trying to get my Session to stream to an iOS app. I am able to stream for now but encounters some difficulties for it to stream easily. I am not able to stream immediately after turning the wifi of GoPro on but after I tried visiting gp/gpControl/status for several times it can start to stream. I don't know if this is the magic method to allow it to start streaming. Also, the python script I used sends the "GPHD:0:0:2:0.00000" command to keep it alive. Can I do it also on iOS? Thank you.

@KonradIT
Copy link
Owner

KonradIT commented Aug 4, 2016

gp/gpControl/status for several times

I had my doubts regarding this but since you got it working I'll update the repo accordingly.

The python sends a magic packet with that command, same as GoPro App, you need to find a library for ObjC that does that, such as this one (Not tested with Hero4 Session!)

I'll confirm later on that the stream works with Hero4 Session on FFplay

@chengsam
Copy link

chengsam commented Aug 5, 2016

Your doc mentioned that the magic packet is as:

send a magic packet (WoL) with these parameters: MAC ADDRESS OF THE CAMERA, 10.5.5.9 as IP ADDRESS, Subnet Mask 255.255.255.0, Port 9.

But the python script sent "GPHD:0:0:2:0.00000", are they the same? Is this command only used for keeping the streaming alive and I need to send a magic packet first for it to start streaming?

@KonradIT
Copy link
Owner

KonradIT commented Aug 5, 2016

@chengsam No they are not the same, I think that keeps the stream alive where as the magic packet turns on the camera

@chengsam
Copy link

chengsam commented Aug 5, 2016

OK, I can stream the preview to my app now. However, the delay is ~5s. Just figuring out how to reduce the latency.

@KonradIT
Copy link
Owner

KonradIT commented Aug 5, 2016

@chengsam didn't have time yesterday I was travelling, did you send /gp/gpControl/status GET request to start the stream? Are you on 2.00?

@chengsam
Copy link

chengsam commented Aug 5, 2016

Yes, I sent /gp/gpControl/status several times until the status 31 of the camera and it's not 0 to start the stream. But I'm not sure if it works all the time. And my version is 2.00.

@KonradIT
Copy link
Owner

KonradIT commented Aug 6, 2016

Can confirm it works with pinging /gp/gpControl/status 5 times. I only neeeded to HTTP GET the URL 5 times at the start and then run the stream on FFplay. I used this script and it worked. I'll push a PR to add HERO4 Session support and update the docs on this repo accordingly.

Proof: http://imgur.com/a/PHtoi

Closing thread.

@KonradIT KonradIT closed this as completed Aug 6, 2016
@chengsam
Copy link

I found that sometimes it requires me to ping more than 5 times to make status 31 > 0. So in my implementation, i check for the count of status 31 and start the stream when it's not 0.

@KonradIT
Copy link
Owner

@chengsam I'll write it then, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants