07 — Install the project and run it as a service
Clone, configure start.sh, install the systemd unit, and prove that the build you see is the build you deployed.
Get the code
git clone https://github.com/<org>/vorsa-inspect ~/vorsa-m3
cd ~/vorsa-m3
chmod +x start.sh
(Until the repository is public: copy the project folder with scp -r to ~/vorsa-m3.)
Developers on Windows: sync.ps1 transfers vorsa/ and tools/ to the Pi and prints the version marker on both sides; watch.ps1 does it on every file change. Root files (start.sh, vorsa.service, the setup scripts) go once by scp.
start.sh — what it sets
source ~/akida-env/bin/activate
export VORSA_BAND=relais # sim (default) | relais (12 V relay, GPIO 18) | echt (L298N driver)
export VORSA_ARM=uno # RAMPS/Arduino on USB
# export VORSA_ARM_PORT=/dev/ttyACM1 # if the Arduino appears elsewhere
# export VORSA_ARM_URL=http://<pi4>:8000 # external arm server instead of VORSA_ARM
exec python3 tools/run_web.py
No belt, no arm: comment out both export lines. run_web.py options worth knowing: --port 8080, --anzeige 960 (live image edge in pixels; larger is sharper and slower), --daten vorsa_daten (where classes, photos, learned state, zones and recipes live), --synthetisch (no camera).
Run it once by hand
./start.sh
Expected: the console lists camera, cards ("Hardware: {'akida': …, 'karten': 4 …}"), the build string, and "Beenden mit Strg+C". Open http://<pi-ip>:8080. The footer shows BUILD 1.9.37-lernrahmen (or whatever you deployed).
The build string is your deployment proof. Three of our test runs were wasted because code never reached the Pi; since then the footer, sync.ps1 and watch.ps1 all show the version, and a mismatch means "stop, nothing you observe is meaningful".
Install as a service
Edit vorsa.service: User=<user>, WorkingDirectory=/home/<user>/vorsa-m3, ExecStart=/bin/bash /home/<user>/vorsa-m3/start.sh. Then:
sudo cp ~/vorsa-m3/vorsa.service /etc/systemd/system/vorsa.service
sudo systemctl daemon-reload
sudo systemctl enable --now vorsa
sudo systemctl status vorsa
Expected: active (running). The unit waits 8 s before starting (cameras and cards are sometimes late at boot) and restarts on failure.
Useful:
journalctl -u vorsa -f # live log
sudo systemctl restart vorsa # after every code update
sudo systemctl stop vorsa # before tools that need the cards exclusively (akida_report.py)
Optional: reset button without a password
The UI's "Reset card" writes to sysfs. Allow it without a password (sudo visudo):
<user> ALL=(root) NOPASSWD: /usr/bin/tee /sys/bus/pci/devices/*/remove, /usr/bin/tee /sys/bus/pci/rescan
Update routine
cd ~/vorsa-m3 && git pull
sudo systemctl restart vorsa
Browser: hard reload (Ctrl+Shift+R). Check the footer build string. Learned state, zones, recipes and empty-belt references live in vorsa_daten/ and survive updates.
Checkpoint: systemctl status vorsa is green, the UI opens from another machine, the footer build string equals the deployed version.
