FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
+1 vote
363 views 4 comments
by anonymous
Hello,

I've got my TRB141 sending the status of a digital input pin via MQTT every 10 seconds. That's great, but I'd like to only send an MQTT message when the pin changes state (both ways, high to low, and low to high).

The equipment connected to the input will change state once every 30 seconds to 30 minutes, so it's not fast, but I don't want to send data every 10 seconds.

What would be a good way to approach this? I've thought about a custom script or a modbus alarm, but is there something built-in I could use?

I'm running firmware TRB1_R_00.07.00.1, which I updated yesterday.

Edited to add: it could probably be done with the I/O juggler, but MQTT is not listed as a possible action.

Thank you.

1 Answer

+1 vote
by anonymous
Hello,

Unfortunately, at this moment there is no built-in feature to send I/O data via MQTT once the pin changes state as data sender does not check data and sends it only at a set time interval.

Regards.
by anonymous
Ok, but the state change can be detected by the I/O Juggler, which could call a script?

I suppose I could get it to do an HTTP request, but I'd like to do it with MQTT.

Thank you.
by anonymous
In that case, you could only write your own script, but it would require advanced thinking.

For example, in my logic, you could catch log entries when I/O changes to state and enable data to server feature with a script for a few seconds and disable it once again until I/O changes state.

Regards.
by anonymous
Yes, I am capable of advanced thinking, but I am not familiar with how the TRB141 works.

The I/O Juggler seems to detect the input changing state. But, MQTT is not a supported action. I am hoping someone can suggest a workaround. Or maybe Teltonika would implement MQTT as an option for the I/O Juggler. Perhaps I should make a formal request.
by anonymous
Did somebody has found a workaround for this issue? How to send MQTT data only when needed?