Issues with the TagoIO MQTT Relay processing multiple topics

Hi Folks,

New to TagoIO and signed up for the free plan to just some testing and learning.

I’m using a Programmable Logic Controller (PLC) to send values out via a MQTT broker. I understand as its a free plan i need to use the MQTT Relay.

I’ve setup the relay on my personal server at home using the setup video on the net (really good video).

So the setup is this

PLC > EMQX (Cloud Broker) > TagoIO Relay (Personal Server) > TagoIO

I have the PLC sending out a value that counts from 0 to 100 then 100 to 0 constantly and its sent out every second. This all work fine, i can see the the value being received by TagoIO in the device i created via the Live Inspection tool. There seems to be around a 2 second lag from being sent out to be received by TagoIO but this is no issues. I can see the value is being received every second.

This value is sent out on the topic /device/123123123.

I’ve added another topic to the output from the PLC on topic /device/321321321 with a alternating value, value ranges from -250 to +250. This is were issues start to happen.

The PLC send out the two values simultaneously, i can see that the broker receives these values simultaneously every second via its test connection function.

Now what happens is that TagIO (Live Inspector) now receives the values from /device/123123123 every two seconds and same with /device/321321321 instead of TagoIO receiving the values simultaneously.

Watching the scrolling log of the MQTT Relay it seems the relay can only handle one topic at a time so it alternates sending out the values one at at time.

I was hoping for testing the dashboard to send out 4 different values but if i do then /device/123123123 will receive its value every 4 seconds instead of every 1 second.

The question is have i done something wrong or is this a limitation of the relay?

I also noticed that when i put the PLC in stop mode to stop sending out data, the EMQX did indeed stop receiving data but yet the MQTT Relay was still sending out information as if the relay was storing the values in a buffer then sending it out, it kept sending the data for a good 15 seconds before it finally stop.

Is this a function of the relay or glitch/issue?

Any assistance would be greatly appreciated.

Hi @oscartheshark,

I checked the behavior you described, and it makes perfect sense code-wise. This is definitely a limitation in the Relay code, as it should ideally process these requests in parallel so one slow request doesn’t block the others.

I’ve opened an issue internally so our team can investigate and implement a solution soon.

Vitor

Thank you for your response, I look forward to a solution.

I also noticed the following during testing.

  1. When sending just one value from the PLC every 500ms the relay would still only send out the value every second and after a few minutes the relay would disconnect from the broker and reconnect after 5 seconds. Sending the value at 1 sec intervals seem to have no issues and would not disconnect.
  2. When sending 2 x Values at 1 second intervals, again the relay would disconnect from the broker and reconnect after 5 secs.

I didn’t test to see if the time frame between disconnections were the same but it didn’t feel like it was totally random either.

Hi @oscartheshark,

Good news regarding the processing delay you reported.

We just released version 1.5.0 of the MQTT Relay. This update includes improvements to parallel processing, which should allow your simultaneous PLC topics to flow through without blocking each other. This should also help stabilize the connection when sending data at faster intervals (like your 500ms test).

The update is available now for macOS, Linux, and Docker. If you are using Windows, that build is being finalized and will be available shortly.

You can download the latest release here:

Let us know if this clears up the lag and buffering issues on your end!

Hi Vitor,

Awesome, I’ll try and get on this today/tomorrow and give it a good testing.

Will let you know if any further issues.

Hi Vitor,

Happy to report the MQTT Relay is work correctly.

Relay is receiving 4 x Topics simultaneously and sending them to the TagoIO the same.

The dashboard i created using the 4 Topics is now also running smoothly with all widgets updating correctly .

At the moment all topics are sent out from the PLC at 1 second intervals.

Once i get a few minutes to spare I’ll test the relay by send out the topics at different times to see how the relay responds.

Will let you know how this goes.

3 Likes