

Rust SDK - DJI Tello Drone
source link: https://dev.to/alexander89/dji-tello-drone-4ijl
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Rust SDK - DJI Tello Drone
Aug 11
・2 min read
I got this Tello Drone for Christmas a while back. Flying in circles was quite fun, but the control via the mobile phone was unfortunately not comfortable for me and I couldn't see anything on the small screen.
It quickly became boring and what does a developer do when he can't sleep at night: hacking.
🤓 Hacking
I first found the public text-based API. It was quite simple to integrate and I tried to control the drone with my GamePad. Unfortunately, movements like "20 cm to the left" are not compatible with a joystick. After some time, however, I came across https://tellopilots.com/. Some clever people took the trouble to dissect the API and document it. (https://tellopilots.com/wiki/development/)
Even though the Go implementation is probably the source of truth, the documentation is very good. Now there was only one problem. I want RUST.
After a few more hours of hacking, two broken propellers and luckily no fly-away, the time had come. Usable as SDK and implementable in any home-automation project. Who doesn't want drones to swarm out when someone rings the doorbell or comes in the driveway. 🙈
💡 Use it
The repo is on github: https://github.com/Alexander89/rust-tello with an example app to fly around with a joystick. You can easily receive the video stream with VNC.
Here is a small example of how the drone can be controlled via rust.
use tello::{Drone, Message, Package, PackageData, ResponseMsg};
use std::time::Duration;
fn main() -> Result<(), String> {
let mut drone = Drone::new("192.168.10.1:8889");
drone.connect(11111);
loop {
if let Some(msg) = drone.poll() {
match msg {
Message::Data(Package {data: PackageData::FlightData(d), ..}) => {
println!("battery {}", d.battery_percentage);
}
Message::Response(ResponseMsg::Connected(_)) => {
println!("connected");
drone.throw_and_go().unwrap();
}
_ => ()
}
}
::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 20));
}
}
Happy Hacking and stay tuned
Recommend
-
20
Our first measurements of DJI's new FPV drone ...
-
4
Tello From $5/mo. at Tello Tello makes it easy to save with fully cu...
-
6
March 31, 2022 Software VR controller for the DJI Tello Drone WebXR has made building and deploying VR in...
-
5
Tello vs. Google Fi: Which flexible prepaid carrier is the best? By Samuel Contreras published about 14...
-
6
Best Tello Mobile cell phone plans 2022
-
7
Which network does Tello use?Tello uses T-Mobile's LTE and 5G network for its coverage. While the carrier used to use Sprint's network, new lines will be on T-Mobile, with any remaining Sprint connections being migrated...
-
7
There are a ton of phones that work great on Tello, thanks to T-Mobile's highly compatible network, and Tello's wide range of plans. Tello includes 5G and hotspot usage on all of its plan configurations, so it makes sense to get a phone that suppo...
-
3
Tello vs. Boost Mobile: How much data do you really need? By Samuel Contreras published about 5 hours a...
-
3
Tello vs. Visible: Which is best for you? By Samuel Contreras...
-
5
Tello vs. Ultra Mobile: Which low-cost carrier is right for you? By
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK