mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 04:14:58 +00:00
changed sensor data to db in other function
This commit is contained in:
@@ -120,7 +120,9 @@ def database():
|
||||
cursor.close()
|
||||
return str(rows)
|
||||
|
||||
def sensor_data(kobuki_message):
|
||||
|
||||
@app.route('/data', methods=['GET'])
|
||||
def data():
|
||||
try:
|
||||
# Parse de JSON-string naar een Python-dictionary
|
||||
data = json.loads(kobuki_message)
|
||||
@@ -153,12 +155,10 @@ def sensor_data(kobuki_message):
|
||||
print(f"JSON decode error: {e}")
|
||||
except mysql.connector.Error as err:
|
||||
print(f"Database error: {err}")
|
||||
|
||||
@app.route('/data', methods=['GET'])
|
||||
def data():
|
||||
return kobuki_message
|
||||
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def image():
|
||||
global processed_image
|
||||
|
Reference in New Issue
Block a user