Intermediate Drone Splunk

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.

~60 min Windows 10 + Physical Tello Drone 5 Sections
Download Lab Document
Progress
0 / 5

Prerequisites

1

Complete Lab S05 before starting this lab. VS Code and the Python environment must already be set up.

2

A physical DJI Tello drone with a charged battery is required for this lab.

3

A WiFi-capable Windows 10 machine is required to connect to the Tello's WiFi network.

Introduction

Lab Description

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

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

1

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.

2

Install the required dependencies:

pip install wheel pip install djitellopy
3

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.
Tello_data_readfile.py script structure

Data Collection

1

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.

2

Connect your Windows machine to the Tello's WiFi network. It will appear as "TELLO-XXXXXX" in the list of available networks.

3

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.

Tello drone flight and script running
4

While the drone flies, telemetry is logged to a JSON file. After landing, inspect the JSON output to confirm data was captured correctly.

JSON telemetry output after flight

Splunk Setup & Data Analysis

1

Log into Splunk Enterprise. Create a new index under Settings → Indexes (e.g., tello_data).

Creating tello_data index in Splunk
2

Connect the JSON file to Splunk via Settings → Data Inputs → Files & Directories → New Local File & Directory. Point to your JSON file, set sourcetype to _json, and assign to your tello_data index.

Splunk data input configuration for JSON file
3

Confirm data is flowing — go to Search & Reporting and run:

index="tello_data" sourcetype="_json"
Tello telemetry events in Splunk search
4

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.

Raw JSON telemetry in Splunk