vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

name, ip, mac buttons not working on status #27

Closed samara8609 closed 8 years ago

samara8609 commented 8 years ago

i'm using the legacy page, the toggle between name, ip, and dhcp are not working for me, even after manually editing the .js file.

vortex-5 commented 8 years ago

Has this worked on a prior version? Was this freshly broken after upgrading to 1.7.1?

boxintense commented 8 years ago

I am having this issues as well. This worked on prior version and after upgrading, it breaks.

vortex-5 commented 8 years ago

Hmm I'm not experiencing this myself.

Please try clearing the browser cache and refresh the page first.

If that doesn't work.

Can you let me know if any error messages are happening in the console when you execute stop.sh then start.sh ?

Also please let me know if there are any errors in the browser console.

boxintense commented 8 years ago

Nope, no error of the sort on SSH console:

root@[my-router-hostname]:/jffs/bwmon# ./stop.sh backup completed bandwidth monitor shutdown completed root@[my-router-hostname]:/jffs/bwmon# ./start.sh bandwidth monitor started use /jffs/bwmon/bwmon-stop.sh to stop root@[my-router-hostname]:/jffs/bwmon# bandwidth monitor autobackup started use /jffs/bwmon/stop.sh to stop bandwidth monitor started with cycle time of 10 use /jffs/bwmon/stop.sh to stop

Tried using both Chrome (Version 49.0.2623.112 m (64-bit)) and Firefox 43.0.1, both didn't work. I'm on Windows 10 Pro.

Tried hard refresh (Ctrl + F5) on both browser, didn't work as well. Here's the screenshot:

live bandwidth stats - google chrome 2016-04-10 09 16 34

vortex-5 commented 8 years ago

can you check to see if you can access routerIp/user/dnsmasq-conf.js and routerip/user/dnsmasq-leases.js

boxintense commented 8 years ago

dnsmasq-conf.js is accessible with a lot of dhcp value in it, but dnsmasq-leases.js are returning blank page, (not an 404 error or permission error, it's still accessible but just blank)

symlink on /tmp/www can be found:

root@[my-router-hostname]:/tmp/www# ls -l |grep dnsmasq-leases.js lrwxrwxrwx 1 root root 19 Apr 10 09:12 dnsmasq-leases.js -> /tmp/dnsmasq.leases

however /tmp/dnsmasq.leases is 0 in size on /tmp :

root@[my-router-hostname]:/tmp# ls -l |grep dnsmasq -rw-r--r-- 1 root root 967 Jan 1 1970 dnsmasq.conf -rw-r--r-- 1 root root 0 Jan 1 1970 dnsmasq.leases -rw-r--r-- 1 root root 78 Jan 1 1970 resolv.dnsmasq

vortex-5 commented 8 years ago

hmm... that doesn't seem right my dnsmasq.leases file contains content

even if I manually assign all entries with static leases.

vortex-5 commented 8 years ago

Also if I delete the dnsmasq-leases.js file and all I have is the dnsmasq-conf.js entries I still get the ip addresses showing up successfully

vortex-5 commented 8 years ago

Yeah it seems like a blank file even if the file doesn't exist is normal for DDWRT /tmp/www

Can you please try clearing your browser cache then open up the developer console (F12) and let me know if you see any errors.

boxintense commented 8 years ago

There is 1 error:

angular.min.js:93 GET http://[my-router-ip]/bwreader.php?no-cache=1460256269832 404 (Not Found)

vortex-5 commented 8 years ago

That is normal for people not running the lighttpd server... Hmmm I'm not sure what's going on at this point not much has changed between 1.7.0 and 1.7.1 and both modes are working for me in 1.7.1. Would you mind executing stop.sh and overwriting the bwmon and bwmon/WWW files using something like winscp? Extract to PC first. Then run start.sh again when done.

vortex-5 commented 8 years ago

And if that fails can you try replacing only the bwmon.js file from 1.7.0 and let me know if everything works?

Be sure to stop before replacing.

boxintense commented 8 years ago

Actually I didn't use 1.7.0 at all, the last version I used might be a much older version (the last update I did before going with 1.7.1 is I think around Nov or Dec 2015)

vortex-5 commented 8 years ago

If you can determine the last working version I can see what the transitions are.

Try the last one from the 1.6.x series first

1.7.0 had a bit of a change.

vortex-5 commented 8 years ago

Sorry did you do a full update to get to 1.7.1 ?

If you only updated the bwmon.js file it wouldn't have worked since that instruction were only for people on 1.7.0

boxintense commented 8 years ago

Yes, I did. Everytime I update the script I basically do a full re-install by removing the whole directory, re-download and re-run the install.sh

I have just tried re-installing 1.7.1 once again and it didn't work, I'm trying from version 1.6.x now

boxintense commented 8 years ago

Ok, 1.6.4 works!

I got a full device name instead of MAC / IP Address!

vortex-5 commented 8 years ago

And 1.7.0 doesn't?

If that's the case it may take me longer to evaluate what went wrong since the changes between 1.6.4 and 1.7 are much more substantial and you are not seeing error messages on your end in the console other than 404 oh bwreader.php for the lighttpd module not running.

I was hoping the problem was between 1.7.0 and 1.7.1 the changes were very minor.

boxintense commented 8 years ago

Checking using 1.7.0 once again to make sure

vortex-5 commented 8 years ago

I may have made a mistake in the instructions for 1.7.1 when I told people to just overwrite bwmon.js I ment that only for people upgrading from 1.7.0 I updated the release notes to hopefully prevent others from doing that.

boxintense commented 8 years ago

1.7.0 doesn't work. So the latest version that gave me the Device Name (according to the dnsmasq.conf / Static IP leases table) is version 1.6.4

vortex-5 commented 8 years ago

Since I'm not seeing this if you want to get 1.7.0 working I may need to get some debugging information from you:

if you can run 1.7.0 and put a breakpoint on the line:

https://github.com/vortex-5/ddwrt-bwmon/blob/master/bwmon/www/bwmon.js#L363 and https://github.com/vortex-5/ddwrt-bwmon/blob/master/bwmon/www/bwmon.js#L366

and let me know the values of:

dnsmasqLeasesData dnsmasqConfData

then run until the second breakpoint and let me know the value of

$scope.macNames

If you do not wish to list the mac addresses you can change them before sending but it is importent to include any spaces or formatting characters as that may be causing the problem.

On the second breakpoint I want you to type in this as a watch expression:

JSON.stringify($scope.macNames)

you should end up with something like:

{"1c:65:dd:dd:dd:dd":"Test1","c8:14:cc:cc:cc:cc":"test2"}

Where the first key is the mac address (all lower case this is important)

and following is the name of the device.

boxintense commented 8 years ago

dnsmasqLeasesData value:

""

dnsmasqConfData value (MAC Address is changed):

"interface=br0,ath0.1 resolv-file=/tmp/resolv.dnsmasq all-servers strict-order dhcp-leasefile=/tmp/dnsmasq.leases dhcp-lease-max=31 dhcp-option=ath0.1,3,10.10.10.1 dhcp-authoritative dhcp-range=ath0.1,10.10.10.2,10.10.10.32,255.255.255.0,1440m dhcp-host=FF:FF:FF:FF:FF:FF,X-PC,10.0.0.2,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-Tablet,10.0.0.3,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-SmartPhone,10.0.0.4,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-VoIP,10.0.0.5,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-TV,10.0.0.6,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-PS3,10.0.0.7,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-NAS,10.0.0.8,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-ZUK,10.0.0.9,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X2-Laptop,10.10.10.100,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-Bedroom-eRemote,10.0.0.10,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X-Bedroom-eAirDetector,10.0.0.11,infinite dhcp-host=FF:FF:FF:FF:FF:FF,X3-MeeGoPad,10.10.10.101,infinite stop-dns-rebind "

$scope.macNames:

live bandwidth stats - google chrome 2016-04-10 11 00 01

vortex-5 commented 8 years ago

Ok so it appears that your router has the mac addresses all in upper case which was not the case for my router it left everything in lower case MAC representation as seen from my previous post. I'm drafting a hotfix.

boxintense commented 8 years ago

Ah I see, I was under impression that the mac addresses presentation are ruled by dd-wrt as an operating system instead of the router's hardware. That doesn't seem to be the case if that's true then!

vortex-5 commented 8 years ago

I have just released a new release to try and address your problem: https://github.com/vortex-5/ddwrt-bwmon/releases/tag/1.7.2

please give that a try.

If you're curious the commit in question is: https://github.com/vortex-5/ddwrt-bwmon/commit/16c2d15120ec0b56cc94f7479b6c6bb696f3d375

Effectively for routers that do not store the addresses as lower case they will be converted to lower case as the keys are created in the tool.

vortex-5 commented 8 years ago

Let me know once again when you have time to try this release and thanks again for contributing to the development process.

I have also marked 1.7.0 and 1.7.1 with a little warning that a bug was found and people seeing mac addresses instead of names should move up to 1.7.2 (this may change if more problems are found I usually have a longer testing period for patches but this seemed safe)

boxintense commented 8 years ago

It's fixed! Thanks

vortex-5 commented 8 years ago

Ok thanks I'll mark this issue as closed (you can still comment)

I'll keep the warning in place for anyone on 1.7.0 and 1.7.1. I debated pulling those versions but it seemed like it would be unfair people run older versions for various reasons so I'll leave them up hopefully people read the release notes and realize there's an issue with those and the latest version would resolve it.

vortex-5 commented 8 years ago

Now I can focus on getting the Mbps, MB/s display in when I get some free time most likely it will be another toggle at the bottom.

All these toggles are currently saved in cookies so they should retain your last setting for a month.

boxintense commented 8 years ago

Thanks again. Just let me know if you need some helps in debugging. I uses bwmon on daily basis at my home and workplace to ensure no abusive users are hogging the network. Thanks again for such beautiful and useful script.

boxintense commented 8 years ago

One idea, this toggles are quite hard for me to manage at my workplace (a cafe) since there are around 70 devices connected to it, when I scroll down the page to toggle one of the option, and then re-scroll up, I can't find which device name is which MAC addresses since there are so many rows in the table, if you know what I meant..

Would be good to have an option to just display everything in a column instead.

First column - Device Name 2nd column - IP Address 3rd column - MAC Address etc..

vortex-5 commented 8 years ago

Currently if you hover over the name it shows all 3 pieces of information in a tooltip.

If you are on a touch screen just touch and hold.

vortex-5 commented 8 years ago

But I can add an option in a later revision to just show everything in the column earlier experiments has it looking a bit of a mess :-)

Also a secret shortcut to toggle in place is to double click on the name column.

boxintense commented 8 years ago

Nice! That should work!

vortex-5 commented 8 years ago

I didn't write the double click into the documentation because I figured people would never need it or would complain that it's too difficult to use (even though they don't have to use it) but in your situation you can hover over to see the mac / IP then double click if you need to copy and paste the different fields.

So your 3 options of doing it are:

Hover or touch over the name column you'll get a tool tip.

Use the bottom buttons to change what is shown by default

Double click in the name column to quickly toggle between the 3.

vortex-5 commented 8 years ago

Edit: I should probably add the double click hidden feature to the documentation the UI is more complicated than the documentation on the front page which is really the UI from 1.2

and I doubt most people noticed the change to have hover show all the info either.

The main reason I don't show everything on the name column is mobile the mobile version takes away 2 columns even to get everything to fit nice. But that maybe a bit of over-engineering.

boxintense commented 8 years ago

Yeah I think generally it's fine though, I doubt many users will use it like mine, with plenty of devices connected into a single router. I'm a little bit more complicated since I have a 48 ports switch connected to those router, which are used for our office, and then there are a wireless repeater and access point for the cafe, hence resulting in possibly hundreds of connected devices.

Idea about the phone/mobile device is to have multiple layout like I did for my tables at my product page ( https://www.boxintense.com/managed-cloud-vps/ ), we incorporate vertical and horizontal tabling layout and device pixel per inch ratio detection so no matter how small the devices are, they would be able to saw all informations in proper manners.

vortex-5 commented 8 years ago

Ah ok so you switch to a single column view once you are too small. mine I just took away 2 of the rows when your view is too small I think I took away the download and upload breakdown so you still have the total.

Eventually I might just let you show or hide the columns via a built in configuration but the more options I put I worry users won't understand it or understand that due to security concerns I don't build anything that writes onto the router so it will be a per browser cookie setting like everything else that is configured in the UI.

But in this case it would probably work since the people that don't mind scrolling will have all that info or you know the phablet users :-)

But this is one of those probably will do it but not high priority things since no one has requested it.

need to focus on things people are upvoting first lol.