portfolio/Wi-Fi Latency Tracker

Wi-Fi Latency Tracker

Building a production-ready IoT monitoring system because real-time data visualization is sometimes insanely useful.

Raspberry Pi Pico WInfluxDBGrafanaDockerC Language

What This Really Demonstrates

Sure, this project measures Wi-Fi latency. But that's not the point. The point is building a complete end-to-end IoT data pipeline that actually works in production. This is the kind of system companies need when they want to monitor thousands of devices in real-time-whether it's network performance, industrial sensors, or environmental data.

I built this to show I understand the entire stack: embedded firmware that collects metrics with microsecond precision, reliable data transmission over wireless protocol, time series database usage, containerized infrastructure deployment, and real-time visualization dashboards.

The architecture is hardware-agnostic by design. I used Pico W to measure Wi-Fi latency, but it could be an ESP32 reading temperature sensors in a warehouse, or a custom board monitoring industrial equipment. The data pipeline stays the same. For the infrastructure side, thanks to Docker it is rather easy to setup InfluxDB and Grafana, it may be even prepared to build up and get used out-of-the-box. Everything can be built up using one automation script and server starts listening to incoming data instantly after build is done.

Project Goal: Design a system that moves data reliably from point A to point B, implement real-time data visualization, and deploy it in a way that scales.

The Complete Pipeline

  • Custom ICMP Implementation - Implemented my own ping in C with microsecond-precision timing
  • Hardware Integration - Direct ADC access for temperature monitoring (example payload data)
  • Resilient Networking - Exponential backoff and automatic reconnection
  • Production Infrastructure - Containerized services with Docker Compose that you can deploy anywhere in a short time
  • Real-Time Visualization - Custom Grafana dashboards showing data flowing from sensor to screen in real-time
  • Portable Design - Hardware abstraction means this works with any WiFi-capable microcontroller

Building Blocks

The Data Journey

Here's what happens every five seconds:

  • 1. Measure - Custom ICMP echo requests measure round-trip time to router with microsecond precision. Temperature read from internal ADC.
  • 2. Calculate - Firmware computes min/max/average RTT, jitter, and packet loss statistics from multiple ping attempts.
  • 3. Transmit - Data formatted in InfluxDB line protocol and sent via HTTP POST over WiFi. Retries with exponential backoff if network fails.
  • 4. Store - InfluxDB ingests metrics into time series database, indexed by timestamp and host tags for efficient queries.
  • 5. Visualize - Grafana queries InfluxDB and renders real-time graphs showing latency trends, packet loss, and temperature correlations.

Why This Data Model Works

Time series databases aren't just fancy SQL with timestamps. The schema design matters. I use tags for metadata (host identifier) and fields for actual measurements. This means queries are fast even with millions of data points, and you can aggregate across multiple devices efficiently.

Hardware & Architecture

I used a Raspberry Pi Pico W for this implementation because it's cheap, well-documented, and has built-in WiFi. And, by a coinsidence, I already had one, so I didn't need to buy MCU for this project. But the code is structured so you could swap it for an ESP32, STM32 with WiFi module, or any other platform. The hardware-specific parts are isolated- WiFi init, ADC reading, and timing functions. Everything else is portable C.

What makes this architecture scalable:

  • Stateless firmware - Each measurement is independent. If the device reboots, it just starts measuring again. No state to corrupt.
  • Server-side logic - Data processing happens in InfluxDB/Grafana. Firmware stays simple and reliable.
  • Standard protocols - HTTP, ICMP, line protocol. Nothing proprietary that breaks when you upgrade.
  • Modular infrastructure - Docker Compose means you can run this on a Raspberry Pi or scale to a Kubernetes cluster with the same config.

Tech Stack

Embedded Layer

  • Pico SDK - Official SDK with LWIP network stack
  • CYW43 Driver - WiFi chip firmware integration
  • Raw Sockets - ICMP implementation

Infrastructure

  • InfluxDB - Purpose-built time series database
  • Grafana - Production-grade visualization platform
  • Docker Compose - Containerized deployment
  • HTTP/REST - Standard protocols for data ingestion

Data Pipeline

  • Line Protocol - InfluxDB's efficient format
  • Real-time Streaming - Continuous data flow

Reliability

  • Exponential Backoff - Smart retry logic
  • Auto-reconnection - WiFi resilience