Skip to content

Latest commit

ย 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒค๏ธ LegmaMiteo โ€” OpenWeather Station

Hippocratic License HL3-CL-ECO-LAW-MIL-SV Hardware Connectivity Power Cost Platform DB Dashboard Protocol GitHub Status

An open-source, modular, and scalable weather station network designed for real-time climate monitoring. Built with affordability and replicability in mind โ€” each unit costs under โ‚ฌ200 and can be deployed anywhere.

๐Ÿ‡ฎ๐Ÿ‡น Leggi in italiano


๐ŸŒ Why This Project

Climate change is increasing the frequency and intensity of severe convective weather โ€” supercells, hailstorms, tornadoes โ€” across Northern Italy. National forecast models (ARPA, ECMWF, ICON) run at spatial and temporal resolutions too coarse to nowcast these fast-developing, localized events: by the time a model grid cell updates, the storm has often already passed.

LegmaMiteo closes that gap with a dense, low-cost network of micro-meteorological stations built for nowcasting โ€” short-term, hyperlocal prediction โ€” focused initially on Lombardia. More stations means finer-grained, faster-updating ground truth than any single national model can provide, and an open dataset that grows with the community deploying it. Existing weather station networks are sparse, expensive, and often closed; LegmaMiteo aims to democratize severe weather monitoring by enabling anyone to build, deploy, and contribute data to a global open network.


๐Ÿ“Š Live Dashboard

Real-time and historical data from station-001, visualized in Grafana:

LegmaMiteo Grafana dashboard showing temperature, pressure


โœจ Features

  • Modular design โ€” base unit + swappable expansion modules
  • Dual connectivity โ€” WiFi (primary) + LoRa mesh (Phase 2, remote areas)
  • Solar powered โ€” fully autonomous, no grid required
  • Self-hosted โ€” your data stays on your server
  • Open data โ€” all measurements publicly accessible via REST API
  • Under โ‚ฌ200 per unit โ€” affordable and replicable worldwide

๐Ÿงฉ Modules

Module Sensors Use Case Status
BASE SHT45, MCP9808, BMP580, VEML7700, MLX90614ESF, Rain gauge, Anemometer + wind vane Everywhere โœ… Deployed (station-001)
MOD-AIR PMS5003/PMS7003, SCD41 Urban / Industrial ๐Ÿšง Dashboard ready, firmware WIP
MOD-STORM AS3935 Storm monitoring ๐Ÿšง Dashboard ready, firmware WIP
MOD-HYDRO Ultrasonic level, flow sensor, turbidity Rivers / Flood zones ๐Ÿ“‹ Planned
MOD-SOIL Capacitive moisture x3, DS18B20 Agriculture / Forest ๐Ÿ“‹ Planned
MOD-SNOW VL53L1X, load cell, DS18B20, OV2640 Mountain / Alpine ๐Ÿ“‹ Planned
MOD-FIRE Flame IR, MQ-7, MQ-2 Mediterranean / Forest ๐Ÿ“‹ Planned
MOD-NOISE MEMS microphone SPH0645 Urban / Industrial ๐Ÿ’ก Concept
MOD-RAD ML8511 UV, Geiger tube High altitude ๐Ÿ’ก Concept

BASE sensor notes: SHT45 provides high-precision humidity (ยฑ1.0% RH) plus a secondary temperature channel (ยฑ0.1ยฐC) for cross-check; MCP9808 (ยฑ0.25ยฐC) is the primary dedicated temperature sensor. BMP580 (ยฑ0.06 hPa) handles pressure. MLX90614ESF is sky-pointing IR temperature, used as a cloud-cover proxy. A true pyranometer (RS485 solar radiation module or Apogee SP-110/SP-212) is evaluated as a future addition โ€” VEML7700 only covers visible-light irradiance. BME280 units seen in early photos are leftover stock, not part of the final BOM.

MOD-STORM note: hail is not detected via a dedicated piezo sensor โ€” rejected due to false positives from birds, snow, and debris impacts. It's inferred server-side from pressure tendency + humidity + lightning activity + wind gust data instead.

MOD-AIR note: SCD41 chosen over SCD40 specifically for single-shot measurement mode, compatible with the deep sleep power architecture.


๐Ÿ—๏ธ Architecture

[ESP32-S3 Station]
      โ”‚
      โ”œโ”€โ”€ WiFi โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ [MQTT Broker]
      โ”‚                                      โ”‚
      โ””โ”€โ”€ LoRa (Phase 2) โ”€โ”€โ–ถ [RPi ChirpStack Gateway] โ”€โ”€โ”˜
                                             โ”‚
                                       [Telegraf]
                                             โ”‚
                                       [InfluxDB]
                                             โ”‚
                                       [Grafana]
                                             โ”‚
                                       [REST API]

Module connector โ€” SP13 IP68 8-pin

All expansion modules connect to the base unit via a standardized waterproof SP13 IP68 8-pin connector with the following pinout:

Pin Signal
1 VCC 3.3V
2 VCC 5V
3 GND
4 I2C SDA
5 I2C SCL
6 UART TX
7 UART RX
8 GPIO / Interrupt

Physical layout (mast, top to bottom)

Anemometer (top, max wind exposure, no obstructions above)
   โ”‚
Sensor head (MLX90614ESF + VEML7700, unobstructed zenith view)
   โ”‚
Radiation shield (SHT45 + MCP9808, naturally ventilated, shaded)
   โ”‚
Rain gauge (leveled horizontal, clear of overhead obstructions)
   โ”‚
Solar panel (60โ€“70ยฐ tilt, south-facing, unshaded)
   โ”‚
Main enclosure (electronics + battery, accessible for maintenance)

๐Ÿ› ๏ธ Hardware Stack

  • MCU: ESP32-S3-DevKitC-1 (ESP32-S3-WROOM-1-N16R8, 16MB flash / 8MB PSRAM)
  • Connectivity: WiFi 802.11 b/g/n (active) + LoRa 868MHz via external SX1262/SX1276 module (Phase 2, planned)
  • Power: 30W solar panel (60โ€“70ยฐ tilt) + LiFePO4 battery (EVE LF32/LF40 or IFR32700) + MPPT charge controller (CN3791, LiFePO4-modified for 3.65V float)
  • Enclosure: IP65/IP67 waterproof junction box + multi-plate radiation shield (temperature/humidity sensors)
  • Module connector: SP13 IP68 8-pin (JST-XH 8-pin internal)

๐Ÿ’ป Server Stack

  • MQTT Broker: Mosquitto (TLS via Let's Encrypt, password authentication)
  • Time-series DB: InfluxDB 2.7 (org legmamiteo, bucket stations, separate forecast bucket for NWP ingestion)
  • Visualization: Grafana
  • Bridge: Telegraf
  • REST API: FastAPI (Python)
  • Remote access: Tailscale Funnel
  • All containerized: Docker Compose

๐ŸŒ REST API

The public REST API exposes real-time and historical data from all stations.

Base URL: http://localhost:8000 (or your Tailscale Funnel URL)

Endpoint Description
GET / API info
GET /health Health check
GET /stations/ List all active stations
GET /stations/{id} Station metadata
GET /data/{id}/latest?module=base Latest reading from a station
GET /data/{id}/history?field=temperature&range_hours=24 Historical data
GET /data/{id}/alerts Active alert conditions

Example โ€” latest data from station-001:

curl http://localhost:8000/data/station-001/latest
{
  "success": true,
  "station_id": "station-001",
  "module": "base",
  "data": {
    "temperature": 29.7,
    "humidity": 61.8,
    "pressure": 1017.6,
    "lux": 63261.0,
    "wind_speed": 29.2,
    "wind_direction": 51.0,
    "rain_mm": 1.2
  }
}

Full interactive documentation at /docs (Swagger UI).

Data is released under CC BY-NC 4.0. AI/ML training use is prohibited without explicit written permission.


๐Ÿ”” Alert System

Grafana-based alerting with Telegram notifications. Active alert rules:

Alert Condition Severity
๐ŸŒก๏ธ High Temperature temperature > 35ยฐC Warning
๐Ÿ˜ท Critical PM2.5 pm25 > 55 ยตg/mยณ (WHO threshold) Critical
๐Ÿญ High CO2 co2 > 1000 ppm Warning
โšก Lightning Nearby lightning_distance < 10 km Critical (immediate)
๐ŸŒฉ๏ธ Rapid Pressure Drop pressure drop > 3 hPa / 30 min Warning (storm incoming)

๐Ÿš€ Getting Started

Option 1 โ€” Standalone server package (recommended)

The fastest way to get a server running on a Raspberry Pi, Linux box, or Windows PC โ€” no manual Docker setup needed. Download the latest release package, which includes an installer that generates secure random credentials for you automatically:

๐Ÿ‘‰ Latest release

# Linux / Raspberry Pi
tar -xzf LegmaMiteo-server.tar.gz
cd LegmaMiteo-server
chmod +x install.sh
./install.sh
# Windows (PowerShell, with Docker Desktop running)
Expand-Archive LegmaMiteo-server.zip
cd LegmaMiteo-server
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install.ps1

The installer prints the generated admin credentials and URLs at the end โ€” save them somewhere safe.

Option 2 โ€” Clone the full repo (for development)

git clone https://github.com/Dragonyx118/LegmaMiteo
cd LegmaMiteo/server
docker compose up -d

Then open:

โš ๏ธ This path does not generate credentials automatically. Set your own INFLUXDB_ADMIN_PASSWORD, GRAFANA_ADMIN_PASSWORD, and INFLUX_TOKEN in a server/.env file before running docker compose up โ€” never commit real credentials to the repo. See server/telegraf/telegraf.conf.example and firmware/base/*/src/secrets.h.example for the files you need to copy and fill in locally.

Firmware

Documentation coming soon.

Hardware

Schematics and PCB files coming soon.


๐Ÿ“ก Data Policy

All data collected by this network is released under Creative Commons Attribution-NonCommercial 4.0.

The following uses are strictly prohibited:

  • Military or defense applications
  • Weapons systems or targeting
  • Mass surveillance or individual profiling
  • AI/ML training without explicit written permission
  • Any use intended to cause harm to people or communities

See DATA_POLICY.md for full details.


๐Ÿค Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting pull requests.

By contributing you agree to uphold the ethical guidelines of this project.


๐Ÿ“„ License

This project is licensed under the Hippocratic License HL3-CL-ECO-LAW-MIL-SV โ€” see LICENSE for details.

Modules included:

  • CL โ€” Copyleft
  • ECO โ€” Ecocide
  • LAW โ€” Law Enforcement
  • MIL โ€” Military Activities
  • SV โ€” Mass Surveillance

๐Ÿ‘ค Author

Dragonyx โ€” built with โค๏ธ for the planet.

About

Open-source modular weather station network for real-time climate monitoring, built on ESP32 with WiFi/LoRa connectivity and self-hosted data infrastructure.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages