|
|
|
|
|
|
|
|
|
|
|
|
|
|
# imports |
|
|
# imports |
|
|
import paho.mqtt.client as mqtt |
|
|
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 |
|
|
from plantdatabase import PlantDataBase |
|
|
import data_functions |
|
|
import data_functions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
def main(): |
|
|
client = mqtt.Client() |
|
|
|
|
|
|
|
|
client = mqtt.Client(BACKEND_CLIENT_ID) |
|
|
client.on_connect = on_connect |
|
|
client.on_connect = on_connect |
|
|
client.connect(MQTT_BROKER_GLOBAL) |
|
|
client.connect(MQTT_BROKER_GLOBAL) |
|
|
client.loop_forever() |
|
|
client.loop_forever() |