diff --git a/umqtt.simple/example_pub.py b/umqtt.simple/example_pub.py new file mode 100644 index 00000000..c15d0764 --- /dev/null +++ b/umqtt.simple/example_pub.py @@ -0,0 +1,13 @@ +from umqtt.simple import MQTTClient + +# Test reception e.g. with: +# mosquitto_sub -t foo_topic + +def main(server="localhost"): + c = MQTTClient("umqtt_client", server) + c.connect() + c.publish(b"foo_topic", b"hello") + c.disconnect() + +if __name__ == "__main__": + main()