Preparation of DJI Tello Drone
A detailed guide on preparing the DJI Tello Drone is provided here: Gesture Controlled Drone #2 : Preperation - Drone
The Tello drone SDK provides ample information on how to program the drone to achieve the tasks via Tello commands, but are somewhat limited in the features. The Tello SDK connects to the aircraft through a Wi-Fi UDP port, allowing users to control the aircraft with text commands. We use Wi-Fi to establish a connection between the Tello and the M5Stack module. Once powered on Tello acts as Soft AP Wi-Fi (192.168.10.1) to accept commands via port 8889.
The Tello SDK includes three basic command types.
Control Commands (xxx)
Returns “ok” if the command was successful.
Returns “error” or an informational result code if the command failed.
Set Command (xxx a) to set new sub-parameter values
Returns “ok” if the command was successful.
Returns “error” or an informational result code if the command failed.
Read Commands (xxx?)
Returns the current value of the sub-parameters.
Even though Tello is pretty maneuverable, with a number of different axes on which we can control the drone, in this project, we will use the following commands.
- takeoff : Auto takeoff.
- land : Auto landing.
- up x : Ascend to “x” cm.
- down x : Descend to “x” cm.
- left x : Fly left for “x” cm.
- right x : Fly right for “x” cm.
- forward x : Fly forward for “x” cm.
- back x : Fly backward for “x” cm.
Please refer to the SDK for a full set of commands.
As a safety feature, if there is no command for 15 seconds, the Tello will land automatically.
Tello API
As we are using Arduino as the platform, we need an API that can translate our commands to UDP packets to be sent using the Arduino program.
TelloArduino is an Arduino library for controlling DJI Tello through ESP32 Module. This library controls the Tello by sending commands via UDP as mentioned in the SDK documentation.
- To download, enter the following command in the terminal (Mac/Linux) or command prompt Windows) or click the "
DOWNLOAD ZIP
" button.
$ git clone https://github.com/akshayvernekar/telloArduino.git
- Place the "tello" folder in your Arduino sketch folder/libraries/ folder. Now Restart the IDE.
- In your Arduino IDE, go to Sketch > Include Library > choose "tello" to include this library in your sketch.
Preparation of M5Stack module
A detailed guide on preparing the M5Stack module is provided here: Gesture Controlled Drone #3 : Preperation - M5Stack
M5Stack modules support programming in Arduino, Blockly language with UIFlow, Micropython.
Download Arduino IDE
- Open up your browser, and visit Arduino's official website.
- Download and install the version according to your operating system.
Install ESP32 Boards Manager
- Open up the Arduino IDE, and navigate to File -> Preferences -> Settings
- Add the following ESP32 Boards Manager URL to Additional Boards Manager: https://dl.espressif.com/dl/package_esp32_index.json
- Hit OK
- Navigate to Tools -> Board: -> Boards Manager
- Search ESP32 in the Boards Manager window, and click Install
Install M5Stack Library
- Open Arduino IDE, then Select Sketch->Include Library->Manage Libraries
- Search M5Stack and install it
For Windows machines, an additional USB to serial Driver needs to be installed.
Arduino port Configuration
- Choose the correct board, baud rate, and serial port.
- Once set up, you can upload our code from here: https://github.com/crisdeodates/Tello_Telegram_M5Stack_control
- Click Upload, to flash the code to the device
- Once successfully flashed, the M5Stack module will show the corresponding output on its display as well as Arduino Serial Monitor.
References:
https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20SDK%202.0%20User%20Guide.pdf
https://store.dji.com/product/tello
https://github.com/akshayvernekar/telloArduino
https://docs.m5stack.com/en/quick_start/m5core/m5stack_core_get_started_Arduino_Windows
https://www.arduino.cc/reference/en/libraries/m5stack/
https://shop.m5stack.com/products/fire-iot-development-kit?variant=16804798169178
Blog Series:
Telegram Controlled Drone #1 : Introduction
Telegram Controlled Drone #2 : Preparation - Drone and M5Stack module
Telegram Controlled Drone #3 : Preparation - Telegram Bot