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.
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.
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: