8317 questions

9780 answers

15562 comments

13905 members

0 votes
43 views 3 comments
by
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

0 votes
by
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
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
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
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.