1.3 KiB
1.3 KiB
Helva Roboter
We build a robot with raspberry and arduino.
Checkout Repo
cd /opt
git checkout https://git.dyn.mcf.at/Max/helva-robot.git
Raspberry Face
Install Packages
sudo apt update
sudo apt install -y nginx python3 python3-venv
sudo mkdir -p /opt/face
sudo chown -R $USER:$USER /opt/face
python3 -m venv /opt/face/venv
/opt/face/venv/bin/pip install --upgrade pip
/opt/face/venv/bin/pip install fastapi uvicorn
Exchange Nginx Web-Folder
sudo rm -r /var/www/html
sudo ln -s /opt/helva-robot/face/var/www/html/ /var/www/
Permissions of Webfolder
sudo chown -R www-data:www-data /var/www/html
Nginx Vhost
sudo ln -s /opt/helva-robot/face/etc/nginx/sites-available/face /etc/nginx/sites-enabled/
Restart nginx
sudo systemctl restart nginx
Test Face Server
In Browser: http://pi-ip/
From Somewhere:
curl -X POST http://pi-ip/api/emotion/happy
curl -X POST http://pi-ip/api/emotion/angry
curl -X POST http://pi-ip/api/emotion/sleepy
systemd Service
sudo ln -s /opt/helva-robot/face/etc/systemd/system/face.service /etc/systemd/system/
sudo chown -R www-data:www-data /opt/face
sudo chmod -R 755 /opt/face
Start: sudo systemctl daemon-reload sudo systemctl enable --now face.service sudo systemctl status face.service --no-pager