buildroot/support/testing/tests/package/sample_python_paho_mqtt.py

13 lines
280 B
Python

from paho.mqtt import publish, subscribe
publish.single(
'buildroot/test',
payload="Hello, World!",
qos=2,
retain=True,
hostname="localhost",
port=1883)
message = subscribe.simple('buildroot/test')
print(message.payload.decode())