Initial Commit. Connects to MQTT and listens for assigned topics.
This commit is contained in:
18
main.py
Normal file
18
main.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
|
||||
def on_message(client, userdata, message):
|
||||
print(str(message.payload.decode("utf-8")))
|
||||
|
||||
|
||||
mqttBroker = 'icyn30.duckdns.org'
|
||||
mqttPort = 1888
|
||||
|
||||
client = mqtt.Client("Notifer")
|
||||
|
||||
client.connect(mqttBroker, mqttPort)
|
||||
|
||||
client.subscribe("/Test/test")
|
||||
client.on_message = on_message
|
||||
|
||||
client.loop_forever()
|
||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
paho-mqtt==1.5.1
|
||||
Reference in New Issue
Block a user