esp_routes_basic and server comm

This commit is contained in:
derlole
2025-04-17 12:33:11 +00:00
parent 58f9d3b451
commit f8cf645325
5 changed files with 32 additions and 16 deletions

View File

@@ -37,6 +37,7 @@
from flask import Flask
from flask_socketio import SocketIO
from routes.unsecure_routes import unsecure
from routes.esp_routes import esp
@@ -47,6 +48,7 @@ socketio = SocketIO(app, cors_allowed_origins="*", async_mode='threading')
# Blueprint registrieren
app.register_blueprint(unsecure)
app.register_blueprint(esp)
# Simuliere regelmäßige Daten-Updates
import threading
@@ -55,7 +57,7 @@ import time
def send_data():
counter = 0
while True:
print(f"Sending data: {counter}")
#print(f"Sending data: {counter}")
data = {
'test': 'Live-Daten',
'status': 'OK',
@@ -71,4 +73,4 @@ thread.daemon = True
thread.start()
if __name__ == '__main__':
socketio.run(app, host='0.0.0.0', port=5000)
socketio.run(app, host='0.0.0.0', port=3060)