kopia lustrzana https://github.com/micropython/micropython-lib
umqtt.simple: Add example for publishing over SSL.
rodzic
d3d0b4f0b5
commit
6f9131e59a
|
@ -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, ssl=True)
|
||||||
|
c.connect()
|
||||||
|
c.publish(b"foo_topic", b"hello")
|
||||||
|
c.disconnect()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Ładowanie…
Reference in New Issue