From 540d10bf786f0ef3bd0f1ef47c7c8195bee4c103 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 15 Oct 2024 22:48:26 +0200 Subject: [PATCH] Add README and start to work on build for prod guide --- README.md | 18 ++++++++++++++++- docs/SETUP_PROD.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 docs/SETUP_PROD.md diff --git a/README.md b/README.md index 73c49eb..c195a3e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ # SolarEnergy -WIP project +A project to optimize solar energy production and consumption. It connect to a current meter to decides whether some appliances controlled by relays shall be turned on or not, based on criterias such as: +* Minimal uptime +* Minimal downtime +* Daily minimal runtime +* Estimated consumption +* Dependencies, conflicts + +## Components +* [`central_backend`](./central_backend): The core component that connects all the other one and make the decisions to turn on or off devices +* [`central_frontend`](./central_frontend): Web UI to configure the devices and monitor them +* [`custom_consumtion`](./custom_consumption): Development tool used to test different production values +* [`esp32_device`](./esp32_device/): The code installed in the MCU that controls relays (Wt32-Eth01 devices) +* [`python_device`](./python_device/): An alternative to the esp32 to control relays. Not production ready. + +## Documentation +* [Setup for development](./docs/SETUP_DEV.md) guide +* [Setup for production](./docs/SETUP_PROD.md) guide \ No newline at end of file diff --git a/docs/SETUP_PROD.md b/docs/SETUP_PROD.md new file mode 100644 index 0000000..ba86d92 --- /dev/null +++ b/docs/SETUP_PROD.md @@ -0,0 +1,48 @@ +# Configure project for production + +## Create production build + +### Central +The production release of central backend and frontend can be realised on a computer which has NodeJS and Rust installed by executing the following command at the root of the project: + +```bash +make +``` + +The backend will be available at this location: + +``` +central_backend/target/release/central_backend +``` + +### Python device +The Python device isn't production ready yet. + + +### ESP32 device + +#### Flashing the device directly +Use the following commands to flash a device (inside ESP-IDF environnment): + +```bash +idf.py build +idf.py flash +``` + + +#### Getting an OTA update +Use the following command to build an OTA update: + +```bash +idf.py build +``` + +The OTA update is then located in `build/main.bin` + + +## Pre-requisites +* A server running a recent Linux (Debian / Ubuntu preferred) with `central` as hostname +* DHCP configured on the network + +## Configure server +TODO \ No newline at end of file