diff --git a/src/server/installer.png b/src/server/installer.png new file mode 100644 index 0000000000000000000000000000000000000000..2dfb7055ab72d6a8e716723eed5164ed9cdab352 Binary files /dev/null and b/src/server/installer.png differ diff --git a/src/server/readme.md b/src/server/readme.md index d16ffa524cacc9936527198145b038bd7adb4e25..63121b9836a82d5089e3f76684f65b8f20a9c2c5 100644 --- a/src/server/readme.md +++ b/src/server/readme.md @@ -1,22 +1,57 @@ -# This documents how to run the server on a Raspberry PI (3B) +# Server documentation + +For simple use and installation, the server services are empacted into a docker-compose. There will be containers for: +- mosquitto (MQTT broker) +- Nodered (No code web based programming tool) + +> The first 2 steps can be skipped if you're using an other server and dont need to install raspbian and docker. (You'll only need docker, docker-compose ) ## Install raspbian on the PI We need to install a linux on the PI. Download the Raspberry PI Imager on [https://www.raspberrypi.com/software/](https://www.raspberrypi.com/software/) -or on Ubuntu with : + +- Select the base raspbian image or similar (needs to be debian based for the exact commands to work) +- Select your SD card +- Configure Wifi and ssh for simpler use (Click on the bot right gear) +- Write + + + + + + +## Install Docker and docker compose on the PI +Source : [https://docs.docker.com/engine/install/raspbian/](https://docs.docker.com/engine/install/raspbian/) + + ```bash -sudo apt-install rpi-imager -``` +sudo apt-get update +sudo apt-get install ca-certificates curl gnupg + +sudo install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +sudo chmod a+r /etc/apt/keyrings/docker.gpg -https://docs.docker.com/engine/install/raspbian/ +echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/raspbian \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +sudo systemctl enable docker +``` + +Test the installation : +```bash +sudo docker run hello-world +``` + ## Install and run -Install docker-compose Go into the server directory, you should have this file structure: ```bash @@ -54,19 +89,4 @@ docker-compose down Get into the container's shell: ```bash docker exec -it server bash -``` - -https://nodered.org/docs/user-guide/runtime/adding-nodes -``` -package.json # Additonnal packages -flows.json # the normal place Node-RED store your flows -flows_cred.json # credentials your flows may need -settings.js # your settings file -``` - -Add a npm package - -Install image processing tool: -```bash -npm install node-red-contrib-image-tools ``` \ No newline at end of file