Closed AZDavid2 closed 4 years ago
Hi, your .db files seem to be out-of-sync. Try starting over by doing a reset:
$ /tmp/mnt/sda1/reset
If you are able to reproduce the error again, let me know what steps you took to do it.
Ran the reset. Columns are still not cooperating.
Is this a normal response when running the reset?
I'm having trouble reproducing the error, so it's somewhat difficult for me to debug. Initially, it looks like your /tmp/usage.db
and /tmp/reports/*daily.db
aren't getting the correct values. It may be as simple as the USB failing on read/write (a problem I had before) ... or something else.
The Grand Total/Down/Up on the top is calculated here, which is pulling straight from /tmp/usage.db
. Numbers for Today are always pulled from the /tmp/reports/*daily.db
files, here and here.
Any other hints you can provide might help to pinpoint the problem:
/tmp/mnt/sda1/reset
, download something, and then use the /tmp/mnt/sda1/unp
to force update/publish and see the numbers./tmp/mnt/sda1/unp
to update/publish right away./tmp/reports/*.db
and /tmp/usage.db
files)?/tmp/*.tmp
files? Usually an indicator that the script is failing somewhere.If you want to do refresh everything manually, you can:
$ rm -rf /tmp/usage.db /tmp/reports /tmp/www/reports /tmp/www/usage.htm
And remove any previous backups made:
$ rm -rf /tmp/mnt/sda1/reports /tmp/mnt/sda1/usage.db /tmp/mnt/sda1/monthlybkup /tmp/mnt/sda1/bkup
Is this a normal response when running the reset?
Ah, well that definitely seems to be [a/the] problem. The .db files are likely not getting updated correctly if the script is exiting early.
Do you get any output from this?
$ dmesg | head -n -1
Same invalid number message
Have a brand new 16 GB USB drive showing up later today. Going to give that a try. Does it matter how the drive is formatted?
Huh, that's interesting indeed. I don't know if the build for your router is somehow compiled in a way that makes the head
command work differently. head -n -1
appears twice in the script, so it needs to work. Maybe play around with:
$ dmesg | head -n-1
(no space)
$ dmesg | head -n "-1"
(quotes)
$ dmesg | head -n"-1"
(quotes with no space)
Try a number other than -1 and see how it behaves. All these commands work fine for me (also the r44251 build).
My drive is formatted as FAT32, but I can't imagine that or the drive itself affecting the shell. The head
command should work regardless of the USB. You may want to try re-flashing or flashing a different DD-WRT build to see if was a regression in this version.
I am running DD-WRT on a Linksys WRT32x, accessing the router through a PuTTY SSH session
Tried several options to see if I could isolate a cause
No change after all three - received either "invalid number" or "unrecognized option" when running reset or unp
Following was returned after a clean install. Could this help point in a direction?
Tried playing around with the commands including using a number other than -1
Is there a way I can open the database files?
Attempted to open using SQLite but they are not being recognized as a database.
Looks like there's more than one shell command with issues. Guessing that this won't work for you either:
$ date -d @1599429351
I haven't found anything yet in the DD-WRT forums about this. Might be worth posting there to see if anybody else has had a similar issue. Maybe erasing NVRAM could help?
The .db files generated by the script are just text files, so you can open them with vi.
Found this thread. Did you upgrade to the "full featured" version?
Yes, I installed the full version ddwrt-linksys-wrt32x-webflash.bin.
Going to perform a hard reset soon to see if that works.
Entering $ date -d @1599429351 worked
No luck after the hard reset to clear NVRAM. At a complete loss for what to try next.
Just spitballing some ideas here:
$ vi /tmp/mnt/sda1/wrtbwmon
, do you see ^M characters?Ruled out PuTTY by setting up Telnet through command prompt in Windows. Receive the same command responses.
Do not see any ^M characters when running $ vi /tmp/mnt/sda1/wrtbwmon
Suspected a date issue so I ran the "date" command from DD-WRT. Router responded with the correct date and time.
Going to start a thread on the DD-WRT forum to see if anyone there has ideas.
Thank you for all your continued help! Much appreciated!
Seems a router/DD-WRT issue and not the script.
Total Used and Average Daily Total columns appear to be calculating data correctly. Today Total columns as well as Grand Total bar along the top are not adding up. Reinstalled the tool today after after seeing the discrepancy for several days. After reinstalling, received the same issue. I am running the tool from DD-WRT v3.0-r44251 std (08/27/20).
Screenshot showing usage. Being first day reinstalled expect Today Total to equal Total Used. Also, total bar along the top is not adding properly.