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