anpassungen
This commit is contained in:
parent
96116536a6
commit
7a05e0eede
10
kamera_server.py
Normal file
10
kamera_server.py
Normal file
@ -0,0 +1,10 @@
|
||||
from flask import Flask
|
||||
kamera_server = Flask(__name__)
|
||||
|
||||
@kamera_server.route("/")
|
||||
def first_function():
|
||||
return "<html><body><h1 style='color:red'>I am hosted on Raspberry Pi !!!</h1></body></html>"
|
||||
|
||||
if __name__ == "__main__":
|
||||
kamera_server.run(host='0.0.0.0')
|
||||
|
@ -57,4 +57,39 @@ source bin/activate
|
||||
Wenn alles geklappt hat, befindet man sich jetzt in der virtuellen Python Umgebung und kann dort die benötigten Module installieren
|
||||
|
||||
```
|
||||
pip install rpi.gpio
|
||||
pip install rpi.gpio flask uwsgi
|
||||
deactivate
|
||||
```
|
||||
|
||||
### streaming-kamera klonen
|
||||
|
||||
```
|
||||
cd /opt/kamera
|
||||
git clone https://git.jgz-energie.net/ENERGIE/streaming-kamera.git
|
||||
|
||||
Außerhalb der virtuellen Umgebung kann das Programm mit `/opt/kamera/bin/python /opt/kamera/streaming-kamera/kamera.py gestartet` werden.
|
||||
|
||||
Der uWSGI-Server kann mit `/opt/kamera/bin/uwsgi --socket 0.0.0.0:8000 --protocol=http -w server:first_app`, wenn man sich in dem Arbeitsverzeichnis (/opt/kamera/streaming-kamera) befindet.
|
||||
|
||||
### Service für uWSGI anlegen
|
||||
|
||||
/opt/kamera/uwsgi_config.ini
|
||||
|
||||
```
|
||||
[uwsgi]
|
||||
|
||||
chdir = /opt/kamera/streaming-kamera
|
||||
module = kamera_server:server
|
||||
|
||||
master = true
|
||||
processes = 1
|
||||
threads = 2
|
||||
|
||||
uid = kamera
|
||||
gid = kamera
|
||||
socket = /tmp/sample_app.sock
|
||||
chmod-socket = 664
|
||||
vacuum = true
|
||||
|
||||
die-on-term = true
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user