Posted: Sun Apr 06, 2014 23:50 Post subject: Re: Version 2.0.4d is now available
al_c wrote:
Todd (tsaylor) if you're still following this, I should've heeded your advice several months ago to break the downloads & uploads in two data structures...
Well, I won't tell you how to paint your masterpiece.
I've switched to version 2 now, but things are looking a bit odd (attached the version 1 output followed by the version 2 output). I had stopped version 1 like an hour ago so I'd expect the two to be pretty close. I'll start it up again for better comparisons going forward, for now.
Posted: Mon Apr 07, 2014 1:18 Post subject: Re: Version 2.0.4d is now available
tsaylor wrote:
al_c wrote:
Todd (tsaylor) if you're still following this, I should've heeded your advice several months ago to break the downloads & uploads in two data structures...
Well, I won't tell you how to paint your masterpiece.
I've switched to version 2 now, but things are looking a bit odd (attached the version 1 output followed by the version 2 output). I had stopped version 1 like an hour ago so I'd expect the two to be pretty close. I'll start it up again for better comparisons going forward, for now.
There are no units in the second screenshot... have you got a bad hourly usage file?
Joined: 05 Mar 2014 Posts: 193 Location: Edmonton, AB
Posted: Mon Apr 07, 2014 17:47 Post subject:
Hi, I thought I try to run this and have encountered a few problems. If someone could help me that would be great. I am a novice in DD-WRT. Here is what is happening.
I initially wanted to do exactly as the instruction says but the first obstacle was I couldn't create a directory inside of /opt either by winscp or by putty command "mkdir /opt/YAMon2. Came up with error that I didn't have permission although I should.
I then updated my router(R7000) from version 23700 to 23770 R01, restarted the whole process and still got the same error.
Then I installed YAMon2 in /tmp/mnt/sda1(the directory created when USB flash drive was mounted) and made the appropriate changes in the script to point that location.
When I run the yamon.startup command, it runs with an intial error "bad number"
But is seems to be running as I can see several hourly files and others updated.
The next problem I have is I cannot see the report by pointing my browser to "http://192.168.0.1/user/yamon.html"
First there is no /user directory under root. The only /user directory is under /root/www. But, even if I pointed my browser to that place, it doesn't load anything.
If there is any hope for me, I would like to try it. If, on the other hand it is beyond me, I will give up for now and try in the future. Thanks in advance.
Hi, I thought I try to run this and have encountered a few problems. If someone could help me that would be great. I am a novice in DD-WRT. Here is what is happening.
I initially wanted to do exactly as the instruction says but the first obstacle was I couldn't create a directory inside of /opt either by winscp or by putty command "mkdir /opt/YAMon2. Came up with error that I didn't have permission although I should.
I then updated my router(R7000) from version 23700 to 23770 R01, restarted the whole process and still got the same error.
Then I installed YAMon2 in /tmp/mnt/sda1(the directory created when USB flash drive was mounted) and made the appropriate changes in the script to point that location.
When I run the yamon.startup command, it runs with an intial error "bad number"
But is seems to be running as I can see several hourly files and others updated.
The next problem I have is I cannot see the report by pointing my browser to "http://192.168.0.1/user/yamon.html"
First there is no /user directory under root. The only /user directory is under /root/www. But, even if I pointed my browser to that place, it doesn't load anything.
If there is any hope for me, I would like to try it. If, on the other hand it is beyond me, I will give up for now and try in the future. Thanks in advance.
Is the `/opt` directory on a USB drive? How is that drive formatted? Unless I'm mistaken, if you did not choose `ext2` then you might have problems (readonly permissions).
With respect to the bad number error message, are you running v2.0.4d? If no, please download and install that one (there were bad number errors in earlier versions)
Next, open your config.file and set `_log2file=2` and also `_loglevel=0`... then save config.file.
Start the script (in Putty.exe) and let it run until the bad number error message appears (or longer)
Take a screen shot and PM it to me (this'll show me exactly where the problem occurs in the code)
You see the reports at http://192.168.0.1/user/yamon2.html (not yamon.html). The report files are found on the router at `/tmp/www`... you do not have to add/create the `user` directory. That is just the way that it is
Joined: 05 Mar 2014 Posts: 193 Location: Edmonton, AB
Posted: Mon Apr 07, 2014 18:13 Post subject:
Thank you very much. I will do as you instructed tonight. Regarding the usb, I didn't specifically do any formatting. I read your readme and got an existing 8GB flash drive, erased everything and inserted it into the router usb2.0 port. In the services-usb I enabled the automount.
I will do what you said and report back here. I think I am close as with winscp, when I open some files there are all the numbers.
I downloaded your script day before yesterday--I think it is the latest. I will check and if it wasn't start over again with the latest. Thank you again.
Thank you very much. I will do as you instructed tonight. Regarding the usb, I didn't specifically do any formatting. I read your readme and got an existing 8GB flash drive, erased everything and inserted it into the router usb2.0 port. In the services-usb I enabled the automount.
I will do what you said and report back here. I think I am close as with winscp, when I open some files there are all the numbers.
I downloaded your script day before yesterday--I think it is the latest. I will check and if it wasn't start over again with the latest. Thank you again.
In the readme.txt there is a reference to Optware... see that for configuring things and formatting the USB drive.
I will update the readme to explicitly state that the drive must be formatted properly.
Joined: 05 Mar 2014 Posts: 193 Location: Edmonton, AB
Posted: Mon Apr 07, 2014 18:33 Post subject:
Thank you very much, Al. I must have missed that part in the excitement of setting up something new. I will re read it. As a matter of fact, I read your readme in the first installment and then decided to try the second one thinking it must be easier by now.
Just a quick question on the readme file. What is the best way to read it? Which program? The reason I ask is that if I try it in notepad or other text editor, it displays without any breaks. Only winscp seems to use some line breaks in it.
I can't get this script to run no matter what I try. I get:
Error #4 reading the devices data file: data/users.js`
And a similar one about the daily file. Those appear in a red box on the yamon2.html web page. All the tabs are blank as a result. I even tried typing in the basedir in yamon2.sh and even that didn't fix it. I'm running it from /jffs/YAMon2 and have changed all the scripts where /opt/YAMon2 appears and changed them all to /jffs/YAMon2. As far as I can tell, all permissions are fine. When I run 1.0.17b from /jffs/YAMon it works fine so it appears to be something with YAMon2. Any suggestions?
Joined: 25 Dec 2010 Posts: 295 Location: Twin Cities, MN
Posted: Mon Apr 07, 2014 19:26 Post subject:
mchaney wrote:
I can't get this script to run no matter what I try. I get:
Error #4 reading the devices data file: data/users.js`
And a similar one about the daily file. Those appear in a red box on the yamon2.html web page. All the tabs are blank as a result. I even tried typing in the basedir in yamon2.sh and even that didn't fix it. I'm running it from /jffs/YAMon2 and have changed all the scripts where /opt/YAMon2 appears and changed them all to /jffs/YAMon2. As far as I can tell, all permissions are fine. When I run 1.0.17b from /jffs/YAMon it works fine so it appears to be something with YAMon2. Any suggestions?
Mike
i had same problem, but thought it was cuz my
router rebooted on its own..hmmm
1.0.17 no probs _________________ NETGEAR R9000 | RT | 40134 NETGEAR R7800 | AP | 40134
i had same problem, but thought it was cuz my
router rebooted on its own..hmmm
1.0.17 no probs
Looking at yamon2.sh, looks like there are two variables that define the base dir: d_BaseDir and _BaseDir. It looks like there's a sequence where _BaseDir can end up with the pathname without the forward slash after it: like /opt/YAMon2 instead of /opt/YAMon2/. Don't know if that could be the problem or not. Maybe Al can look at that.
Joined: 05 Mar 2014 Posts: 193 Location: Edmonton, AB
Posted: Tue Apr 08, 2014 3:46 Post subject:
al_c wrote:
Is the `/opt` directory on a USB drive? How is that drive formatted? Unless I'm mistaken, if you did not choose `ext2` then you might have problems (readonly permissions).
With respect to the bad number error message, are you running v2.0.4d? If no, please download and install that one (there were bad number errors in earlier versions)
Next, open your config.file and set `_log2file=2` and also `_loglevel=0`... then save config.file.
Start the script (in Putty.exe) and let it run until the bad number error message appears (or longer)
Take a screen shot and PM it to me (this'll show me exactly where the problem occurs in the code)
You see the reports at http://192.168.0.1/user/yamon2.html (not yamon.html). The report files are found on the router at `/tmp/www`... you do not have to add/create the `user` directory. That is just the way that it is
Hope this helps
Al
Success! Thank you very much Al. It was great to see what a small change in the config.file could do. I made those two changes you suggested and ran the script through putty and waited for the error message to appear so that I could send it to you. Lo and behold! instead of the error I started getting the report every 10 seconds or so in putty's dos window.
Then I tried with the browser at 192.168.0.1/user/yamon2.html and I got the report just with a minor error.
Anyway I like to thank you for your work and willingness to help. Thanks
I can't get this script to run no matter what I try. I get:
Error #4 reading the devices data file: data/users.js`
And a similar one about the daily file. Those appear in a red box on the yamon2.html web page. All the tabs are blank as a result. I even tried typing in the basedir in yamon2.sh and even that didn't fix it. I'm running it from /jffs/YAMon2 and have changed all the scripts where /opt/YAMon2 appears and changed them all to /jffs/YAMon2. As far as I can tell, all permissions are fine. When I run 1.0.17b from /jffs/YAMon it works fine so it appears to be something with YAMon2. Any suggestions?
Mike
i had same problem, but thought it was cuz my
router rebooted on its own..hmmm
1.0.17 no probs
Mike et al: The `Error #4 reading...` messages get displayed when the JavaScript cannot find a specified data file. I've found that it is virtutally inevitable that the JavaScript in the browser will try to read the file while the script on the router is updating it and this causes errors. Rather than displaying the unhelpful browser errors, I wait for a second or two and try to read the file again... after 3-4 consecutive unsuccessful attempts, I display the `Error #4 reading...` message
So, the data files exist? i.e., are they actually getting created (in /opt/YAMon2/data/... or whereever you've specified in config.file)? Do the files get copied to /tmp/www/data? Is there proper data in the files
As described in earlier threads, please help me help you by turning on logging and then send me the log file (and the data files too).
That said, there is definitely odd behaviour related to the router rebooting... following your earlier message, I rebooted my router twice this evening (once via the DD-WRT interface and a second time by flicking the power switch). On both occasions, the v2.x script restarted as expected ***BUT*** once it did, it did not capture data properly... in particular, the `getCV` function was not properly extract the current usage values from the data file?!?
The snippet from my log file below shows that the script is getting up/download data for IP address 192.168.1.4 and finds the `currentLine` from the data file but then does not extract the `down` & `up` values???
If I stop the script and then restart it manually, everything starts working again... I have no frickin` clue as to what might be causing this. ARGGGGGGHHHHH!
I'll sleep on it and take a look at things again in the morning.
sh: bad number pops up once during the beginning of the script due to detanod variable. It is missing an underscore when initially declared (should be _detanod) and should have an initial value other than null before the comparison later on.
sh: bad number pops up once during the beginning of the script due to detanod variable. It is missing an underscore when initially declared (should be _detanod) and should have an initial value other than null before the comparison later on.
Thanks... fixed! Does anyone know if there is bash `strict` mode (a la "use strict" in JavaScript files)? Because , honestly, my router does not report that as an error.