museebolo / climat_guardian

Système de surveillance climatique
GNU General Public License v3.0
0 stars 4 forks source link

[Info]: <> ( All the information that are likely to need to be updated have a comment above them like this one )

Climate-Guardian

This project was made for the non-profit organization memoires-informatiques\ Memoires-informatiques has a lot of old computers and other electronic devices that need to be stored in a controlled environment\ The goal of this project is to monitor the temperature and humidity of the different rooms of the organization and to display the data on a web interface

Documentation and development

If you are interested in contributing or want to make specific configuration changes, don't hesitate to check the documentation. You will find information to set up the development environment, architecture considerations and some details to correctly use the tooling.

! Warning, the doc’s folder is a work in progress. For the moment, you can still find the old documentation below.

Setup

From now on, the computer that runs the docker will be called "server" and the computer used by the user will be called "computer"

Network

The server and the esp need to be connected to the same network, it is recommended to give both of them a static ip address\ The computer can be connected from any network as long as the network has open ports, otherwise you'll have to be on the same network as the server

hardware\ software

Requirements

For this project to work you need to have the following installed on the server:

Installation

First thing you need to do is to clone the repository from GitHub on the server

git clone https://github.com/museebolo/climat_guardian.git
cd climat-guardian

-- [Info]: <> ( This is the list of all the files that end with .example ) Once the repository is cloned you can remove the .example at the end of the following files:


Now you want to generate a secret key for the jwt tokens used by the api

sed -i '/JWT_SECRET/d' .env
echo "JWT_SECRET=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 32)" >> .env

You may also want to generate a random password for the database

sed -i '/POSTGRES_PASSWORD/d' .env
echo "POSTGRES_PASSWORD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 32)" >> .env

It is recommended to let the other environment variables as they are


Finally, you have to fill the Wi-Fi credentials in esp32/config/secrets.yaml\ You also have to change the 127.0.0.1 in esp32/config/secrets.yaml by the ip address of the server

Start the project

Once everything is configured on the server, you can start the project by running the docker compose on the server

docker compose -f docker-compose.prod.yml up -d --remove-orphans --build

Once the docker is running you can access the web interface by going to the ip address of the server in the web browser of the computer\ the default user is admin and has admin as password, it is recommended to create a new user and delete the default one once you are connected, you can do so under the Users tab

Dashboard Plan Users Esp page

ESP 32 Installation

This project uses esp home to manage the esp32, you can configure the esp32 by following the instructions below