Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.32 KB

File metadata and controls

59 lines (40 loc) · 1.32 KB

Home Sense

IoT sensor monitoring system built with Rust. Reads temperature and humidity data from an ESP32 device and stores it in a backend server.

Project Structure

  • firmware/ - ESP32 embedded Rust firmware
  • backend/ - Axum HTTP server with SQLite database
  • frontend/ - Svelte web interface (in development)

Hardware Requirements

  • ESP32 development board
  • SHT3x temperature/humidity sensor
  • SSD1306 OLED display (128x64)
  • I2C connections on GPIO21 (SDA) and GPIO22 (SCL)

Setup

Backend

cd backend
cargo run

Server runs on http://localhost:3000

Firmware

  1. Install ESP Rust toolchain:

    # Follow instructions at https://esp-rs.github.io/book/installation/index.html
  2. Configure WiFi and server settings:

    cd firmware
    cp .env.example .env
    # Edit .env with your WiFi credentials and backend IP
  3. Flash to ESP32:

    cargo run --release

API Endpoints

  • POST /reading - Submit sensor reading (JSON: {"temperature": float, "humidity": float})
  • GET /reading/latest - Get most recent reading

How It Works

The ESP32 firmware reads sensor data every 10 seconds, displays it on the OLED screen, and posts it to the backend server over WiFi. The backend stores all readings in a SQLite database with timestamps.

License

MIT