Filter Modbus data before sending to iot platform to save mobile data


I’m using an RUT956 to poll data from sensors and forward it to our cloud based platform.
We can do this through MQTT but we want to optimize how much data is being sent over the mobile data network.

There are several modbus registers that we have to monitor every 5 seconds but we only need to send the data if the register value has actually changed.

I thought about creating a python script to subscribe to the local MQTT broker, process the data and then send it to an external broker, but I’m having trouble installing the python paho-mqtt package and I’ve read in other topics that it can be dangerous in terms of using up all of the hardware’s memory.

Is there a better way to do this?

1 Like

I have the same problem.

I don’t think the teltonika implementation provides the ability to only send the changes over MQTT.

I found a solution

But it requires python. On the Rut955 there is not enough memory to install python.

So I’m looking to run it on a Rasberry Pi.

The only reason we went with RUT955 is that it can communicate using RS485/modbus.

Now the only time we needed to communicate over rs485 the unit does not have the memory to run the program.


As a freelancer, I have done a similar setup for a fleet of RUT955, running “official” openwrt. It includes ModBus/RTU to low-level sensors (polling cycle 1s) , data-preprocessing and snd/rcv via MQTT to/from AWS-IoT, using permanent connections, plus data-queueing in case of no internet. These parts are done in LUA and running in production for more than a year.


Thank you for reaching out to us. Regarding your inquiry, currently Modbus integrated with MQTT lacks capability to transmit information exclusively upon detecting a change, it can only send data at a set time interval, so it necessitates a script for such functionality.

You can read more about Modbus and MQTT on our Teltonika Networks wiki page:

Custom scripts are beyond the scope of the technical assistance that we provide. You’ll need to undertake this task independently or use pre-existing solutions, such as the one discovered by mbalsam.

As for the storage challenges you’re encountering, an optimal resolution would involve expanding storage via a USB port. By attaching an external USB storage device, you can effectively enhance your available storage capacity, enabling the installation of necessary packages and storage of data.

You can read more about memory expansion on our wiki page:

Best regards,

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