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

GoPro Hero 8 Connect through cable? #151

Open
chandranpranav opened this issue Oct 3, 2020 · 16 comments
Open

GoPro Hero 8 Connect through cable? #151

chandranpranav opened this issue Oct 3, 2020 · 16 comments

Comments

@chandranpranav
Copy link

Heyy guys I would really like some input here, I'm trying to connect my GoPro Hero 8 and use it as a camera on OpenCV applications. I'm using multiple cameras for object detection so cannot use WiFi for this approach as it can only detect one at a time.. When I connect my GoPro it is detected as a Network Adapter under the name 'GoPro RNDIS Device' I can use it on Skype, Zoom, and other applications but when I try to connect two cameras it detects only one camera.. But in device manager detects as two. What I want is to read these camera inputs through OpenCV. Any input would be appreciated.
94939555-f213a280-04ef-11eb-80fb-5a7a8909634a

@KonradIT
Copy link
Owner

KonradIT commented Oct 3, 2020

Interesting, can you see the DHCP addresses for both cameras via ifconfig? Using the experimental branch for webcam you could do:

gopro1 = GoProCamera.GoPro(ip_address=GoProCamera.GoPro.getWebcamIP("INTERFACE_CAM_1", camera=constants.gpcontrol, webcam_device="INTERFACE_CAM_1")

gopro2 = GoProCamera.GoPro(ip_address=GoProCamera.GoPro.getWebcamIP("INTERFACE_CAM_2", camera=constants.gpcontrol, webcam_device="INTERFACE_CAM_2")

gopro1.startWebcam()
gopro2.startWebcam()

Streams are on UDP on port 8554.

@chandranpranav
Copy link
Author

Hey @KonradIT so I'm using windows predominantly and I know they are still working in beta testing... But I tried to test it using the DHCP address . The script runs but always loads the laptop webcam instead. I would really like if you throw some light.

this is my python code I've used for testing it out

import cv2
from goprocam import GoProCamera, constants
gopro = GoProCamera.GoPro(ip_address="172.29.178.51") # change
#gopro = GoProCamera.GoPro(ip_address="172.29.194.51") # change
gopro.startWebcam(constants.Webcam.Resolution.R720p)
gopro.webcamFOV(constants.Webcam.FOV.Linear)
gopro.getWebcamPreview()
Capture1

@KonradIT
Copy link
Owner

Try using the v4l2 example from the examples folder.

@KonradIT
Copy link
Owner

Can confirm I can use two Hero9 Black cameras over USB with GoPro Connect instead of MTP to take a photo: https://twitter.com/konrad_it/status/1318286019251392519

@vukasinpetrovic
Copy link

vukasinpetrovic commented Oct 20, 2020

@KonradIT Is this achievable with raspberry pi? I'm trying to keep camera always connected to PI in order to do timelapses, but I cannot figure out how to control it via USB.

Edit:
Nevermind, I found out that version from pip is 4.0.3, but version in which you added webcam usb support is 4.1.0 and I had to install it manually. Thank you very much for your excellent work!

@KonradIT
Copy link
Owner

Hi, i still want to test a few stuff before I release to pip

@edmondklai
Copy link

@KonradIT, I have a GoPro Max, and I am unable to connect through WiFi because it seems like it won't show up as a router when I turn on the wifi on the camera, it will only allow me to pair with the app. I am trying to connect using a cable but the camera doesn't show up on the Network adapter, only on the Portable devices in Device Manager. Do you know if there are settings I need to change on either my GoPro or laptop?

@KonradIT
Copy link
Owner

No, GoPro MAX does not support USB Ethernet, only HERO8 and HERO9 do.

I am unable to connect through WiFi because it seems like it won't show up as a router when I turn on the wifi on the camera, it will only allow me to pair with the app

GoPro MAX only starts the WiFi Access Point when you tell it to via Bluetooth, you can check how I do it here.

@logburn
Copy link

logburn commented Jan 30, 2021

Sorry to dig this up again, but are there any working code examples of using the Hero 8 with the cable instead of WiFi? I've tried to use the "normal" code and get nonrecoverable errors. Or is there perhaps a settings on the GoPro that needs to be changed? I have the USB connection set to GoPro Connect as specified above already

edit: I just watched an example video and noticed I never get passed the Waking up... message without error. So I never get the Camera successfully connected! message

@vukasinpetrovic
Copy link

vukasinpetrovic commented Jan 30, 2021

Sorry to dig this up again, but are there any working code examples of using the Hero 8 with the cable instead of WiFi? I've tried to use the "normal" code and get nonrecoverable errors. Or is there perhaps a settings on the GoPro that needs to be changed? I have the USB connection set to GoPro Connect as specified above already

edit: I just watched an example video and noticed I never get passed the Waking up... message without error. So I never get the Camera successfully connected! message

I have it on Raspberry but I can get to it only on Monday because I'm out of home for the weekend. I'll post it here on Monday.

@logburn
Copy link

logburn commented Feb 2, 2021

@vukasinpetrovic Any update on this?

@vukasinpetrovic
Copy link

vukasinpetrovic commented Feb 2, 2021

#!/usr/bin/python3

from signal import signal, SIGINT
from goprocam import GoProCamera, constants

def handler(s, f):
    gopro.stopWebcam()
    quit()

signal(SIGINT, handler)

gopro = GoProCamera.GoPro(ip_address=GoProCamera.GoPro.getWebcamIP())
gopro.take_photo()

@logburn This is the code I used. One thing to note, when I was using this I think that functionality was on dev branch. Don't take my word for granted, it was 2-3 months ago, so check if it is still on dev or on master.

@logburn
Copy link

logburn commented Feb 2, 2021

Looks like it works on the current master branch. Thank you so much for getting that code for me!

@ethaniel
Copy link

No, GoPro MAX does not support USB Ethernet, only HERO8 and HERO9 do.

HERO 8 and HERO 9 support USB Ethernet adapters?

@shahla-ai
Copy link

@vukasinpetrovic
hello i wish for your help
i am trying to control my GoPro via USB wired cable on my RPI4
i connected my cam to my PI, downloaded and installed version 4.1.0 of gopro-pi-api
is there anything i should do more , and what python code should i write to connect to my cam ?
best regards,

@vukasinpetrovic
Copy link

@shahla-ai I did this years ago and I'm out of that scope now. I'm sorry that I'm unable to help you right now. Try to use examples of others and one that I provided in this issue (couple of comments above).

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

7 participants