Lab S07 — Tello Drone Telemetry to Splunk
Connect a physical DJI Tello drone, collect real-time flight telemetry with Python, and ingest it into Splunk for analysis.
Download Lab DocumentPrerequisites
Complete Lab S05 before starting this lab. VS Code and the Python environment must already be set up.
A physical DJI Tello drone with a charged battery is required for this lab.
A WiFi-capable Windows 10 machine is required to connect to the Tello's WiFi network.
Introduction
This lab moves from simulation to a real drone. You will connect to a physical DJI Tello drone over WiFi, collect live telemetry using the djitellopy library, and stream that data as JSON to Splunk Enterprise for analysis. This mirrors real-world IoT/edge telemetry pipelines used in drone security research.
djitellopy is a Python library for controlling DJI Tello drones. It abstracts the UDP socket communication protocol used by the Tello SDK, providing a simple Python API for flight commands and sensor data retrieval.
Python Environment Setup
Open VS Code and create a new project folder. To create a virtual environment, open the Command Palette (Ctrl+Shift+P), select Python: Create Environment, choose Venv, and select your Python interpreter. VS Code will create and activate the environment automatically. You can also select the interpreter from the bottom-right status bar.
Install the required dependencies:
Overview of the Tello_data_readfile.py script structure:
- First ~10 lines: imports and setup (drone IP, port, Splunk HEC endpoint)
- get_drone_data(): gathers telemetry — battery level, height, temperature, speed, acceleration, barometer, time of flight
- save_data_to_json(): writes telemetry as a JSON list
- main(): runs get_drone_data() then waits 1 second in a loop
- fly(): controls drone movement (takeoff, directional moves, land)
- Threading: data() and fly() run concurrently. With Tello, only one WiFi connection is allowed at a time so threading is critical.
Data Collection
Charge the Tello battery and power on the drone by pressing the button on the right side. Wait for the indicator lights to stabilize before proceeding.
Connect your Windows machine to the Tello's WiFi network. It will appear as "TELLO-XXXXXX" in the list of available networks.
Place the drone on a flat surface in a clear area. Run the Python script. If errors occur, check: room too dark, battery too low, or an obstacle too close.
While the drone flies, telemetry is logged to a JSON file. After landing, inspect the JSON output to confirm data was captured correctly.
Splunk Setup & Data Analysis
Log into Splunk Enterprise. Create a new index under (e.g., tello_data).
Connect the JSON file to Splunk via . Point to your JSON file, set sourcetype to _json, and assign to your tello_data index.
Confirm data is flowing — go to and run:
Explore telemetry events. Click "Show as raw text" to see original JSON formatting. The file monitoring will automatically pick up new data as subsequent flights are logged to the same JSON file.