readme code blocks
This commit is contained in:
parent
9c9277b346
commit
a05a943af2
46
README.md
46
README.md
|
|
@ -3,53 +3,53 @@
|
|||
We build a robot with raspberry and arduino.
|
||||
|
||||
## Checkout Repo
|
||||
cd /opt
|
||||
git checkout https://git.dyn.mcf.at/Max/helva-robot.git
|
||||
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 apt update
|
||||
sudo apt install -y nginx python3 python3-venv
|
||||
|
||||
sudo mkdir -p /opt/face
|
||||
sudo chown -R $USER:$USER /opt/face
|
||||
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
|
||||
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/
|
||||
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
|
||||
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/
|
||||
sudo ln -s /opt/helva-robot/face/etc/nginx/sites-available/face /etc/nginx/sites-enabled/
|
||||
|
||||
### Restart nginx
|
||||
sudo systemctl 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
|
||||
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 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
|
||||
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
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now face.service
|
||||
sudo systemctl status face.service --no-pager
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue