Add test code for using message pack with python mqtt

This commit is contained in:
Michael Pivato
2019-01-14 12:25:47 +10:30
parent 4c680b2b09
commit 137be4f25f

View File

@@ -1,6 +1,7 @@
import paho.mqtt.client as mqtt
import time
import ssl
import umsgpack
connected = False
@@ -38,6 +39,7 @@ pub = input("Enter something to publish: ")
while pub != 'q':
if(connected):
mqttc.publish('hello/test', pub)
pub = input("Enter something to publish: ")
print('Message is: ' + pub)