Hi everyone,
I wanted to share a small shell script I use to keep my mobile connection more stable on NSA 5G, specifically with band n78.
In my setup, the modem sometimes drops from n78 and moves to LTE-only cells, which results in much worse throughput. Since NSA 5G depends on an LTE anchor cell first, the idea is to lock the modem to a good LTE anchor cell and then keep checking whether n78 is still active.
The script watches the modem in the background using AT+QCAINFO. If NR5G BAND 78 is present, it does nothing. If n78 disappears several times in a row, it reconnects the mobile interface. If reconnecting repeatedly fails, it reboots the router as a last resort.
It logs everything with:
logger -t 5g-watchdog
So the behavior can be followed in the system log.
The script can be added in RutOS under:
System -> Maintenance -> Custom Scripts
After saving it, restart the router so the watchdog starts cleanly after boot.
The main values that need to be adjusted are the mobile interface and the LTE anchor cell parameters. The easiest way to find the cell parameters is in the RutOS web UI:
Status -> Network -> Mobile
I tested it on RUTC50 with a Quectel RG520N modem.
I put the script and more details on GitHub here:
Use at your own risk and adjust it to your local network conditions.
I am sharing it in case it helps someone with a similar NSA 5G stability issue.