MQTT Vanilla Client

In case it is helpful to anyone, I have been developing a free MQTT client module based on the HiveMQ client libraries. It is relatively early development, but already it is able to connect to a TLS secured username/password authenticated MQTT broker and reproduce the namespace as packets arrive. I intend to keep working on this, add more features/authentication options in order to extend the free options for edge driven datasources.

5 Likes

So, question about adding some features to this:

Currently the module does Subscribe only to a topic. Based on the fact that MQTT is designed as a report by exception system and really only reports changes to specific topics, I am inclined to implement the Publish function as a scripting function only.
My thoughts on this are based on the way that modules are set up to do tag writes: Get a notification that some tags in the provider have changed, then scan through all the tags to find out what has changed, then send that over the chosen driver/protocol.
Given that tag writes are normally triggered by an Ignition event, and you call system.tag.writeBlocking() to change the tag, why not just call something like mqqtClient.publish(), as there may not even be an existing tag where you publish the data?

Does this make sense?