KonradIT / goprowifihack

Unofficial GoPro WiFi API Documentation - HTTP GET requests for commands, status, livestreaming and media query.
Apache License 2.0
2.12k stars 335 forks source link

How to get current camera status? #130

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi! How to get current camera status? How to get the same thing that is displayed on the status display of the camera? For example, how to get the battery status, the number of records (photos or videos) or the current video resolution settings? I control the camera without problems, but how to get current data from it?

KonradIT commented 5 years ago
from goprocam import GoProCamera
from goprocam import constants

gpCam = GoProCamera.GoPro(constants.auth)

gpCam.infoCamera("model_name")
print(gpCam.getStatus(constants.Hero3Status.SpotMeter))
print(gpCam.getStatus(constants.Hero3Status.TimeLapseInterval))
print(gpCam.getStatus(constants.Hero3Status.FOV))
print(gpCam.getStatus(constants.Hero3Status.Beep))
print(gpCam.getStatus(constants.Hero3Status.LED))
print(gpCam.getStatus(constants.Hero3Status.AutoOff))
print(gpCam.getStatus(constants.Hero3Status.VideoRes))
print(gpCam.getStatus(constants.Hero3Status.FPS))
print(gpCam.getStatus(constants.Hero3Status.Loop))
print(gpCam.getStatus(constants.Hero3Status.WhiteBalance))
print(gpCam.getStatus(constants.Hero3Status.IsRecording))
print(gpCam.getStatus(constants.Hero3Status.PicRes))
print(gpCam.getStatus(constants.Hero3Status.TimeRecordedMins))
print(gpCam.getStatus(constants.Hero3Status.TimeRecordedSecs))
print(gpCam.getStatus(constants.Hero3Status.Charging))
print(gpCam.getStatus(constants.Hero3Status.PicturesTaken))
print(gpCam.getStatus(constants.Hero3Status.VideoRemaining))
print(gpCam.getStatus(constants.Hero3Status.VideosTaken))
ghost commented 5 years ago

Thanks for the quick response! But I do not know how to apply these commands. I apologize. I needed to more accurately describe my question. I am using ESP8266 and Arduino IDE. Commands are passed as follows: http://10.5.5.9/param1/PARAM2?t=PASSWORD&p=%OPTION How to make a request to get the data? I read this: https://github.com/KonradIT/goprowifihack/blob/master/HERO3/CameraStatus.md And I tried to create a request: http://10.5.5.9/camera/sx?t=PASSWORD&p=%01 But in response I get the code "410": command error

KonradIT commented 5 years ago

The status URI is http://10.5.5.9/camera/sx?t=PASSWORD

Then parse the bytes.

nespotts commented 5 years ago

Could you ellaborate or point me to an example of how to parse the bytes in the response for the camera status for the Hero 3. I am able to get status updates for Hero 4 and later cameras, but I'm not sure for the Hero 3. Thanks.

KonradIT commented 5 years ago

@nespotts sure, byte boundaries are here: https://github.com/KonradIT/goprowifihack/blob/master/HERO3/CameraStatus.md

A working code can be found here: https://github.com/KonradIT/gopro-py-api/blob/master/goprocam/GoProCamera.py#L220

Basically I pass the byte boundaries as an argument which returns the integer.

You can use my API written in Python to parse the data.