Skip to content

Docker hosted project do to IoT with MQTT, NodeRED, Grafana and a dynamic website all backed up in Maria and Influx DB

License

Notifications You must be signed in to change notification settings

TheToto318/IoT_stack

Repository files navigation

Welcome to IoT_Stack 👋

Version Documentation Maintenance License: MIT

Stack of Docker containers that generate metrics values of buildings for visualization with Grafana and a HTML/PHP/JS dynamic website

Project details

Project scripts are based in the fallowing languages/tools :

  • Dynamic website : HTML/PHP/JS
  • Metrics generator script : Bash
  • MQTT metric parser : PHP and NodeRed
  • Databases :
    • NodeRed : InfluxDB 1.8
    • Dynamic website : MariaDB

This project was made for an final assesement exam the 'SAE 23' of the BUT Réseaux et Télécoms by four students of the Blagnac college.

All the services are dockerized, images are pre-provisionned :

  • Grafana : Dashboard (set as default), data sources, administrator user (sae23) and password.
  • NodeRED : Flow
  • mariadb : 'sae23' database, 'sae23' user and password
  • influxdb : 'capteurs' database, 'grafana' user and password
  • apache : Dynamic website
  • mosquitto_broker : Mosquitto server and metric generator script.
  • cron : MQTT metric parser

Images are stored in our Docker Hub repository : https://hub.docker.com/r/totorx/sae23

Workflow

Workflow

Install with docker-compose

Follow this guide if you don't have docker-compose installed : https://docs.docker.com/compose/install/

git clone https://github.com/TheToto318/IoT_stack.git
cd IoT_stack
docker-compose up -d

Uninstall with docker-compose

From the project root folder :

docker-compose down

Default credentials

  • Grafana :
    • User : sae23
    • Password : grafana23
  • InfluxDB :
    • Hostname : influxdb
    • Database : capteurs
    • User : grafana
    • Password : grafana23
  • NodeRED :
    • User : sae23
    • Password : nodered23
  • MariaDB :
    • Hostname : db
    • Database : sae23
    • User : sae23
    • Password : sae23pass
  • Dynamic website :
    • Administrator :
      • User : Admin
      • Pass : 4d?m17nisTt?r4!a0n
    • Manager 1 (RT building) :
      • User : Gestio-1
      • Password : C0u5r?sc745e!
    • Manager 2 (CS building) :
      • User : Gestio-2
      • Password : 4dm1nn?srt!0n
    • Manager 3 (GIM building) :
      • User : Gestio-3
      • Password : G7iM5n14s?ti!

Usage

Services are accessible by the following ports :

  • Grafana : 3000 (TCP)
  • NodeRed : 1880 (TCP)
  • PHPMyAdmin : 1140 (TCP)
  • Apache : 4443 (TCP)

Debugging

Find the service name in the docker-compose.yml file and run :

docker-compose -f logs <service_name>
eg: docker-compose -f logs db

Or with the container name :

docker logs -f <container_name>
eg: docker logs -f logs db

Grafana dashboard

Grafana dashboard

Specs

Adaptative dashboard including :

  • New panel for each buildings
  • Filter by :
    • Sensors type
    • Building
    • Floor
    • Room
  • Direct, Min, Max and Average values of all sensors type.
  • Graphs for all sensors type.

Dynamic website

Web management page

Specs

  • Overview of the last metrics for all users.

  • Manager credentials, only able to see their associated building.

  • Administrator user with following rights :

    • Add/delete building with associated manager credentials.
    • Add/delete sensors.
  • Manager page inlude :

    • Tables with metrics history.
    • Line graph for all type of values.
    • Statistics including average, minimum and maximum.
  • Other functionalities :

    • Admin and manager session to stay connected after login.

Flow NodeRED

Flow NodeRED

Specs

  • Listen to all topics (iut/#)
  • Parsing :
    • Sensor type
    • Building
    • Floor
    • Room
  • Add unit to value.
  • Insert value into the matching measurement table

phpMyAdmin dashboard ( sae 23 database )

phpmyadmin

sae23 database table specs

  • 'Administration' : Admin user and password (MD5 encrypted).
  • 'Batiment' : Building name, login and password for the building manager (MD5 encrypted).
  • 'capteur' : Sensors type, building, floor, room, MQTT topic
  • 'mesure' : measure date and time
  • 'valeur' : value returned by sensors

Tables are linked by the fallowing foreign_key :

  • 'valeur': id_mesure and id_capteur with 'id' column of table 'mesure' and 'capteur'.
  • 'capteur' : 'batiment' column with the 'id' column of the 'batiment' table.

conceptor_view

Author

👤 Thomas Roux (Backend developper)

👤 Clement Roques (Frontend developper)

👤 Mattieu Naissant (Frontend developper)

👤 Mathias Chauvet (Frontend developper)

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2022 Thomas Roux.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

Docker hosted project do to IoT with MQTT, NodeRED, Grafana and a dynamic website all backed up in Maria and Influx DB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •