Commit f11b0e45 authored by Daniel Kolibár's avatar Daniel Kolibár
Browse files

added subscriptions to all relevant topics

parent 6cba8116
......@@ -111,7 +111,12 @@ app.add_middleware(
@mqtt.on_connect()
def connect(client, flags, rc, properties):
mqtt.client.subscribe("birdie/rxtx/from/raspberry") #subscribing mqtt topic
mqtt.client.subscribe("birdie/rxtx/from/raspberry")
mqtt.client.subscribe("birdie/temperature")
mqtt.client.subscribe("birdie/humidity")
mqtt.client.subscribe("birdie/windspeed")
mqtt.client.subscribe("birdie/smoke")
mqtt.client.subscribe("birdie/pressure")
print("Connected: ", client, flags, rc, properties, flush=True)
......@@ -123,7 +128,6 @@ async def message(client, topic, payload, qos, properties):
document = {'houseId': ObjectId(recevieddata["houseId"]), 'base64Data': recevieddata["data"]}
result = await DB.photos.insert_one(document)
print('result %s' % repr(result.inserted_id))
return 0
@app.get("/health", response_model=HealthResponse)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment