Hello Tello Pilot!
Join our DJI Tello community & remove this banner.
Sign up

Accessing Tello camera picture mode through Python

marcolli

Active member
Joined
Aug 3, 2018
Messages
37
Reaction score
8
Hi everyone, I'm working on a project where I want to use a python script, run from a computer, to command my drone to fly around and take pictures. My coding experience is quite limited and so far I've been using PyTello and TelloPy APIs to control the drone. With TelloPy I've managed to access the video stream and save screenshots from this. However, this isn't ideal due to the regular pixelation and glitches that form the video stream, which is why I want to access the single picture mode.

From what I've read so far, it seems to me that I need to sent a command to the Tello to take the picture, which seems fairly straightforward to me. However, I'm unsure how to go about saving images to my computer. Based on the implementation chart here and the Go documentation here it seems there is a "Save all pics" command which may be what I'm looking for. However, in the implementation chart it is described as a response, and I'm stuck on how to bring it together.

Any help/advice would be greatly appreciated!
 

SMerrony

Well-known member
Joined
May 1, 2018
Messages
65
Reaction score
59
Location
France
You need to ask in the Development forum. Also, do not assume that some Go docs apply to a Python API.
 
  • Like
Reactions: marcolli

marcolli

Active member
Joined
Aug 3, 2018
Messages
37
Reaction score
8
You need to ask in the Development forum. Also, do not assume that some Go docs apply to a Python API.
Thanks for the reply. I'll try posting on the other forum. I'm not necessarily looking for the exact functions as in the GoDoc, but rather whichever command tells the Tello to save a photo to the connected device.
 

marcolli

Active member
Joined
Aug 3, 2018
Messages
37
Reaction score
8
Update: I've managed to get the picture command to work. As is mentioned in the wiki:
-The "Take Picture" command has to be sent to the drone
-The Tello captures an image and replies with a "File Size" command. The controlling device needs to send an acknowledging ""File Size" command.
-The Tello sends the image data as a series of "File Data" commands containing the image data, split into chunks. Each "piece" of the image is formed of chunks.
-According to the Wiki, each piece must be acknowledged with a "File Data" command sent to the drone. However, my code only started working when I got rid of these acknowledgments.
-Without acknowledgements, the Tello will send the file chunks numerous (anywhere between 2 and 5) times. Checking for duplicates is straightforward as each chunk has an identifying number.
-Simply ignore the duplicates and then re-order them based on their number to build the final JPG data.

I've implemented this in Python as an extension to PinguSoft's pytello library. Although my method might not be completely correct, it has so far worked and produces the expected images.

I'll share the code on the forum on Monday when I'm back at work.
 

SaiRam435Kumar

New member
Joined
Jul 8, 2019
Messages
1
Reaction score
0
Update: I've managed to get the picture command to work. As is mentioned in the wiki:
-The "Take Picture" command has to be sent to the drone
-The Tello captures an image and replies with a "File Size" command. The controlling device needs to send an acknowledging ""File Size" command.
-The Tello sends the image data as a series of "File Data" commands containing the image data, split into chunks. Each "piece" of the image is formed of chunks.
-According to the Wiki, each piece must be acknowledged with a "File Data" command sent to the drone. However, my code only started working when I got rid of these acknowledgments.
-Without acknowledgements, the Tello will send the file chunks numerous (anywhere between 2 and 5) times. Checking for duplicates is straightforward as each chunk has an identifying number.
-Simply ignore the duplicates and then re-order them based on their number to build the final JPG data.

I've implemented this in Python as an extension to PinguSoft's pytello library. Although my method might not be completely correct, it has so far worked and produces the expected images.

I'll share the code on the forum on Monday when I'm back at work.
Hi maroclli,

can you post the code , we are also working on the same.
 

New Threads

Members online

Forum statistics

Threads
3,224
Messages
24,944
Members
8,312
Latest member
PauleMD