Router Misbehaving After WAN Connection Drops

Thank you very much for the reply.

I've had a quick look into the DNS. It could possibly be the DNSCrypt and/or Dynamic DNS packages I have installed. I'll try disabling them, re-test and report back.

As a side note in relation to RAM, is there a way to monitor or log RAM usage?

Will

Try disable Squid, I think your device not have enough resources for Squid cache.

top, htop, free, ...

Hey Guys I'm back and unfortunately with bad news...

I ended up re-installing LEDE Reboot 17.01.4, updated all my packages via SSH using PuTTY and installed the following packages:
luci-ssl
luci-app-upnp
luci-app-sqm
luci-app-ddns
ca-bundle
ddns-scripts
hostapd-common
hostapd-utils
wpad
qm-scripts

I then disabled the DDNS scripts package thinking this was the cause of the DNS request via the menu 'System > Startup' and clicked on the 'Enabled' button which turned into to 'Disabled'. Finally I rebooted my router and left if for a few minutes before then unplugging the WAN cable, sitting and waiting patiently for LuCI to start behaving slow and locking up after about 15 minutes or so. On the overview page I took some screenshots of the RAM usage available when it slowly drifted down to 9% compared to the 78% I have when everything is all up and working. As well slow loading webpages within LuCI I would also get an out of memory message in plain text. What's weird is when I could get to the 'Status > Processes' page and look under the RAM usage column there wasn't anything over 1%. I was expecting something to be hogging the RAM resources...

I'll be uploading images in the morning.

System Log

This is all very odd. Hope To hear back from someone soon.

Many thanks

Will

@willowen100 -

How are you updating the packages? It is not recommended to update core packages because it can introduce issues related to kernel versions and other dependencies.

My recommendation would be to re-flash with 17.01.4 and only setup the basics (do not update any existing packages, do not install any new ones). Test at this point.

Then, one at a time, install packages (again, do not update core packages; installing new packages is fine, though)... do it one at a time (aside from direct dependencies, of course) and test between each package installation. At some point, the problem will show up again and you should have a better idea of what might be causing the issue (base install, or a specific package, etc.). The best way to troubleshoot is to keep it simple and isolate variables.

1 Like

Thank you for the reply psherman.

When I updated the packages I did it through SSH using OPKG Packet Manager commands. If you recommend not updating the packages and only flashing the firmware and installing the fresh packages I do want, I'll give that a go and let you know.

Many thanks

Will

Yes, please try what I recommended. Start simple. Does the problem manifest when you have a fresh install (with no extra packages installed, no upgrades). If so, you are either dealing with a bug or a configuration issue with the base firmware. Installing packages one-by-one after verifying that the base install is okay (assuming that is the case) will help narrow down the packages responsible for the issue.

Read this thread (and feel free to search for other threads related) for information about why it is not recommended to update the core packages. If you are really intent on updating those core packages, it would probably be best to build your own firmware from the source or to use a snapshot.

Hi

I've finally got round to troubleshooting my router.

I've factory reset the router so there is a fresh instance of LEDE 17.01.4.' So far all I've changed is gone to 'Network > Interfaces' and deleted WAN6 (as I don't really need this) and then under WAN changed the protocol to PPPoE, filled the username and password accordingly to my ISP and then set the MTU to 1492.

Unfortunately in the space of five and a half minutes the router is out of memory. What do I do now? I haven't installed any packages and it's already playing up with no Ethernet cable plugged into the WAN port.

Hope to hear from someone soon.

Many thanks

Will

Something doesn't sound right. I'd try reflashing the firmware with a freshly downloaded image.

This device has 512 MB RAM...I agree with @psherman. Can you provide the log entry (or picture of the top command) that shows that you're out of memory.

My model only has 256MB of RAM. https://openwrt.org/toh/hwdata/linksys/linksys_wrt1900ac_v1

Is there supposed to be a memory column when the 'top' command is used in PuTTY?

This is the 'free' command before I change my WAN interface settings:

root@LEDE:~# free
             total       used       free     shared    buffers     cached
Mem:        253716      46736     206980        572       1972       7156
-/+ buffers/cache:      37608     216108
Swap:            0          0          0
root@LEDE:~#

This is the top command used before I change my WAN settings:

Mem: 46604K used, 207112K free, 572K shrd, 1972K buff, 7156K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.01 0.02 0.00 2/78 2097
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 2097  2079 root     R     1048   0%   0% top
 1278     1 root     S     1444   1%   0% /sbin/netifd
 1352     1 root     S     1336   1%   0% /usr/sbin/uhttpd -f -h /www -r LEDE -
    1     0 root     S     1324   1%   0% /sbin/procd
 1231     1 root     S     1240   0%   0% /sbin/rpcd
 1297     1 root     S     1212   0%   0% /usr/sbin/odhcpd
 2079  2078 root     S     1036   0%   0% -ash
 1322     1 root     S     1036   0%   0% /usr/sbin/crond -f -c /etc/crontabs -
 1445  1278 root     S     1032   0%   0% udhcpc -p /var/run/udhcpc-eth1.pid -s
 1459     1 root     S     1032   0%   0% /usr/sbin/ntpd -n -N -S /usr/sbin/ntp
 1222     1 root     S     1008   0%   0% /sbin/logd -S 64
  830     1 root     S      964   0%   0% /sbin/ubusd
 2078  1579 root     S      880   0%   0% /usr/sbin/dropbear -F -P /var/run/dro
 1557     1 dnsmasq  S      868   0%   0% /usr/sbin/dnsmasq -C /var/etc/dnsmasq
 1579     1 root     S      812   0%   0% /usr/sbin/dropbear -F -P /var/run/dro
 1444  1278 root     S      804   0%   0% odhcp6c -s /lib/netifd/dhcpv6.script
  831     1 root     S      668   0%   0% /sbin/askfirst /usr/libexec/login.sh
    4     2 root     SW       0   0%   0% [kworker/0:0]
    7     2 root     SW       0   0%   0% [rcu_sched]
^C 12     2 root     SW       0   0%   0% [kworker/1:0]

After a few minutes I tried the 'top' command and these are the results. I should note it was taking four times as long to populate the list.

Mem: 236080K used, 17636K free, 572K shrd, 492K buff, 1596K cached
CPU:   0% usr  43% sys   0% nic  33% idle  22% io   0% irq   0% sirq
Load average: 2.28 0.92 0.34 4/160 3106
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 3016  2079 root     R     1048   0%  18% top
 1278     1 root     S     1512   1%   7% /sbin/netifd
 1352     1 root     D     1344   1%   6% /usr/sbin/uhttpd -f -h /www -r LEDE -
  247     2 root     SW       0   0%   3% [kswapd0]
 1297     1 root     S     1212   0%   2% /usr/sbin/odhcpd
 1459     1 root     S     1032   0%   2% /usr/sbin/ntpd -n -N -S /usr/sbin/ntp
 1557     1 dnsmasq  S      868   0%   2% /usr/sbin/dnsmasq -C /var/etc/dnsmasq
 2078  1579 root     S      880   0%   1% /usr/sbin/dropbear -F -P /var/run/dro
   12     2 root     SW       0   0%   0% [kworker/1:0]
 3101     2 root     SW       0   0%   0% [kworker/1:60]
 3067     2 root     SW       0   0%   0% [kworker/1:41]
 3094     2 root     SW       0   0%   0% [kworker/1:53]
    1     0 root     S     1324   1%   0% /sbin/procd
 3035     2 root     SW       0   0%   0% [kworker/0:6]
 3083     2 root     SW       0   0%   0% [kworker/0:12]
 3029     2 root     SW       0   0%   0% [kworker/0:3]
 3091     2 root     SW       0   0%   0% [kworker/0:20]
 3028     2 root     SW       0   0%   0% [kworker/1:6]
    7     2 root     SW       0   0%   0% [rcu_sched]
 3080     2 root     SW       0   0%   0% [kworker/0:9]

However, when I tried the 'free' command for a final time (which typed in really laggy) I was presented with an error message:

root@LEDE:~# free
-ash: can't fork

Many thanks

Will

Are you running Swap space?
If so why?

Are you testing with the web GUI open?
If so, why?

This is still more than most people have.

You have 175+ MB RAM free, you are not out of memory. What issue(s) are you actually experiencing??? (Correction, 17 MB)

Are you doing some kind of file operations???

@lleachii the second top actually only shows 17mb of free memory, so there is definitely something wrong.

Swap maybe?

Definitely turn this off if you are!

1 Like

This is the stock LEDE firmware. I have not added any additional packages or made any other tweaks except change the protocol on the 'Network > Interfaces' page. I'm not using any swap space. The only program I had open was PuTTY. The issue is that all the LAN devices stop seeing each other, the Wi-Fi drops out so the router becomes useless with a WAN drop out. I'm definitely not using Swap space as I wouldn't know how to especially as I have not configured the router for USB.

LEDE/OpenWRT can be run in as little as 32MB of RAM (not recommended, see 4/32 warning), so 256MB should be totally sufficient.

I would start fresh with a fresh, official stable download of LEDE 17.01.4 for your device (here). Grab the sysupgrade.bin file (and ensure it is for your version of hardware -- acv1, acv2, or acs). Do not preserve system settings as you flash.

Then make the WAN6 and WAN/PPPoE changes that are necessary and see what happens.

1 Like

Just done your exact instructions and I'm still getting the same result.

I think I remember this device might have issues with a memory leak with the WiFi drivers. Could you please disable all WiFi interfaces completely (just click op stop on the WiFi interfaces overview page of Luci) and see whether the bug still occurs? We can continue from there :slight_smile:

After setting up the password (as you do on clean installs) I went over 'Network > Wireless' and clicked remove on both radios despite being disabled by default. I then did my usual basic tweaks; delete WAN 6 on interfaces page, set PPPoE as protocol, put in username and password and set MTU to 1492. Same result. LuCI locked out with 'Internal Server Error
Failed to create CGI process: Out of memory' message and SSH refusing commands.

Does the same happen when you flash 18.06-snapshot instead of 17.01.4?
http://downloads.openwrt.org/releases/18.06-SNAPSHOT/targets/mvebu/cortexa9/

As far as I'm aware the development builds of OpenWRT don't have LuCI installed. With this in mind how do I allow internet access to the OpenWRT router so that I can download packages but keep it connected to my spare ISP provided that's providing a WAN and LAN connection so that I can connect to it via my PC on the LAN?

The WAN port (eth1) is defaulted to the DHCP client protocol. However, when I try to access the IP that my ISP router has given out I have no GUI. At the moment I have my ISP router connected from its LAN port to the LAN port on the OpenWRT router and I have a connection. However, going to 'System > Software' and clicking update lists can't establish a connection. It's though it's set to read from eth1 not eth0 (OpenWRT's LAN interface).