Skip to content

renato0307/grow

Repository files navigation

Grow

Plant monitoring system.

Uses Raspberry PIs, NATS, and Prometheus.

How

Collects information about plants and soil moisture.

Publishs the collected data into a NATS cluster.

Processes the information and displays it with Prometheus/Grafana.

Structure

  • charts - helm charts from this repository (more info here)
  • go-fibergateway-gr241ag - Go client for the Altice Fiber Gateway GR241AG
  • ingestion-service - service to ingest readings from NATS jetstream
  • k8s - setups a k8s cluster to run NATS and Prometheus
  • monitor-ghm - monitor running on raspberry pi with Pimonori Grow HAT Mini (GHM)
  • router-config-controller - K8s controller to automatically expose cluster ports in the Altice Fiber Gateway

Useful NATS commands

What Command
Stream summary nats --server nats://192.168.1.131:4222 stream report
Delete stream nats --server nats://192.168.1.131:4222 stream rm PlantReadings
List stream consumers nats --server nats://192.168.1.131:4222 consumer ls PlantReadings
Delete stream consumer nats --server nats://192.168.1.131:4222 consumer rm PlantReadings PlantReadingsIngestion

TODO

Milestone 1 - home plants

  1. Send data to NATS server/jetstreams
  2. Consume jetstream messages and publish to prometheus
  3. Dinamic configuration of the sensors
  4. Show data on Grafana
  5. Calibrate sensors
  6. Alarms for plants with low soil moisture
  7. Loadbalancer and external IP for NATS
  8. NATS security (TLS, auth, etc.)
  9. Mobile/Slack notifications
  10. IaC for K8s cluster (FluxCD)

Milestone 2 - remote monitoring

  1. Acquire Raspberry Pico or ESP32, basic sensors, batery and GSM module
  2. Basic monitor
  3. Configure NATS to support MQTT
  4. Comunication MQTT via GSM
  5. Deep sleep
  6. Measure consumptions and batery life
  7. Batery life optimizations

Build

Helm charts

The chart releaser action is used to release helm charts.

Check the workflow file at .github/workflows/helm-release.yaml.

Docker images

Each service has its own versioning.

We use GitVersion to automatically generate new versions using SemVer.

Each service contains a GitVersion.yml file and a release action.

Example for the ingestion service:

  • ingestion-service/GitVersion.yml
  • .github/workflows/ingestion-service-release.yaml