Skip to content

Wireless Plotter

Data visualization is an important tool for drone debugging. In this project, you will learn how to transmit the drone’s flight data back to the computer via Wi-Fi and plot curves in real-time.

  • Wi-Fi communication
  • UDP protocol
  • Data visualization
  • Python scripts
Item Quantity Notes
ESP32 Drone 1 -
Computer 1 With Python + Matplotlib installed
plotter.py 1 Data visualization script

Extract wifi_telemetry.zip and open with VS Code.

Open wifilink.c and find the wifilink_send_data function:

void wifilink_send_data(float altitude, float roll, float pitch, float yaw) {
// 1. Package data in JSON format
char buffer[256];
sprintf(buffer, "{\"alt\":%.2f,\"roll\":%.2f,\"pitch\":%.2f,\"yaw\":%.2f}",
altitude, roll, pitch, yaw);
// 2. Send to computer via UDP
struct sockaddr_in dest_addr;
dest_addr.sin_family = AF_INET;
dest_addr.sin_port = htons(8888);
dest_addr.sin_addr.s_addr = inet_addr("192.168.4.2"); // Computer IP
sendto(sock, buffer, strlen(buffer), 0,
(struct sockaddr*)&dest_addr, sizeof(dest_addr));
}

Compile and flash the code, power on the drone (it will create Wi-Fi hotspot: ESP-Drone).

Not downloaded yet? Download plotter.py — this is the script you run below.

Run plotter.py:

Terminal window
python plotter.py

Observe the altitude and attitude curves plotted in real-time on the computer.

Modify plotter.py to add “altitude anomaly alert”, displaying red warning in terminal when altitude change exceeds 0.5m/s.

  • Check if password is correct
  • Confirm drone is powered on
  • Check if IP address is correct
  • Confirm firewall settings

Congratulations! You have implemented the drone’s data visualization function, which is an important tool for debugging!

In the next project, you will learn how to achieve simple communication between two drones.

First published atdrone.imagrove.com/intermediate/telemetry/Please credit Imagrove and link back to this page when quoting or republishing.

Questions or issues with this tutorial?

Sign in with GitHub to leave a comment. If a step fails for you, tell us — we verify it and update the tutorial.

ImagroveMore ESP32 tutorials · ESP32 IoT Tutorial

© 2026 ESP32 Drone. All rights reserved.