I have several RUT955’s at firmware 7.4.2, all deployed for several months.
Many are running into 98% flash memory usage and go into read-only mode file system.
The issue seems to be a large 2MB or bigger file in /overlay/upper/usr/lib/mdcollectd called “mdcollectd.db_new.gz”.
What is the purpose of this file and how can I limit its size?
The mdcollectd.db file is a mobile data usage database, and the issue you described was commonly known on older firmware versions like yours. To resolve the flash memory issue, please follow these steps:
That seems to work for the problem at hand. Unfortunately, something is very different about the MQTT broker on the latest firmware, RUT9_R_00.07.06.17.
I have scripts that publish about 17 topics in succession:
And my subscribers to the broker on firmware 7.4.2 all successfully get all the messages. On 7.6.17, some of the messages are skipped/dropped. It’s very repeatable. And if the order of mosquitto_pub topics in the script are changed, other messages are skipped/dropped. Also repeatable.
I will have to stick with 7.4.2 now and just manually clear the database.
For anyone else who runs across this, there seems to be a bug in the mosquitto version supplied with mqtt packages for 7.5 and above. I think it is 2.0.15. When quick successive publishes are performed, the broker does not send them all. 2.0.11, which is supplied with 7.4, and 2.0.17, which is supplied with the RUT956, don’t seem to have this problem. Searching the web, there do seem to be some complaints about mosquitto version 2.0.16 doing this:
(see github bug 2876 and 3056)
…but not 2.0.15, so who knows?
Anyway, my solution was to stay with 7.4 firmware, which includes the older mqtt/mosquitto package, and just deal with this flash memory getting full. The commands:
/etc/init.d/mdcollectd stop #stop the data collection service
rm -rf /usr/lib/mdcollectd/mdcollectd.db_new.gz #delete the database file stored in the flash
rm -rf /tmp/mdcollectd.db #delete the database file stored in RAM
rm -rf /tmp/mdcollectd1.db #delete the duplicate database file stored in RAM
reboot #reboot the device