mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
Merge branch 'main' into 'OpenCV'
# Conflicts: # src/Python/flask/web/app.py # src/Python/flask/web/static/script.js
This commit is contained in:
@@ -3,6 +3,7 @@ import paho.mqtt.client as mqtt
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
kobuki_message = "empty"
|
||||
def on_message(client, userdata, message):
|
||||
global kobuki_message, latest_image
|
||||
if message.topic == "kobuki/data":
|
||||
@@ -10,11 +11,10 @@ def on_message(client, userdata, message):
|
||||
elif message.topic == "kobuki/cam":
|
||||
latest_image = message.payload
|
||||
|
||||
|
||||
# Create an MQTT client instance
|
||||
mqtt_client = mqtt.Client()
|
||||
mqtt_client.username_pw_set("server", "serverwachtwoordofzo")
|
||||
mqtt_client.connect("localhost", 1884, 60)
|
||||
mqtt_client.connect("localhost", 80, 60)
|
||||
mqtt_client.loop_start()
|
||||
mqtt_client.subscribe("kobuki/data")
|
||||
mqtt_client.subscribe("kobuki/cam")
|
||||
@@ -49,6 +49,7 @@ def move():
|
||||
def data():
|
||||
return kobuki_message
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def image():
|
||||
global latest_image
|
||||
@@ -58,6 +59,13 @@ def image():
|
||||
return "No image available", 404
|
||||
|
||||
|
||||
@app.route('/phpmyadmin/<path:path>')
|
||||
def phpmyadmin_passthrough(path):
|
||||
# Laat Apache deze route direct afhandelen
|
||||
return "", 404
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, port=5000)
|
||||
|
7
src/Python/wsgi.py
Normal file
7
src/Python/wsgi.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import sys
|
||||
import logging
|
||||
|
||||
logging.basicConfig(stream=sys.stderr)
|
||||
sys.path.insert(0, "/home/ishak/rooziinuubii79/src/Python/flask/web")
|
||||
|
||||
from app import app as application
|
Reference in New Issue
Block a user