vortex-5 / ddwrt-bwmon

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

No such file or directory in bwreader.php on line 3 #51

Closed thirdoff closed 7 years ago

thirdoff commented 7 years ago

WARNING: FILE_GET_CONTENTS(/TMP/WWW/USAGE_STATS.JS): FAILED TO OPEN STREAM: NO SUCH FILE OR DIRECTORY IN /JFFS/WWW/BWREADER.PHP ON LINE 3
NaN KB

then it shows network names but 0 KB data

I installed using instructions to the letter. It worked for a few days but now I see the above error when accessing http://[IP]:81/bwmon.html

vortex-5 commented 7 years ago

the error you're showing is related to a startup failure where usage_stats.js could not be copied to the tmp/www directory.

while the router is still on try running the ./startup.sh command again it should reload the service check if the /tmp/www/usage_stats.js file is created after that.

thirdoff commented 7 years ago

I do have "/jffs/bwmon/startup.sh" as a startup script. I thought this would run the script on a reboot. I will try running it manually.

thirdoff commented 7 years ago

that worked thanks. is there a way to make it run successfully on startup/reboot?

vortex-5 commented 7 years ago

Yes the instructions say to set this as the startup script on drive mount. That setting should be available under the USB storage tab under services for ddwrt.

If it's not working correctly for you even after setting that up then it might require you diagnose what is actually running after startup.

for the record startup.sh should be the script referenced not start.sh startup.sh has a built in delay to allow the router to finish booting for the first minute before trying to detect php support so the entire startup can run correctly without the delay it may not detect which mode it's running in correctly.

thirdoff commented 7 years ago

yes, I have "/jffs/bwmon/startup.sh" set under "Run-on-mount Script Name" but it seems it doesnt start. /jffs/bwmon/startup.sh is exactly what command I ran manually. I will run "top" next time I reboot the router unless you have a better way to see whats running after boot. Thank you.

vortex-5 commented 7 years ago

it might be a good idea to modify startup.sh to write a log file so you know that it did indeed run.

Since it's hard to catch startup.sh since it only runs for 1 minute on startup of the system at which point the router is probably still pretty busy and not yet accepting ssh connections.

I don't have the code yet for that since adding a lot of logging code didn't seem necessary and would waste router resources but in your case it might be worth it just to create a blank file with maybe the date / time inside so you know you had a successful startup.

thirdoff commented 7 years ago

"it might be a good idea to modify startup.sh to write a log file so you know that it did indeed run."

Let's "act" like I don't know much (if anything) about code. :-) How would I add this?

J3n50m4t commented 7 years ago

How would I add this

Just add the following line to the startup script - I placed it after the sleep and above the start script, because I don't know if it would run after the start. echo $(date '+%Y %b %d %H:%M:%S') startup.sh run >> log

This writes a file named log in the bwmon directory. In this file it creates a line: 2017 May 12 10:20:07 startup.sh run

seanvree commented 6 years ago

@vortex-5 , I didn't want to open a new issue, but I JUST started having this issue. Was running fine, not sure what changed.

Netgear R7000 Firmware Version DD-WRT v3.0-r33675M kongac (11/03/17) Kernel VersionLinux 4.4.95 #472 SMP Fri Nov 3 23:27:37 CET 2017 armv7l

bwmon

vortex-5 commented 6 years ago

hmm... Other than the files not being accessable I'm not sure it says can't cd to . which is strange to begin with unless there's a problem with the evaluated value it's trying to cd with I dunno.

seanvree commented 6 years ago

@vortex-5 Yeah, really weird. I tried to blow out the DIR and re-create, which it does but for some reason, it won't execute any of the .sh files. I've been using it for a while, but hadn't looked at it in a few weeks, but I just went to view it and it wasn't working, so I tried to re-install. I'm sure it's something with the KONG build? Not sure. I'll keep messing with it.