LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MQTT subscribe client on Labview

My goal is to wirelessly collect data from a standalone platform and enable real-time viewing of that data on various devices, including a PC running LabVIEW. A setup where it would allow for the data to be displayed on a dashboard and enables further analysis by plotting and conducting additional analysis using LabVIEW on the PC.

 

The IoT sensor I am using for this set up is XDK110 from Bosch. The sensor is programmed using 'XDK workbench', it acquires and sends the data (publisher) to the Akenza server (broker) - I have managed to get this working. The data collected from the XDK device can be viewed and accessed on the Akenza.io platform. 

 

What I would like to do next is get the data I am collecting onto LabVIEW. I have tried MQTT method to connect labview with the akenza platbut not able to establish a connection. Please find the attached program I have used.

 

If anyone has any insight as to alternative methods on how to get the data from the Bosch sensor to LabVIEW directly, or using the online broker (akenza.io) and establish connection to LabVIEW, it would be much appreciated.

 

Thanks in advance.

 

Download All
0 Kudos
Message 1 of 13
(1,696 Views)

It looks like Akenza has some specific details for connecting, including some authentication/encryption/etc. Check out this article:

 

https://docs.akenza.io/akenza.io/tutorials/add-devices/how-to-integrate-an-arduino-device-via-mqtt-o...

 

If you're running a local broker, you could disable that stuff which might make things simpler. I like the mosquitto broker but haven't really looked at other options.

 

(Also, you'll get more traction if you use File -> Save for Previous to backsave to 2020 or so. Not everyone has 2023 yet)

0 Kudos
Message 2 of 13
(1,649 Views)

Thank you for your reply.

 

Please find the attached, I have tried to save it to a previous version of LabVIEW.  

 

I was hoping to use akenza as my broker and subscribe from LabVIEW. 

 

The shared link from akenza is the preliminary part of my task - taking readings from the sensor device (Bosch XDK110) and sending to the akenza platform. I have achieved this section of the task via Bosch's own platform, XDK-Workspace.

 

The next is setting up a client on LabVIEW to subscribe to akenza (broker). Not able to get this working on LabVIEW.

 

Apologies if my understanding of this is wrong

0 Kudos
Message 3 of 13
(1,639 Views)

I don't have the MQTT client installed but are you getting error messages or anything when you try to connect? In your code it looks like you're connecting to localhost, which means you're connecting to your own broker, not akenza. Getting that URL and port right will be your first challenge.

 

Any chance your toolkit includes an example "subscribe" program?

0 Kudos
Message 4 of 13
(1,620 Views)

In MQTT_subscriber.vi, you are creating a server, not a client.

 

Looking at the akenza MQTT docs, you should provide username and password.

 

There is also a part on how to get the let'sencrypt certificate needed for akenza 🙂

 

I cannot check if this is working, but it should be "more working" than before.

Message 5 of 13
(1,609 Views)

The MQTT toolkits can be found on the VI package manager.

 

I have attached a sample subscriber vi. available from the package

Message 6 of 13
(1,568 Views)

Seems to be 'more working' as you have mentioned, but still facing errors.

 

I have attached a screenshot of the error code

0 Kudos
Message 7 of 13
(1,566 Views)

I did a test with RabbitMQ a couple of years ago, it was surprisingly easy to get to work. I just ran the example and changed the queue name.

(RabbitMQ is a MQTT if memory serves)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 13
(1,548 Views)

still unable to get this resolved. Has anyone had any luck using the DropVi_SimpleClientSubscriber.vi to connect to an online broker (preferably akenza.io) ?

 
 
 
 
 
 
 
0 Kudos
Message 9 of 13
(1,486 Views)

Have you tried another service like https://test.mosquitto.org/ ? 

 

 

0 Kudos
Message 10 of 13
(1,480 Views)