I made an external bandwidth monitor for OpenWrt similar to vnstat in a web server. I am currently using a Raspberry Pi Zero 2W for a PHP web server. There is no need to install any package in the router and also reboot or sysupgrade the router unlimited times. All it does is probes the router every hour and gets the Rx, Tx data and processes it. Since the data is stored in an external server the data is not lost on reboot or sysupgrade.
I made it using PHP and SQLite and currently testing the data for reliability. It can also monitor a local interface too, also testing in a VPS.
If someone is interested in testing I will share the code soon, just keep in mind that this just a side project I made and the data might be highly inaccurate but right now the data is very similar from the router's interface page.
