What's new

RT-AC68U NVRAM Low Warning

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

LexLuthor

Regular Contributor
Hi,

I have an Asus RT-AC68U and I'm getting an NVRAM low warning.

I found this thread and it looks like there are a couple of helpful things here.
https://www.snbforums.com/threads/solved-high-nvram-usage.56848/

I just don't know where to start as far as running the script on the router. I've activated support for scripts in admin->system. I understand that I have to create a file using the code in that thread and I guess I have to save it a certain way (using notepad++?) and then upload it to /jffs/scripts on the router and then run it. But how do I get it loaded into /jffs/scripts and how do I run it? Can I then delete the script after it's done running?
 
Ok, so I figured out I have to connect to the router using WinSCP. I can navigate to /jffs/scripts. But how do I save the script, where do I put it and how do I run it?
 
Creating scripts

Don't forget to set any script you create as being executable:

chmod a+rx /jffs/scripts/*

And like any UNIX script, they need to start with a shebang:

#!/bin/sh

Also, you must save files with UNIX line endings. Note that Windows's Notepad cannot save with UNIX line endings; use Notepad++ instead. You can also directly edit them on the router through SSH, by using vi or nano, both included in the firmware; they will create files with the proper line endings.

https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts#creating-scripts
 
Ok, so I figured out I have to connect to the router using WinSCP. I can navigate to /jffs/scripts. But how do I save the script, where do I put it and how do I run it?

I'm a noob, but this should get you started

In GUI
Administation/System
Enable SSH - Lan Only (this might already be set if logged in with WinSCP)

In WinSCP
1)Open folder with script file in left box, right box /jffs/scripts
2) Right click on script and select Upload
3) Go to right box, right click on script, select properties, and make sure all boxes with an X have a check mark in them (this makes script executable)
-----------

Install PUTTY on your computer, log in (since you figured this out with WinSCP I assume you can figure it out with Putty, too)
In Putty
cd /jffs/scripts
dos2unix -u scriptname (might not be necessary but just in case notepad ++ didn't save to a unix format)
sh scriptname (note, script name is case sensitive) this will run script
 
Thank you for the replies. I would have thought this would be documented somewhere.

I should be able to figure out putty. I'll look at that now. EDIT: I'm good with putty.

Ok, so I copied the script text from the other thread to notepad++. What name do I save it as? I see it has to have a unix ending, but what does that mean?
 
Thank you for the replies. I would have thought this would be documented somewhere.

I should be able to figure out putty. I'll look at that now. EDIT: I'm good with putty.

Ok, so I copied the script text from the other thread to notepad++. What name do I save it as? I see it has to have a unix ending, but what does that mean?

it can be almost any name. Doesn't need an ending, but *.sh seems to be good naming convention. Ie. LowWarn.sh
 
it can be almost any name. Doesn't need an ending, but *.sh seems to be good naming convention. Ie. LowWarn.sh
Ok, I used this post for the script https://www.snbforums.com/threads/solved-high-nvram-usage.56848/#post-494586
I just saved it as lowwarn1.sh, uploaded it and set the permissions. I then ran the putty commands and it looks like the script ran as I received the 2 echo command texts.
I rebooted the router and free nvram is unchanged. I had definitely been playing with some openvpn connections over time so I was hopeful that script might work here.

Did the script not run correctly or what other script should I try?
 
Last edited:
Ok, I used this post for the script https://www.snbforums.com/threads/solved-high-nvram-usage.56848/#post-494586
I just saved it as Script1, uploaded it and set the permissions. I then ran the putty commands and it looks like the script ran as I received the 2 echo command texts.
I rebooted the router and free nvram is unchanged. I had definitely been playing with some openvpn connections over time so I was hopeful that script might work here.

Did the script not run correctly or what other script should I try?


Sorry, I'm a noob at scripting, I've just been in your shoes that there was no simple instructions on how to run a script, which is what I gave you.

Just a note that these routers run with 95% or so memory. In Merlin click on Tools/Sysinfo and look at free memory, cache memory swap memory ,etc. My main screen shows memory usage at 95%, but 31.34 MB free, 14.47 MB Buffers, 88.54 MB cache and a swap 1.29 / 2048 MB (not sure what these numbers mean but I think I'm OK. Also, NVRAM usage 67128/ 131072 bytes and JFFS 7.43 / 48 MB. Again, don't know what numbers mean but I think I'm OK.
 
It certainly looks like that first script ran, but didn't do anything as far as freeing up nvram. At least I think I have the script creating and running part down.

Should I, and if so, how do I run the "one liner" from this post?
https://www.snbforums.com/threads/solved-high-nvram-usage.56848/#post-494600

Anything else I can do or other scripts to run to try to free up nvram? Or did my script not really run?

NVRAM Usage: 63389 / 65536 bytes

to run the command, just type it into putty as a command. Note: make sure you know what it is doing.

To test a script in "debug mode" (not sure if that is correct term here) enter sh -x scriptname which gives a more verbose response when run
 
to run the command, just type it into putty as a command. Note: make sure you know what it is doing.

To test a script in "debug mode" (not sure if that is correct term here) enter sh -x scriptname which gives a more verbose response when run
I appreciate the assistance so far!
So I re-ran the script with the -x and I got a bunch of + nvram unset lines spit back at me. I guess that means it really ran?

As for running that line directly in putty, I thought that might be possible, but what do I type in? Everything starting with for line in through nvram commit? Just in one long line?

EDIT: I figured out how to paste into putty using right click mouse and ran that whole command line
for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done; nvram commit

I no longer have the nvram warning! NVRAM usage: 54081 / 65536 bytes

JohnD5000, I can't thank you enough.

Hopefully, this thread helps someone else someday.
 
Last edited:
I appreciate the assistance so far!
So I re-ran the script with the -x and I got a bunch of + nvram unset lines spit back at me. I guess that means it really ran?

As for running that line directly in putty, I thought that might be possible, but what do I type in? Everything starting with for line in through nvram commit? Just in one long line?

NVRAM usage: 54081 / 65536 bytes

Can't help you with the line (over my head) but just type it in exactly and hit enter. I assume it is posted correctly.

To copy in Putty, copy the line normally, then go to putty and right click mouse
 
Can't help you with the line (over my head) but just type it in exactly and hit enter. I assume it is posted correctly.

To copy in Putty, copy the line normally, then go to putty and right click mouse
Sorry, I edited my previous post. Read it again.

Thank you!

EDIT: After reboot, it's back up a bit, so maybe we don't yet have this solved
61513 / 65536 bytes.
The warning is still off at least.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top