A portable weather station built on ESP32 that reads temperature and humidity from a DHT11 sensor, connects to WiFi, and sends data to a Flask web server for visualization and storage.
- Full-Stack Telemetry: An end-to-end system capturing, storing, and visualizing real-time sensor data.
- High-Performance Firmware: Built in Embedded Rust (no_std) on an ESP32 for robust, async operation.
- Time-Series Database: Persists all historical data using a Python Flask API and SQLite.
- Live Data Dashboard: A web-based frontend that visualizes both live and historical temperature/humidity data.
- Robust & Efficient: Implements deep sleep for power conservation and a watchdog task to ensure high availability.
The live dashboard displays:
- Current readings - Real-time temperature (in °C and °F) and humidity percentage
- Temperature chart - Historical temperature trends with live updates
- Humidity chart - Historical humidity trends with live updates
- Auto-refresh - Charts update every 5 seconds to show the latest data
- Microcontroller: ESP32
- Sensor: DHT11 (temperature & humidity)
- Communication: WiFi
- Built with Rust using Embassy async runtime and esp-hal
- Reads DHT11 sensor for temperature and humidity
- Connects to WiFi via DHCP
- Sends weather data to the backend server via HTTP
- Implements deep sleep between readings to conserve power
- Includes watchdog task to detect and recover from connection hangs
- Simple Flask server that receives weather data
- Persistent SQLite database stores all weather readings with timestamps
- Provides REST API endpoints:
GET /- Web UI showing latest readingsPOST/GET /data- Send/retrieve weather dataGET /history- Retrieve historical data as JSON
- Rust toolchain with esp32 support
- Python 3.12+ (for Flask server)
Set WiFi credentials, server IP address, and build:
$env:SSID="YourWiFiSSID"
$env:PASSWORD="YourPassword"
$env:SERVER_IP="192.168.1.100" # IP of your Flask backend (local or public)
cargo run --releaseOr on Linux/macOS:
SSID="YourWiFiSSID" PASSWORD="YourPassword" SERVER_IP="192.168.1.100" cargo run --releaseEnvironment Variables:
SSID: WiFi network name to connect to (required)PASSWORD: WiFi password (required)SERVER_IP: IP address of the Flask backend server (default:172.20.10.2)
Install dependencies and run:
python -m venv venv
venv\Scripts\activate # or: source venv/bin/activate
pip install flask
python server.pyThe server will start on http://localhost:5000 and listen on all network interfaces (0.0.0.0:5000).
Database:
- Weather data is automatically stored in a SQLite database (
weather_data.db) - The database is created automatically on first run
- Historical data persists across server restarts
- Each reading includes temperature, humidity, and timestamp
Finding Your Flask Backend IP Address:
To configure the ESP32 firmware with the correct server IP, you need to find your machine's IP address:
Windows (PowerShell):
ipconfig
# Look for "IPv4 Address" under your active network connectionLinux/macOS:
hostname -I # Linux
ifconfig # macOSUse this IP address as the SERVER_IP environment variable when building the firmware.


