This repository contains basic Python scripts to control a Tello Drone using the djitellopy library.
It is designed for beginners who want to learn how to connect, command, and fly the Tello drone.
-
Install the required library:
pip install djitellopy
-
Connect your computer to the Tello drone’s Wi-Fi network.
Run the scripts provided in this repo to perform basic operations:
-
Connect to drone
python connect.py
Establishes connection between your system and the drone.
-
Check battery level
python get-battery.py
Prints the battery percentage.
-
Takeoff and land
python takeoff-land.py
Makes the drone take off, hover for a short time, then land.
-
Get altitude
python get-altitude.py
Prints the drone’s current altitude.
-
Tello Camera Stream
python tello-stream.py
Creates an opencv window showing the Tello's videostream.
-
Basic movement
python basic-movement.py
Moves the drone using the
send_rc_control
command.
Here are some of the main djitellopy
functions used in the scripts:
from djitellopy import Tello
me = Tello()
me.connect() # Connect to drone
me.takeoff() # Take off
me.land() # Land
print(me.get_battery()) # Get battery percentage
print(me.get_altitude()) # Get current altitude
me.streamon() # Starts publishing the tello videostream frames
# Control movement (lr = left/right, fb = forward/backward,
# ud = up/down, yaw = rotation)
me.send_rc_control(lr, fb, ud, yaw)
- Ensure your system is connected to the Tello Wi-Fi before running any script.
- If connection fails, try restarting both the drone and Wi-Fi connection.
- Only one device can connect to the drone at a time.
This project is open-source and free to use.