Sending Photos to Olympe

I am working on a project which requires use of the drone camera, but I only need to be able to take .jpg mid resolution (720p-480p) pictures (for now, may need to modify resolution to meet some other parameters) whenever I send a command. This I can do no problem, the images get stored on the SD card. My issue is that I am unsure if there is a way to do a few things I need to do:

Chiefly, I want to be able to retrieve the photo from the drone over the WiFi connection. This is absolutely essential. I know that there is a way to stream video, but that is broken as of right now so until the update later this month, that isn’t an option.

I would also like to be able to delete files on the SD card remotely, so that I don’t fill up the SD card (not essential by any means).

I have been able to use PDrAW to connect to the drone and stream video so I am assuming that the video data is somewhere on the PC. If there is a way to access the video stream being shown to me in PDrAW from Olympe, I can just sample the live video no problem.

1 Like

You can list available images using:REST API
http://192.168.42.1/api/v1/media/medias

When you get the response then use the URI from the JSON data structure for the image you want to download:
Example:
http://192.168.42.1/data/media/100000470181.JPG

2 Likes

Hello

Thank you eubmabe!

As eubmabe said you can use the drone REST API to download the photos and videos from the drone SD card (with an HTTP GET request).

If you send an HTTP DELETE request the associated resource will be deleted from the drone SD card.

Nicolas

1 Like

Thanks so much both eubmabe and ndessart! This is exactly what I couldn’t figure out.

I tried getting the resource_id from the media_id but there seems to be some strange conversion between them.
For example

media_id “10000043”
resource_id “100000430044.JPG”

and sometimes it’s

media_id “10000041”
resource_id “100000410041.JPG”

Does anyone know the logic behind this?

1 Like

Hi,

The number in the media_id and the resource_id can go out of sync if you have medias with multiple resources.

This can happen in multiple cases, like a long video (>4GB, where the file is split into two MP4 files), or some photo modes (burst, bracketing …)

You should not rely on the media_id to get the resource_id, your should always get it directly from the drone. You can get the infos about a single media with the following request:
http://anafi.local/api/media/v1/medias/media_id (change media_id with the actual media_id you want details for, without quotes).

Regards,
Nicolas.

1 Like