Skip to content

Path-Variable/os_smart_garden

Repository files navigation

IoT Monitoring System

A Docker-based IoT monitoring system that combines MQTT messaging, InfluxDB time-series database, and Grafana visualization for real-time data collection and monitoring.

Architecture

The system consists of the following components:

  • MQTT Broker (Eclipse Mosquitto)
  • InfluxDB time-series database
  • MQTT Publisher (Java-based)
  • MQTT to InfluxDB Scrapper
  • Grafana dashboard

Prerequisites

  • Docker and Docker Compose
  • Java Development Kit (JDK) for building custom images
  • Git

Setup

  1. Clone the repository
  2. Create the following secret files:
    • .env.influxdb2-admin-username
    • .env.influxdb2-admin-password
    • .env.influxdb2-admin-token
  3. Configure environment variables in .env file
  4. Build the custom Docker images:
    docker build -t mqtt-pub-java:latest ./mqtt-publisher
    docker build -t mqtt-influx-scrapper:latest ./mqtt-scrapper
  5. Start the services:
    docker-compose up -d

Environment Variables

Variable Description Default Value
INFLUXDB_ORG InfluxDB organization name pathvariable
INFLUXDB_BUCKET InfluxDB bucket name smartgarden
GRAFANA_USER Grafana admin username admin
GRAFANA_PASSWORD Grafana admin password adminpassword
MQTT_TOPIC MQTT topic to subscribe/publish nursery
INFLUXDB_TOKEN InfluxDB authentication token MyInitialAdminToken0==

Services

MQTT Broker (Mosquitto)

  • Port: 1884 (external), 1883 (internal)
  • Anonymous access enabled
  • Persistent storage for messages and logs

InfluxDB

  • Port: 8086
  • Secured with username/password
  • Data and config persistence

Grafana

  • Port: 3001 (external), 3000 (internal)
  • Pre-configured with InfluxDB data source
  • Customizable dashboards

Usage

  1. Access Grafana at http://localhost:3001
  2. Login with credentials from environment variables
  3. Configure InfluxDB data source if not auto-configured
  4. Create dashboards to visualize your IoT data

Data Flow

  1. IoT devices publish data to MQTT broker
  2. MQTT Scrapper subscribes to topics and forwards data to InfluxDB
  3. Grafana queries InfluxDB and displays data in dashboards

About

This is a demo of a concept called "The Open Source Smart Garden" created for a talk presented at Open South Code 2025

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published