06-14-2023 06:22 AM - edited 06-14-2023 06:23 AM
Hello,
I am new to labview and to the world of IoT. I would like some guidance to understand the possibility of M2M MQTT connectivity to labview.
For my application, I am using a Bosch device where I am acquiring data and publishing the data via MQTT onto cloud (Akenza.io) utilising its dashboard.
What I would like to do is stream the acquired data from the Bosch device to labview so that the data can be used for other use cases.
What I am hoping for is:
- guidance on how to structure this with labview
- example code to assist
- is it possible to connect labview directly to the Bosch or do I need another device (if so, myRIO preferred) to act as the broker and subscriber to be able display the data to labview with minimum latency?
Any suggestions is much appreciated
06-14-2023 01:14 PM
The MQTT protocol requires a broker, and as far as I know doesn't do peer-to-peer streaming. That said, you can always run your broker on the same machine as LabVIEW, so it'll effectively act that way.
There are at least one or two MQTT libraries for LabVIEW (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kKAcSAM). Try googling "LabVIEW MQTT" for some examples, there's plenty out there.
Right now you're using an online broker, which LabVIEW could connect to and acquire data. I'd recommend getting that working first (since it already works with your sensor) then trying to start up your own broker. I have used the "Mosquitto" broker on Linux and it works well, and I think it runs in Windows as well.
Try getting your LabVIEW program to talk to Akenza, then once that works, try getting your broker set up and your IoT device talking to your broker. I use "MQTT Explorer" to connect to my broker and get a view of the data going into it. You can get it to connect to Akenza as well, just to make sure you're comfortable with it.
Anyway, once your IoT device works with your broker (and is confirmed using MQTT Explorer), then you can have LabVIEW connect to your broker as well and receive some data.