C++ Arduino port of the MicroPython pump controller in old/, built with PlatformIO for ESP32.
- Web UI with preset durations (30 min – 6 hr) and arbitrary minutes (1–1440)
- While running: only the STOP button is shown
- Pump on/off status from hardware sense pin
- Elapsed and remaining time while running
- Last run duration and calendar-relative time (today / yesterday / N days ago) via NTP
- Last-run history persisted in NVS across reboots
- Cron-friendly HTTP API (
scripts/)
- ESP32 (DOIT devkit v1)
- Pump control: GPIO 18 (active low)
- Pump status sense: GPIO 4 (low = running)
| Method | Path | Body | Description |
|---|---|---|---|
| POST | /pump-on |
{"time": 90} |
Run for N minutes |
| POST | /pump-off |
— | Stop pump |
| GET | /pump-status |
— | JSON: running, remaining, elapsed, last |
Copy src/example-config.h to src/config.h and edit your WiFi, static IP, NTP, and timezone settings. config.h is gitignored.
pio run
pio run --target upload
pio run --target uploadfs # required for web UI in data/
pio device monitorShell scripts in scripts/ call http://olcc-pump/pump-on with {"time": <minutes>}. The 2d/3d variants check /pump-status and only run if the last watering was 2 or 3 days ago.
Deployed MicroPython version: old/main.py with static files in old/www/. Kept for reference; new deployments should use this C++ tree.