|
|
@@ -9,7 +9,7 @@ Used protocol for interaction: mqtt (paho-mqtt module) |
|
|
|
|
|
|
|
# imports |
|
|
|
import paho.mqtt.client as mqtt |
|
|
|
from software.defines import MQTT_BROKER_LOCAL, MQTT_BROKER_GLOBAL, Topics |
|
|
|
from software.defines import MQTT_BROKER_LOCAL, MQTT_BROKER_GLOBAL, Topics, BACKEND_CLIENT_ID |
|
|
|
from plantdatabase import PlantDataBase |
|
|
|
import data_functions |
|
|
|
|
|
|
@@ -64,7 +64,7 @@ def on_connect(client: mqtt.Client, userdata, flags, rc): |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
client = mqtt.Client() |
|
|
|
client = mqtt.Client(BACKEND_CLIENT_ID) |
|
|
|
client.on_connect = on_connect |
|
|
|
client.connect(MQTT_BROKER_GLOBAL) |
|
|
|
client.loop_forever() |