Hello everyone,
I have a question regarding MQTT Communication with DataMiner. I would like to know whether DataMiner already has a connector developed for this type of communication? And if we would like to integrate a device to the DataMiner system using MQTT, how would that be possible?
Hi Gorazd,
After a quick search, I couldn't find an off-the-shelf generic connector ready for testing. However, I don't see any technical obstacles to creating a connector that subscribes to topics on an MQTT broker.
I also noticed that we have conducted some internal tests with this in the past, so we might already have a a good base for a connector. If you are interested in trying it out, it could be beneficial to coordinate with your Skyline point of contact.
To answer your question directly, it should indeed be possible to have a connector that subscribes to specific topics and then receives asynchronous updates on those subscribed topics.
Hope this helps.
Kind regards.
I have implemented a basic MQTT client using the MQTTnet library, and I placed the code in a QAction. At the end of the code, I added a while (true) loop to keep the QAction active all the time (since the connection needs to be persistent). However, I am concerned that this QAction will block other QActions from executing because, as far as I understand, the element processes QActions sequentially. Is there a workaround for this?
Hi Stefan, your concern is valid. Ideally, you don't want this QAction to block the entire workflow. We have a couple of strategies to address this, and the best approach depends on certain variables that I currently don't have. To maintain most of your existing logic, you could consider queueing your QAction, which would create a dedicated thread for it (https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.QActions.QAction-options.html#queued). However, we need to be cautious with this approach, as we must manage its lifecycle and ensure it ends or restarts when the element is stopped or restarted. We also need to be careful with accessing shared memory and make sure that not RTEs will be generated. An alternative might be to use a serial interface to receive asynchronous data and then trigger a QAction whenever data is received to correctly process it.
Thanks Flavio, I'll try these options 🙂
Thank you for your help Flavio!