LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MQTT Labview

Solved!
Go to solution

Hi i am using MQTT to publish data onto systemlink cloud. I am using  a esp32(publisher), raspberry pi(broker and susbsciber), mosquitto mqtt broker. I am successful in getting the data from the esp32 to the broker but i am having trouble configuring the raspberry pi in labview to get the data from the mosquitto as a subscriber. I keep on getting error 63 and error 66 when i try and connect to the broker. I am using the MQTT VI avaliable on the VIPM. I have used localhost and the ip address as my TCP connect configuration to connect to the server, i am also  passing the username and password as a cluster in the connect to server VI. I am also running LV 2021 CE and makerhub to connect and deploy my application.

Download All
0 Kudos
Message 1 of 7
(4,218 Views)

Hi, could you detail where you are getting those errors, is after creating the MQTT client or after connecting?.

The error 63 is likely due some firewall or something blocking the connection, If your ESP32 is working then I think it is opened, as I understand your setup, you have the MQTT Broker running on the raspberry PI and you are running a VI on the same raspberry pi ?

 

I would recommend to run the vi on a desktop computer connecting to the MQTT Broker running on Raspberry pi and see if you are able to connect the same way the ESP32, just to confirm your VI is doing the correct secuence and it is working fine.

 

Enrique.

 

Message 2 of 7
(4,145 Views)

Thanks for the quick reply Enrique

1. The error occurs in the connect to server VI after the MQTT client creation as you can see in the picture 

zombae_0-1677800908662.png

2. I have run the program on my laptop now and using the raspberry pi now, I have also given the connect to server a username and password to my mosquitto broker. Both my laptop and the raspberry pi are on the same network but I still get the same error 66.

zombae_1-1677801080374.png

 

I am using the standard DropVI_simpleclientsubVI from the LabVIEW opensource MQTT VIs 

0 Kudos
Message 3 of 7
(4,127 Views)

Hi, please try using different Keep Alive(s) and timeout like this:

 

 

MQTT Sample.png

Message 4 of 7
(4,117 Views)

yes i have tried using the timeout and keep alive function but i am still getting the same error. I have gone into the connect to server vi and was able to see where the error originated. 

zombae_0-1677807606627.png

zombae_1-1677807744765.png

 

 

zombae_2-1677807769388.png

 

0 Kudos
Message 5 of 7
(4,108 Views)
Solution
Accepted by topic author zombae

I have found the soultion, if you are passing the username and password to your mosquitto broker please select the username flag and password flag have to be user otherwise the server will close the port you are listening on. Please refer to this github article for more information https://github.com/LabVIEW-Open-Source/LV-MQTT-Broker/issues/182

Message 6 of 7
(3,985 Views)

Hi, can anyone help me? How to measure the delay when sending/receiving sensor data via MQTT, CoAP, XMPP etc.?

0 Kudos
Message 7 of 7
(3,663 Views)