kopia lustrzana https://github.com/micropython/micropython-lib
14 wiersze
280 B
Python
14 wiersze
280 B
Python
![]() |
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()
|