Crate tello[][src]

Expand description

Tello drone

There are two interfaces for the tello drone. The text based and a non-public interface, used by the native app. The guys from the tellopilots forum did an awesome job by reverse engineer this interface and support other public repositories for go, python…

This library combines the network protocol to communicate with the drone and get available meta data additionally and a remote-control framework is available to simplify the wiring to the keyboard or an joystick.

In the sources you will find an example, how to create a SDL-Ui and use the keyboard to control the drone. You can run it with cargo run --example fly

Please keep in mind, advanced maneuvers require a bright environment. (Flip, Bounce, …)


When the drone gets an enable package (drone.connect(11111);), the Tello drone send data on two UDP channels. A the command channel (port: 8889) and B the video channel (default: port: 11111). In the AP mode, the drone will appear with the default ip All send calls are done synchronously. To receive the data, you have to poll the drone. Here is an example:


use tello::{Drone, Message, Package, PackageData, ResponseMsg};
use std::time::Duration;

fn main() -> Result<(), String> {
    let mut drone = Drone::new("");
    loop {
        if let Some(msg) = drone.poll() {
            match msg {
                Message::Data(Package {data: PackageData::FlightData(d), ..}) => {
                    println!("battery {}", d.battery_percentage);
                Message::Frame(frame_id, data) => {
                    println!("frame {} {:?}", frame_id, data);
                Message::Response(ResponseMsg::Connected(_)) => {
                _ => ()
        ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 20));

Remote control

The poll is not only receiving messages from the drone, it will also send some default-settings, replies with acknowledgements, triggers the key frames or send the remote-control state for the live move commands.

The Drone contains a rc_state to manipulate the movement. e.g.: drone.rc_state.go_down(), drone.rc_state.go_forward_back(-0.7)

The following example is opening a window with SDL, handles the keyboard inputs and shows how to connect a game pad or joystick.


use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use tello::{Drone, Message, Package, PackageData, ResponseMsg};
use std::time::Duration;

fn main() -> Result<(), String> {
    let mut drone = Drone::new("");

    let sdl_context = sdl2::init()?;
    let video_subsystem =;
    let window = video_subsystem.window("TELLO drone", 1280, 720).build().unwrap();
    let mut canvas = window.into_canvas().build().unwrap();

    let mut event_pump = sdl_context.event_pump()?;
    'running: loop {
        // draw some stuff
        // [...]

        // handle input from a keyboard or something like a game-pad
        // ue the keyboard events
        for event in event_pump.poll_iter() {
            match event {
                Event::Quit { .. }
                | Event::KeyDown { keycode: Some(Keycode::Escape), .. } =>
                    break 'running,
                Event::KeyDown { keycode: Some(Keycode::K), .. } =>
                Event::KeyDown { keycode: Some(Keycode::L), .. } =>
                Event::KeyDown { keycode: Some(Keycode::A), .. } =>
                Event::KeyDown { keycode: Some(Keycode::D), .. } =>
                Event::KeyUp { keycode: Some(Keycode::A), .. }
                | Event::KeyUp { keycode: Some(Keycode::D), .. } =>

        // or use a game pad (range from -1 to 1)
        // drone.rc_state.go_left_right(dummy_joystick.axis.1);
        // drone.rc_state.go_forward_back(dummy_joystick.axis.2);
        // drone.rc_state.go_up_down(dummy_joystick.axis.3);
        // drone.rc_state.turn(dummy_joystick.axis.4);

        // the poll will send the move command to the drone

        ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 20));


pub use command_mode::CommandMode;
pub use drone_state::DroneMeta;



Main connection and controller for the drone

Data / command package received from the drone with parsed data (if supported and known)

represent the current input to remote control the drone.

wrapper to generate Udp Commands to send them to the drone.


known Command ids. Not all of them are implemented.

Flip commands taken from Go version of code

Incoming message can be Data, a response from the drone or a VideoFrame

Parsed data from the drone.

The package type bitmask discripe the payload and how the drone should behave. More info are available on the webpage

unformatted response from the drone.

available modes for the tello drone