mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 11:55:00 +00:00
change port of mqtt flask
This commit is contained in:
@@ -3,7 +3,6 @@ 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":
|
||||
@@ -11,10 +10,11 @@ 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", 80, 60)
|
||||
mqtt_client.connect("localhost", 1884, 60)
|
||||
mqtt_client.loop_start()
|
||||
mqtt_client.subscribe("kobuki/data")
|
||||
mqtt_client.subscribe("kobuki/cam")
|
||||
@@ -49,7 +49,6 @@ def move():
|
||||
def data():
|
||||
return kobuki_message
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def image():
|
||||
global latest_image
|
||||
|
Reference in New Issue
Block a user