Un serveur pour le FabLab - YunoHost ?

Installer un serveur yunohost.org sur un Raspberry pour les besoins du FabLab : Projets d'IoT Projets de robotique Groupe de travail IA

Installer un serveur avec la distribution Linux YunoHost

Configurer un HotSpot Wifi

https://www.raspberrypi.com/documentation/computers/configuration.html#use-your-raspberry-pi-as-a-network-bridge

Ajouter du SWAP

sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=4096
...
CONF_MAXSWAP=4096
sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Impérativement régler la swappiness à 1 sinon la carte SD va mourir prématurément 

Raspberry 5 avec NVME

Serveur d'impression 3D - Octoprint - Home Assistant

Lancement d'une impression

Depuis Bambu Studio

image.png

Pour voir comment ajouter une imprimante à BambuStudio via Octoprint :

https://innovation.iha.unistra.fr/books/3-fablab-machines-techniques/page/bambu-studio#bkmrk-autre-imprimante-via 

Depuis un navigateur

image.png

Installation de Octoprint

Nous avons vu comment installer un serveur YunoHost sur une Raspberry Pi

On souhaite maintenant installer plusieurs instances de Octoprint pour pouvoir piloter à distance plusieurs imprimantes 3D

Vérification que le système tourne :

● ender3v2a.service - The snappy web interface for your 3D printer
     Loaded: loaded (/etc/systemd/system/ender3v2a.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-06-20 09:17:48 CEST; 25min ago
   Main PID: 51985 (octoprint)
      Tasks: 14 (limit: 779)
        CPU: 1min 33ms
     CGroup: /system.slice/ender3v2a.service
             └─51985 /home/fan_admin/OctoPrint/bin/python3 /home/fan_admin/OctoPrint/bin/octoprint serve --config=/home/fan_admin/.ender3v2a/config.yaml --basedir=/home/fan_admin/.ender3v2a --port=XXXXXX

A condition d'avoir bien ouvert le port XXXXXX dans le pare-feu YunoHost

Démarrage automatique du service systemd au démarrage de la Raspberry :

Redémarrage du service au bout de 5s lorsqu'il échoue :

[Service]
Restart=on-failure
RestartSec=5s

Exposition d'Octoprint sur le réseau local via YunoHost :

image.png

image.png

Exposition d'Octoprint sur le net via YunoHost :

Vous vous exposez à des attaques, sécurisez les comptes et vérifiez les droits d'accès avant de réaliser cela

image.png

image.png

image.png

Installation de Klipper


Moyens informatiques

Synthèse

cf. https://innovation.iha.unistra.fr/books/1-fablab-vos-projets/page/adressage-ip-du-reseau-du-fablab#bkmrk-synth%C3%A8se-des-moyens- 

PC

Double-écran en salle A1-TP06

L'idée c'est de brancher un all-in-one comme écran secondaire du all-in-one voisin pour avoir 2 écrans. C'est pratique d'avoir 2 écrans quand on fait du VirtualBox et qu'on veut suivre de la doc' à côté. Voyons comment faire ça avec 2 Dell Optiplex 7470 en A1TP06 ?

Sur le all-in-one qui a besoin d'un écran externe : brancher le câble sur le port HDMI "normal"

Sur le all-in-one qui doit servir d'écran externe :

PS C:\Users\install> .\Dell-On-Screen-Display-Application_PRGT0_WIN_1.0.4.0_A02_03.EXE /help
PS C:\Users\install> A02
Dell On-Screen Display Application, 1.0.4.0, A02

General Usage:
Dell-On-Screen-Display-Application_PRGT0_WIN_1.0.4.0_A02_03.exe [/<option1>[=<value1>]] [/<option2>[=<value2>]]...
See listing below for <option> and <value> information.

NOTE:If the folder name contains space, double quotes should be given for folder name
EXAMPLE:/s /e="c:\Folder Name"

Option - Description:
---------------------
(none) - Display of graphical user interface for guided installation/update or extraction.

/? or /h - Displays this  Update Package usage information.

/s - Suppresses all graphical user interfaces of the  Update Package.

/e=<path> - Extraction of update contents to a folder.
(NOTE: Requires /s option)

/passthrough ... - (Advanced) Sends all text following the /passthrough option directly to the vendor install software of the  Update Package. This mode suppresses any  provided graphical user interfaces, but not necessarily those of the vendor software.

/factoryinstall /passthrough (vendor command line parameter) - (Advanced) (commnad line parameters) will be passed to vendor installer directly without parsing MUP.xml. Post installation, If the vendor installer returns REBOOT_REQUIRED or REBOOT_UPDATE_PENDING, it will be turned to SUCCESS.

/l=<path> - Define a specific path for the  Update Package log file.
(NOTE: This option can NOT be used in combination with /passthrough)


Example(s):
---------------------
Update the system silently
Dell-On-Screen-Display-Application_PRGT0_WIN_1.0.4.0_A02_03.exe /s

Extract the update contents to the folder C:\mydir\
Dell-On-Screen-Display-Application_PRGT0_WIN_1.0.4.0_A02_03.exe /s /e=C:\mydir

Pass command line arguments directly to vendor installer.
Turn the return code to success if required
Dell-On-Screen-Display-Application_PRGT0_WIN_1.0.4.0_A02_03.exe /factoryinstall /passthrough D:\Sample.xml C:\log\FI.log

Change from the default log location to C:\my path with spaces\log.txt
Dell-On-Screen-Display-Application_PRGT0_WIN_1.0.4.0_A02_03.exe /l="C:\my path with spaces\log.txt"

Réseau

Serveurs

Gestion parc informatique avec GLPI

Pour gérer les PC Ubuntu du FAN et les PC Windows de CréaBot, on installe le logiciel GLPI avec Fusion Inventory :

Source : https://openclassrooms.com/fr/courses/1730516-gerez-votre-parc-informatique-avec-glpi/5994176-installez-le-plugin-et-l-agent-fusioninventory 

Autre approche avec Ansible

https://github.com/richlamdev/ansible-desktop-ubuntu 

Serveur de colocation d'Alsace Réseau Neutre

Fab-Manager

Configuration

Automatisation de la publication des projets de Fab-Manager vers Facebook

https://fabmanager.csc49.fr/#!/projects/publication-des-projets-fabmanager-sur-le-site-du-bocal-et-la-page-facebook

Ancien serveur hébergé Unistra

docker compose down
docker compose up -d
root@fan-manager:/apps/fabmanager# cat /usr/local/sbin/renew.sh
#!/bin/bash
certbot renew --dry-run -n > /tmp/renewornot 2>&1
if grep -Fxq 'Cert not due for renewal, but simulating renewal for dry run' "/tmp/renewornot"
then
	echo "Certificat non arrivé à échéance...pas d'action"
else
	echo "Renouvellement du certicat..."	
	cd /apps/fabmanager/
	docker-compose down
	cd /apps/fabmanager/letsencrypt/etc/live/fan-manager.di.unistra.fr
	#certbot -n --renew-by-default --domain fan-manager.di.unistra.fr 
	certbot renew --post-hook "systemctl stop nginx"
	cd /etc/letsencrypt/archive/fan-manager.di.unistra.fr
	ls -Art | tail -n 4 |sort > /tmp/letslist
	declare -a lets_array
	lets_array=(`cat "/tmp/letslist"`)
	cp -f /etc/letsencrypt/archive/fan-manager.di.unistra.fr/${lets_array[0]} /apps/fabmanager/letsencrypt/etc/archive/fan-manager.di.unistra.fr/cert198.pem
	cp -f /etc/letsencrypt/archive/fan-manager.di.unistra.fr/${lets_array[1]} /apps/fabmanager/letsencrypt/etc/archive/fan-manager.di.unistra.fr/chain198.pem
	cp -f /etc/letsencrypt/archive/fan-manager.di.unistra.fr/${lets_array[2]} /apps/fabmanager/letsencrypt/etc/archive/fan-manager.di.unistra.fr/fullchain198.pem
	cp -f /etc/letsencrypt/archive/fan-manager.di.unistra.fr/${lets_array[3]} /apps/fabmanager/letsencrypt/etc/archive/fan-manager.di.unistra.fr/privkey198.pem
	cd /apps/fabmanager/
	killall nginx
	docker-compose up -d
fi
exit