Skip to main content

MyRIO MQTT


The Industry 4.0 concept includes the incorporation of Internet-Of-Things (IoT) to the industry as one of its strong points. We would like to use the myRIOs that we have in the laboratory as IoT prototypes, but it is not straightforward because the device is not ready for that and the network at our laboratory has limitations too.
But we are stubborn, and we have shown it is possible!

First, we have to choose the protocol to make our device behave as an IoT thing. There are many, but one of the trends right now is to use MQTT. MQTT is a very lightweight protocol, so it can be implemented in very simple devices. The main idea is that we have topics (a sort of postbox) that can be created (published) or subscribed to, and after that we can read/write messages there. If you want to learn more about MQTT, there you have a good site:

https://developer.ibm.com/articles/iot-mqtt-why-good-for-iot/

To make MQTT work, we need a sort of server in the other extreme, called broker. The topics will reside in that broker. We will make our tests with MQTT.fx, but there are many others. We have installed that in our PC, and we have to run it and connect it to make it work.

https://mqttfx.jensd.de/

In our thing, the myRIO, we use LabVIEW for programming it (most of the times). LabVIEW is OK for communications, but it does not have any MQTT native library, so we had to install one from daq.io. After that, we need to do the following steps with the myRIO:
  • Give Internet connection to it connecting it to a Wi-Fi
  • Install on it the software package named "HTTP client with SSL support"
  • Change the admin user's password to something not empty
  • Program the myRIO with something similar to the next figure


And that's it! WE can check that it works in MQTT.fx as you can see in the last figure. In our case, we send ON or OFF depending on the state of a push button. [For some reason, the first time you run the program each time you create a new topic, it fails, but it runs OK the second time and further. We will try to fix that].


Popular posts from this blog

IndiPi

  [Updated 2026/07/28] We are glad to present our latest development, that comes to replace our previous laboratory equipment: IndiPI! A development board created specifically for teaching Industrial Information Technology and physical computing. In short, it is a Raspberry PI 5... and much more! And we have updated and published everything you need to create your own kit.

myRIO-library Python library

  Our myRIO device is very interesting and we've done a number of complementary projects with it, in addition to our lab work. Anyway, even though we like LabVIEW, we wanted it to be programmed with Python... and we did it!

LabVIEW tutorial

    LabVIEW programazio hizkuntza gelan erabiltzen dugu eta urtero ikasle ugarik bere lehenengo pausoak ematen dituzte gurekin. Garai batean tutorial onak zeuden Interneten, baina azken aldian tutorial on bat izatea faltan botatzen genuen eta hementxe gatoz gurearekin!