Hi,
We run four gateways (3x TRB145, 1x TRB246, RutOS 07.24.3) in a factory. Each polls Modbus RTU meters (flow, pressure, energy) every 60 s - 12 to 57 requests per minute per gateway - and sends the readings with Data to Server → MQTT (TLS, QoS 1) to our own broker. Mobile connectivity on this site sometimes drops for many hours, and organising a site visit takes days, so each gateway must keep at least 10 days of readings and push them when the link returns.
What we measured (07.24.3):
- Readings are queued in the Modbus client’s SQLite database at
/var/run/modbus_client/modbus.db(tmpfs = RAM). During a 10.5-hour period in which Data to Server could not send, the TRB145 polling 12 requests/min recovered everything, but the TRB246 polling 57 requests/min recovered only the last 6 h 12 min (about 21,200 records). Its DB file had stopped at exactly 340 x 4096 = 1,392,640 bytes, so the default page limit seems to be 340 pages and the oldest records are silently dropped. -
- The Data to Server “Retry” settings are not a buffer: retry count and retry timeout are both limited to 1-10, i.e. 100 seconds at most.
-
- We have read the TRB145 Modbus and Data to Server wiki pages. The Modbus client global settings list “Database location: RAM; default: RAM” - RAM is the only value. Only DNP3 offers “RAM | Flash”.
-
- The hardware has 128 MB RAM (~65 MB available) and 512 MB flash (the
/logubifs partition alone has ~120 MB free). Ten days of our data is only 10-50 MB per gateway.
- The hardware has 128 MB RAM (~65 MB available) and 512 MB flash (the
- What we tried (TRB145, via UCI, because the WebUI does not expose it):
-
modbus_client.main.db_max_page_countis honoured: with a value of 8 the file stopped at exactly 32,768 bytes, the oldest records were removed and collection continued (ring behaviour).-
modbus_client.main.db_path=/log/modbus_client/modbus.db(directory owned bymodbus_client) works: the daemon creates the DB there and Data to Server reads from the new path.-
- We then blocked the MQTT port for 10 minutes and rebooted the device: the records queued in
/logsurvived the reboot and were delivered afterwards. So the flash database solves both the size limit and the power-cut problem for us. -
- One thing we noticed: the first ~3-4 minutes of readings after the link was cut were lost (only records from ~3 minutes after the cut were retained). It looks as if records are marked as sent as soon as they are handed to the MQTT client, before a PUBACK arrives, while the TCP connection was silently dead.
- Questions:
- We then blocked the MQTT port for 10 minutes and rebooted the device: the records queued in
-
- Is this configuration (
db_pathon/log,db_max_page_countraised to e.g. 20,000 pages = about 80 MB) supported on TRB145? Is there a reason the WebUI offers only RAM - flash wear on the ubifs partition? Our write rate is only 12-57 records per minute. -
- Will a firmware upgrade keep these UCI options and the database?
-
- Is the default page limit really 340 pages, and is it documented anywhere?
-
- Does Data to Server wait for the MQTT PUBACK before advancing its “last sent id”? If not, is there a setting to avoid losing the in-flight records when the link drops?
-
- The TRB246 has no usable flash space (
/logis 576 KB, overlay 2.5 MB). Apart from a larger RAM page limit, is there any option for it?
- The TRB246 has no usable flash space (
- We would prefer a supported configuration rather than an undocumented workaround. Thank you!
- Is this configuration (





