TRB255- Sending value of adc via MQTT on a timer


I have a remote device and have connected the analog input to the battery to monitor the voltage.
I would like to publish this value at fixed intervals to MQTT.

I cannot fins a simple setting to do so -
The closest thing I get to what I’d like is using the I/O juggler and making special conditions for when the voltage is within certain ranges to then trigger a send %g0 (adc value) over MQTT. This is very cumbersome. From the latest firmware update TRB2_R_00.07.06.1 it looked that there might be an option now to do this but I couldn’t find any change.

Can anyone suggest how to do this?


Apologies for the delayed response.

You should be able to utilize the Modbus and the Data to Server functionalities in this case. For example, you can configure TRB255 as a Modbus Client and Server at the same time. The Modbus Client would be configured to send Modbus requests to itself ( This would allow you to read information from the device itself, including I/O values (For example, analogue input (PIN 11) is stored in Modbus register 142). You can find more information about Modbus Registers for TRB255 on our wiki page here.

The data from the periodic requests is stored in the Modbus database file. This data can be sent to your server (broker) over MQTT periodically using the Data to Server functionality. For this, you will need to create a collection where you specify your protocol (MQTT) and the IP address of the server (broker). Additionally, create a data input with a Modbus data source (to take Modbus data from the database). You can find more information about Data to Server functionality here.

Let me know if you encounter any issues!

Kind Regards,

This worked well, thank you for the suggestion and your help!

This topic was automatically closed after 15 days. New replies are no longer allowed.