goprowifihack
goprowifihack copied to clipboard
Getting date and time from GoPro camera
Problem:
Newer GoPro models (now sure what models are capable exactly) provide date and time in status. But there's no method to get it via inteface naturally.
Details:
- GoPro Camera(s): GoPro 7 Hero
- Firmware Version: firmware version: HD7.01.01.90.00
- Steps to reproduce:
Here's the snippet to get the date and time:
import json
import datetime
from goprocam import GoProCamera, constants
goproCamera = GoProCamera.GoPro()
status = json.loads(goproCamera.getStatusRaw()).get('status')
status_time = status.get('40', [])[1:].split('%')
time_parts = [int(item, 16) for item in status_time]
if time_parts:
time_parts[0] += 2000
print(datetime.datetime(*time_parts))
So, we actually can parse the key '40' from status in a specific manner to get the date & time.
- Happens every time? Y
It would be great to have an interface method for that.
Thank you for developing and maintaining this great project!
I think status_time[0...2] are base 16, [3...5] are base 10.