IOTinker & Zerno
Zerno Zerno
Hey IOTinker, I’ve been thinking about adding a smart irrigation system to the fields—soil moisture sensors, weather‑based watering. Maybe we can sketch out a simple network diagram that actually saves water and keeps the soil happy. What do you think?
IOTinker IOTinker
Sure thing, let’s keep it on‑prem and not let the clouds decide how many gallons you use. Field sensors (soil‑moisture, rain gauge) → local MQTT broker on a Pi → gateway node that aggregates data and runs a small rule engine. Gateway → local database (SQLite) and a Grafana dashboard you can access via LAN. Rule engine: if moisture < 30% and no rain in last 24h, trigger solenoid valve for 5 minutes. Everything stays behind the firewall, no API keys, no cloud. Just a tidy diagram and a couple of scripts that run on a timer. Want the YAML snippet to get you started?
Zerno Zerno
Sounds good, IOTinker. That setup keeps the water under control without the fuss of cloud services. Go ahead and send over the YAML, I’ll see how it fits with the old‑school Pi we’ve got.
IOTinker IOTinker
Here’s a barebones YAML you can drop straight into a `docker-compose.yml` on your Pi. Just replace the placeholder IPs and ports with the ones you’re using. ``` version: '3.8' services: mqtt-broker: image: eclipse-mosquitto:2 container_name: mosquitto restart: unless-stopped ports: - "1883:1883" volumes: - ./mosquitto/config:/mosquitto/config - ./mosquitto/data:/mosquitto/data gateway: image: alpine:latest container_name: irrigation_gateway restart: unless-stopped command: sh -c "apk add --no-cache mosquitto-clients && \ while true; do mosquitto_sub -h mqtt-broker -t 'field/+/moisture' -t 'field/rain' | grep -E '^sensor' && echo 'evaluate'; sleep 60; done" depends_on: - mqtt-broker dashboard: image: grafana/grafana:latest container_name: grafana restart: unless-stopped environment: - GF_SECURITY_ADMIN_USER=admin - GF_SECURITY_ADMIN_PASSWORD=admin ports: - "3000:3000" ``` Add your own rule engine logic in the gateway container or replace that `command` with a small Python/Node script that checks moisture levels, rain history, and publishes to a topic like `field/act/irrigate`. Happy saving water!
Zerno Zerno
That looks pretty solid, IOTinker. I’ll swap out the placeholder IPs, make sure the volumes point to the right config files, and run that compose. If the rule engine needs a tweak, we’ll write a quick script and put it in the gateway container. Thanks for the heads‑up—water savings is what it’s all about.