forked from emilevs/label_printer
Add install guide
This commit is contained in:
parent
152b2fffb9
commit
d40a59af89
1 changed files with 52 additions and 0 deletions
52
README.md
Normal file
52
README.md
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
# Setup
|
||||||
|
On a raspberry pi:
|
||||||
|
|
||||||
|
## Install
|
||||||
|
from the home directory:
|
||||||
|
|
||||||
|
`git clone https://code.techinc.nl/emilevs/label_printer.git`\
|
||||||
|
`sudo apt install python3-flask`\
|
||||||
|
`sudo apt install golang`
|
||||||
|
|
||||||
|
(there might be more dependencies, I wasn't starting from a clean raspbian install when testing this)
|
||||||
|
|
||||||
|
navigate into the label_printer directory
|
||||||
|
|
||||||
|
run `make` to build the go library
|
||||||
|
|
||||||
|
`cp label_printer.service to /etc/systemd/system/`
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo systemctl enable label_printer
|
||||||
|
sudo systemctl start label_printer
|
||||||
|
```
|
||||||
|
|
||||||
|
The interface will now be running on localhost:5000, which we need to route to the outside world in the next step
|
||||||
|
|
||||||
|
## Setup the nginx
|
||||||
|
sudo apt install nginx
|
||||||
|
edit /etx/nginx/sites-available/default and change the contents of:
|
||||||
|
```
|
||||||
|
location / { }
|
||||||
|
```
|
||||||
|
|
||||||
|
to:
|
||||||
|
|
||||||
|
```
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:5000;
|
||||||
|
proxy_redirect http://127.0.0.1:5000 $scheme://$host:5000;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo systemctl restart nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setup static ip on the pi
|
||||||
|
edit `/etc/dhcpcd.conf` and add:
|
||||||
|
```
|
||||||
|
static ip_address=10.209.10.2/24
|
||||||
|
static routers=10.209.10.254
|
||||||
|
static domain_name_servers=10.209.10.255
|
||||||
|
```
|
Loading…
Reference in a new issue