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