This Luci module uses wrtbwmon to track bandwidth usage.
- Auto refresh every 5 seconds (can be changed)
- Track speed per client (if auto refresh is enabled)
- No cron job required (wrtbwmon is updated on demand)
- Map MAC addresses to usernames by editing a file from the UI.
- Ability to persist database across reboots and firmware updates
After installation you will see a new Usage menu item inside the Network menu list in the Luci GUI.
It displays a table that includes all columns wrtbwmon provides, with two additional ones (emphasis given):
- Client
- Download speed
- Upload speed
- Total downloaded
- Total uploaded
- Total usage
- First seen date
- Last seen date
The download/upload speed is calculated in memory on the front end using JS thus minimizing resource consumption on the router. To properly calculate these values an auto refresh interval must be set that runs the following commands on the router:
wrtbwmon update /tmp/usage.dbwrtbwmon publish /tmp/usage.db /tmp/usage.htm /etc/wrtbwmon.user
For the above commands to work the only requirement is that the wrtbwmon package is installed and enabled.
- Download the latest
.ipkfile from wrtbwmon releases - Copy the file to your router
/tmpdirectory- I use the following command:
scp wrtbwmon_*_all.ipk root@192.168.1.1:/tmp/
- I use the following command:
- Install the package
opkg install /tmp/wrtbwmon_*_all.ipk
- Schedule it to run on startup
/etc/init.d/wrtbwmon enable - Manually start it now
/etc/init.d/wrtbwmon start
*If you have already setup a cron job to update the wrtbwmon database, it would be best if you removed it.
There is no need for wrtbwmon to regurarly update the db since we only need to run it when the Usage page is active.
- Download the latest
.ipkfile from releases - Copy the file to your router
/tmpdirectory- I use the following command:
scp luci-wrtbwmon_*_all.ipk root@192.168.1.1:/tmp/
- I use the following command:
- Install the package
opkg install /tmp/luci-wrtbwmon_*_all.ipk - Clear the cache for
lucito get the web interface to refreshrm /tmp/luci-indexcache
Note that the luci-compat package is required, which you can install with: opkg update && opkg install luci-compat.
- Add the
.ipkpackage to theOpenWRTfeed
Feel free to contribute on any of the above TODO items, or even on any feature you might think is helpful. I would appreciate any help.
A big thanks to
- pyrovski for creating
wrtbwmonand helping me with creating the.ipkpackage - OpenWRT organization for creating and maintaining
openwrtandluci - Carl Worth cworth@east.isi.edu for his
ipkg-buildscript that lies in this repo
