99 lines
2.1 KiB
ReStructuredText
99 lines
2.1 KiB
ReStructuredText
Déploiement — Raspberry Pi
|
|
==========================
|
|
|
|
Prérequis
|
|
---------
|
|
|
|
- ``sshpass`` installé (``sudo apt install sshpass`` ou ``brew install sshpass``)
|
|
- ``rsync`` disponible
|
|
- Pi accessible via réseau (BlueOS Ethernet ou WiFi)
|
|
- Credentials par défaut : ``pi`` / ``raspberry``
|
|
|
|
Script deploy
|
|
-------------
|
|
|
|
.. code-block:: bash
|
|
|
|
bash scripts/deploy_pi.sh <IP_DU_PI>
|
|
# Exemple :
|
|
bash scripts/deploy_pi.sh 192.168.2.2
|
|
|
|
Le script effectue :
|
|
|
|
1. Test de connectivité SSH
|
|
2. ``rsync`` de ``/src/`` vers ``/home/pi/slam_stereo/src/``
|
|
3. ``rsync`` de ``/config/`` vers ``/home/pi/slam_stereo/config/``
|
|
4. Installation pip des dépendances Python
|
|
5. Redémarrage du service Flask (si systemd configuré)
|
|
|
|
Installation manuelle
|
|
---------------------
|
|
|
|
.. code-block:: bash
|
|
|
|
ssh pi@<IP_PI>
|
|
|
|
# Installer dépendances système
|
|
sudo apt update
|
|
sudo apt install -y python3-pip python3-opencv libopencv-dev
|
|
|
|
# Installer dépendances Python
|
|
pip3 install flask numpy pyyaml opencv-python
|
|
|
|
# Copier les fichiers (depuis PC)
|
|
rsync -av src/ pi@<IP_PI>:/home/pi/slam_stereo/src/
|
|
rsync -av config/ pi@<IP_PI>:/home/pi/slam_stereo/config/
|
|
|
|
Service systemd (optionnel)
|
|
-----------------------------
|
|
|
|
Créer ``/etc/systemd/system/slam-stereo.service`` sur le Pi :
|
|
|
|
.. code-block:: ini
|
|
|
|
[Unit]
|
|
Description=SLAM Stereo Flask Interface
|
|
After=network.target
|
|
|
|
[Service]
|
|
User=pi
|
|
WorkingDirectory=/home/pi/slam_stereo
|
|
ExecStart=/usr/bin/python3 src/interface/app.py
|
|
Restart=always
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|
|
.. code-block:: bash
|
|
|
|
sudo systemctl enable slam-stereo
|
|
sudo systemctl start slam-stereo
|
|
|
|
Vérification
|
|
------------
|
|
|
|
.. code-block:: bash
|
|
|
|
# Depuis le Pi
|
|
curl http://localhost:5000/
|
|
|
|
# Depuis le réseau
|
|
curl http://<IP_PI>:5000/
|
|
|
|
# Logs Flask
|
|
journalctl -u slam-stereo -f
|
|
|
|
Notes BlueOS
|
|
------------
|
|
|
|
BlueOS expose le Pi sur ``192.168.2.2`` par défaut (connexion USB-Ethernet).
|
|
En WiFi, l'IP est assignée par DHCP.
|
|
|
|
Pour trouver l'IP :
|
|
|
|
.. code-block:: bash
|
|
|
|
# Depuis BlueOS web UI : Settings → Network
|
|
# Ou scan réseau :
|
|
nmap -sn 192.168.2.0/24
|