Python: Publishing messages to MQTT topic

MQTT is almost a must for everyone who’s interested in home automation. I must admit, I’m reblogging this as much to share with everyone, as to be able to find it easily myself later! I’ve connected using a library on an ESP8266, but not from Python. That’s something that I was planning to figure out anyways…it will make propagating a unified date/time to all of the devices on the network that don’t have access to NTP in an easy way…like ESP8266, arduino, etc, for one thing. And that’s just off the top of my head! If it works for MicroPython as well, then it’s even more useful.


The objective of this post is to explain how to connect to a MQTT broker and post some messages to a topic, using Python.

View original post 976 more words


1 thought on “Python: Publishing messages to MQTT topic”

  1. It’s really a very useful protocol with the advantage of having a low overhead, and from the tests I’ve been doing it works reliably. That is a nice application you mentioned, never thought about that. Thanks for sharing, I will post some more related content soon 🙂

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s