I am unable to set a crontab task since the firmware building. I tryied by placing a custom "root" file with the task in buildroot/files/var/spool/cron but I only obtained a firmware which freezes on boot with the message:
I have a lot of customizations, I am running three daemons made by myself and custom configuration files, also some fixes (for example, the WPS button fix). The firmware works well if I remove the custom /var folder from buildroot/files , where was only created to include buildroot/files/var/spool/cron/root to schedule the task.
The task is a workaround for an unsolved bug in the WiFi of this device. The issue is detailed here.
In particular, the content of the "root" file which schedules the task is:
*/1 * * * * /usr/memory_check.sh
And the content of the script is:
#Due to currently unknown issues, MT7621 targets experience infrequent complete memory consumption.
#This leads to wifi and device crashing. This is possibly related to wifi driver issues under v22.03 releases 0 to 3.
#Workaround test is implementing a free memory check that issues a wifi down & wifi up command in case of apparent memory consumption close to max.
usedmem=$(free | grep "Mem" | cut -d' ' -f17)
freemem=$(free | grep "Mem" | cut -d' ' -f24)
#Archer C6v3 runs with 128MB RAM.
#Standard memory consumption fluctuates around 30MB.
if [ $usedmem -gt 75000 ]; then
echo "WARNING: Wifi restart due to excessive memory consumption"
date >> /tmp/wifi_restart_log.txt