Please check out Colin's implementation of a functional MQTT driver at https://forums.ni.com/t5/Community-Documents/MQTT-Driver-for-LabVIEW/ta-p/3561289. It exceeds the basic proof-of-concept stage of this client API and we recommend it if you would like to build applications using MQTT.
Aug 09, 2016:
After we got mentioned at NI Week (Thanks, Darren from DMC), I took some time to fix outstanding issues: Community member zazbot pointed out some bit parsing issues in "Sub_Read_Fixed_Header" and other VIs. See this helpful KB entry to explain some un-intuitive behavior. Also, I fixed "read published message" which was truncating strings twice.
As always, some bugs may remain. I have limited bandwith to perform more tests. So feedback is always welcome!
MQTT (Message Queue Telemetry Transport) is a lightweight TCP-based messaging protocol targeting M2M applications, monitoring and distributed IO applications. It allows high latency and/or constrained networks, typically found in such applications.
The goal is to target any embedded RIO device for such applications.
This set of VIs is functional for the MQTT protocol version 3.1.1. Its specification can be found here: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd01/mqtt-v3.1.1-csprd01.html
The MQTT infrastructure uses a Broker (server) to host "topics". Topics are of a hierarchical nature and can be named in a "URI" fashion: e.g. "SolarPlant1/Sensors/IrradiationSensor1“ to identify a specific data source. Clients can subscribe to topics and will receive updates when topics are updated from other clients (or servers). If they want to publish new data to topics, they can do so. There are different "Quality of Service" levels, allowing lossless or lossy transport, respectively.
From the mqtt web site:
Steps to Implement or Execute Code
Any platform you can program with LabVIEW that supports TCP/IP. If you encounter issues on Embedded platforms, please remove the Unicode conversion primitives in the "Build MQTT String" and "Read MQTT String" VIs, respectively.
Current status and what needs to be done
Currently, you should be able to get basic functionality for publishing and subscribing up and running quickly. I have not finished testing all QoS levels yet.
There is no active development for this API. Please refer to https://forums.ni.com/t5/Community-Documents/MQTT-Driver-for-LabVIEW/ta-p/3561289 for an enhanced MQTT driver.
The code is back up on Github: https://github.com/DAQIO/LVMQTT - feel free to contribute!
The code is licensed under the MIT license. Feel free to include it in your projects.
For cool IIoT solutions, check out our web site at www.daq.io
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.