I had this same issue, and it was rooted in the missing "sort" function from atheros builds of dd-wrt.
I simply removed that as a dependency from the code, and told the browser to sort the data rather than the router.
I also added a totals line and some better styling.
I have attached the updated wrtbwmon file.
I will most likely be updating this file to add more features and better reporting in the future if there is any interest.
the .txt extension should be removed, but was required to attach file to this post
i've tried your file but when i ran it give error message:
/tmp/wrtbwmon: line 240: syntax error: unexpected end of file (expecting "done")
Posted: Tue Jul 02, 2013 8:58 Post subject: Not obtaining client names from MAC_PCname.txt
So I have installed everything according to the instructions through the above posts. Everything is recording/ working GREAT! I would like to thank everyone involved for making this work/ and running smoothly. Took a little bit to wrap my head around it, but I eventually got there.
So I have only one concern now, that is the MAC address are showing correctly, but when I go to do the MAC_PCname.txt I am unable to get it working? I have installed the WRTBWMON and got all the data going to the USB stick but I'm not sure why its unable to pick up the MAC naming.
Im entering exactly like aa:bb:cc:dd:ee:ff,Person1 and it just doesn't seem to pick this name up. Is there anything that I missed on the config side of DD-WRT? I have DD-WRT currently installed on a Netgear WNDR4300. If there is anything suggestions to sorting this issue out it would be greatly appreciated!
Well finally worked it out. All about the permissions of the USB stick. Quick tip, don't use telnet to do the copy and updates, use a FTP Client eg. Filezilla. All sorted, thank-you guys for this amazing software!!
Ive done all this, so far so good. Only one issue. In spite of the users.txt file being in the right folder on the router in /jffs/ it isnt being used or something cause the table shows MAC Addresses still.
the users file is in the format:
<MAC ADDRESS>,<NAME>,
(one entry per line)
This is exactly what I have been wanting and when I saw the Netgear's crappy Traffic Meter options I knew this was my answer especially since I could never get that to even work. Thats another issue though. I'm here now on DD-WRT and love it.
# Backup usage database file
while :
do
sleep 900
cp /tmp/usage.db /jffs/usage.db
done
Also I did have it in /tmp/ and set on the MyPage to show as well and since I moved it now when I try to change the path it seems to go ok but when I enter the "nvram commit" command (in the GUI) I get nvram locked..... error msg. If I do it in Putty I dont see a difference and it doesnt seem to work. Also tried "erase nvram" before trying to change the path and same result.
Joined: 27 Sep 2008 Posts: 446 Location: Port Of Spain
Posted: Fri Jul 12, 2013 11:55 Post subject:
You should gear away from copying the usage.db file to jffs every 900 seconds becasue that will cause wear and tear on your flash see here http://www.dd-wrt.com/wiki/index.php/Jffs
In addition your users.txt file is in the wrong format, there should't be a comma after name. It should be
mac,name
00:00:00:00:00:00,J-PC
00:00:00:00:00:01,N-PC
Also you will notice changes were made to startup script for mypage the usage.html is no longer published as /tmp/www/usage.html but as /tmp/usage.htmlhttp://www.dd-wrt.com/phpBB2/viewtopic.php?p=468131#468131 _________________ Buffalo WZR-600DHP - 23838
TP Link WDR3600 - 21676
Linksys WRT54G-TM - 12548 (NEWD Eko Mega)
Last edited by spanman on Fri Jul 12, 2013 18:42; edited 1 time in total
Joined: 27 Sep 2008 Posts: 446 Location: Port Of Spain
Posted: Fri Jul 12, 2013 18:41 Post subject:
I still suggest you avoid writing to jffs and use your ftp server instead. That way you can backup more frequently and there is no wear and tear on flash.
Just my thought.
I don't know why some users are showing and why some aren't. Maybe and End of Line (EOL) issue in the users.txt file I don't know. _________________ Buffalo WZR-600DHP - 23838
TP Link WDR3600 - 21676
Linksys WRT54G-TM - 12548 (NEWD Eko Mega)
Now after some tinkering and stuff after I had it partially working, now the www usage file isnt updating, the mypage one shows mac addresses again or those odd numbers instead and also doesnt seem to update now.
I had an idea after it got all messed up maybe the reason some were still showing MAC addresses instead is cause they werent active machines at the time on the network. wish i had thought of that before more tinkering lol
Joined: 27 Sep 2008 Posts: 446 Location: Port Of Spain
Posted: Fri Jul 12, 2013 19:17 Post subject:
Forget about EOL, I don't think that relevant for the users.txt file. _________________ Buffalo WZR-600DHP - 23838
TP Link WDR3600 - 21676
Linksys WRT54G-TM - 12548 (NEWD Eko Mega)
Cleared everything back out, undid the MyPage tab and everything, didnt need it anyway. Removed the startup script and files and restarted the router. Went back in and added just the wrtbwmon file and startup script. Restarted again, the usage.html file didnt generate, so I ran the commands in putty, then the html file generated. made the users/txt file all lowercase as was mentioned to me some routers wont see capitals. waited a while and restarted the router again to verify everything worked as it should.
Magically everything is working now so it seems.
A couple MAC addresses arent resolving to the names though but the rest are. Im just wondering if maybe the device has to be actually active or something for it to get picked up again or if maybe theres a character limit on the names and it ignores the name if it exceeds it. I dunno.
I am kinda wondering now though if theres a way to sort the table of names so that say PersonA is before PersonB instead of vice versa for example.
I still suggest you avoid writing to jffs and use your ftp server instead. That way you can backup more frequently and there is no wear and tear on flash.[...]
What do you mean with ftp server?
Because I'm very interested in this script but using a D-Link DIR-615 RevD (build 22118) which seems to has no opportunity for using jffs, a sdcard or an external usb-drive.
Would it be possible to store the required script files on the ftp-server of my webhoster and access them via web?
.::edit::.
Found the post of fatusik on page 5 of this tread. Now I use the same startup script as he. But it soesn'nt seem to work for me
Is the problem maybe that I have to insert a password to get access to my webhoster ftp server? Because I can't create a anonymous ftp User. But where (in the wget command?) and how do I have to insert the ftp username and password?
.::edit2::.
Ok, solved the Problem with the username/password, by insert them into the ftp link.
But I still got only a blank page
Tried it in the meantime also with my WNR2000. But I get the same result there..blank page
Okay, so I figured out for the most part how to get this thing working. However, I still have one issue and one question:
1. Although I already manually created the MAC-PCname.txt file, the page is still displaying MAC addresses. I'm not sure how I can make it display the host name instead.
# Backup usage database file
while :
do
sleep 900
cp /tmp/usage.db /mnt/usage.db
done
Would I be able to change the sleep 10 to sleep 3, so that it refreshes every 3 seconds? Can changing it to 3 seconds potentially harm anything? I was reading that writing too much would wear out the memory, but I'm not sure if my set up is jffs (I think that's the one that should be avoided for overwriting). Also, I'm using a 4GB USB, in case if it wasn't clear.
Last edited by ijamjl on Sun Aug 25, 2013 5:46; edited 1 time in total
Sorry for bump but would appreciate help. Edited above post, now that I have a better idea of how to use this thing.
I am by no means an expert myself as I am still fairly new to this but I have gotten this working.
1. Try naming it users.txt. thats what ive done and it works. dont know if theres something with maybe using the - in the filename or not. also make sure the users.txt file is in same folder as wrtbwmon.
2. as for changing sleep 9 to sleep 3 that wont make the page refresh in 3 seconds as opposed to 9, that is a delay between those commands in the script. from my understanding you dont want that to be too quick either or it wont work cause the reading might not have been fully done yet for it to write to the db file.
as for your last comment about the excessive writing, that is true as it will wear out the flash memory that is built into the router. i have mine set to back up every 2 hours, some might say that that is a bit too frequent but meh its better than the original like 15 seconds of Kodis script
In order to have the page refresh faster, look in wrtbwmon file and scroll down to where it says Create HTML Page and look close to the end of it where it has the refresh code. theres somewhere it says var seconds=11 id imagine change that to 3-4 and it should refresh faster. I havent tried it so if it doesnt work then just change it back.
Also for reference this is the startup script I am using.