openWrt dying regulary

i am using Openwrt with TPLINK router:

1/ USB1 - usb flash mounted as main filesystem
2/ Huwei - usb 4g modem

Router is dying from time to time - once a day and i need to reboot it manually. I even put reboot in crontab every 4h but it seems not working after the router crushes.
During the "crush"
1/ WIFI network is workin
2/ LAN is working
3/ LUCI - gives some problem with accessing files - and is not available
4/ Internet connection via modem not sure
5/ openvpn (as a client) is not working so maybe there is now internet
6/ ssh is not responding
after reboot eveythink works ok for a couple of hours.

Logs& config

Fri Feb 28 16:31:33 2025 local2.info chat[3512]:  -- got it
Fri Feb 28 16:31:33 2025 local2.info chat[3512]: send ( ^M)
Fri Feb 28 16:31:33 2025 daemon.info pppd[3366]: Serial connection established.
Fri Feb 28 16:31:33 2025 kern.info kernel: [   71.829236] 3g-wan: renamed from ppp0
Fri Feb 28 16:31:33 2025 daemon.notice wpa_supplicant[1688]: Set new config for phy phy0
Fri Feb 28 16:31:33 2025 daemon.info pppd[3366]: Renamed interface ppp0 to 3g-wan
Fri Feb 28 16:31:33 2025 daemon.info pppd[3366]: Using interface 3g-wan
Fri Feb 28 16:31:33 2025 daemon.notice pppd[3366]: Connect: 3g-wan <--> /dev/ttyUSB0
Fri Feb 28 16:31:33 2025 daemon.notice wpa_supplicant[1688]: Set new config for phy phy1
Fri Feb 28 16:31:34 2025 daemon.notice hostapd: Set new config for phy phy0: /var/run/hostapd-phy0.conf
Fri Feb 28 16:31:34 2025 daemon.notice hostapd: Restart interface for phy phy0
Fri Feb 28 16:31:34 2025 daemon.notice hostapd: Configuration file: data: driver=nl80211 logger_syslog=127 logger_syslog_level=2 logger_stdout=127 logger_stdout_level=2 hw_mode=g beacon_int=100 #num_global_macaddr=1 channel=acs_survey  interface=phy0-ap0 bssid=c0:4a:00:9f:48:21 ctrl_interface=/var/run/hostapd ap_isolate=1 bss_load_update_period=60 chan_util_avg_period=600 disassoc_low_ack=1 skip_inactivity_poll=0 preamble=1 wmm_enabled=1 ignore_broadcast_ssid=0 uapsd_advertisement_enabled=1 utf8_ssid=1 multi_ap=0 wpa_passphrase=mojasiec wpa_psk_file=/var/run/hostapd-phy0-ap0.psk auth_algs=1 wpa=2 wpa_pairwise=CCMP ssid=iot bridge=br-lan wds_bridge= snoop_iface=br-lan wpa_disable_eapol_key_retries=0 wpa_key_mgmt=WPA-PSK okc=0 disable_pmksa_caching=1 dynamic_vlan=0 vlan_naming=1 vlan_no_bridge=1 vlan_file=/var/run/hostapd-phy0-ap0.vlan qos_map_set=0,0,2,16,1,1,255,255,18,22,24,38,40,40,44,46,48,56 #default_macaddr nas_identifier=c04a009f4821  (phy phy0) --> new PHY
Fri Feb 28 16:31:34 2025 kern.info kernel: [   72.881499] br-lan: port 2(phy0-ap0) entered blocking state
Fri Feb 28 16:31:34 2025 kern.info kernel: [   72.887311] br-lan: port 2(phy0-ap0) entered disabled state
Fri Feb 28 16:31:34 2025 kern.info kernel: [   72.893356] device phy0-ap0 entered promiscuous mode
Fri Feb 28 16:31:34 2025 daemon.notice hostapd: ACS: Automatic channel selection started, this may take a bit
Fri Feb 28 16:31:34 2025 daemon.notice hostapd: phy0-ap0: interface state UNINITIALIZED->ACS
Fri Feb 28 16:31:34 2025 daemon.notice hostapd: phy0-ap0: ACS-STARTED
Fri Feb 28 16:31:35 2025 daemon.notice hostapd: Set new config for phy phy1: /var/run/hostapd-phy1.conf
Fri Feb 28 16:31:35 2025 daemon.notice hostapd: Restart interface for phy phy1
Fri Feb 28 16:31:35 2025 daemon.notice hostapd: Configuration file: data: driver=nl80211 logger_syslog=127 logger_syslog_level=2 logger_stdout=127 logger_stdout_level=2 hw_mode=a beacon_int=100 chanlist=36 #num_global_macaddr=1 ieee80211n=1 ht_coex=0 ht_capab=[LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40] channel=36  interface=phy1-ap0 bssid=c0:4a:00:9f:48:22 ctrl_interface=/var/run/hostapd ap_isolate=1 bss_load_update_period=60 chan_util_avg_period=600 disassoc_low_ack=1 skip_inactivity_poll=0 preamble=1 wmm_enabled=1 ignore_broadcast_ssid=0 uapsd_advertisement_enabled=1 utf8_ssid=1 multi_ap=0 wpa_passphrase=mojasiec wpa_psk_file=/var/run/hostapd-phy1-ap0.psk auth_algs=1 wpa=2 wpa_pairwise=CCMP ssid=iot bridge=br-lan wds_bridge= snoop_iface=br-lan wpa_disable_eapol_key_retries=0 wpa_key_mgmt=WPA-PSK okc=0 disable_pmksa_caching=1 dynamic_vlan=0 vlan_naming=1 vlan_no_bridge=1 vlan_file=/var/run/hostapd-phy1-ap0.vlan qos_map_set=0,0,2,16,1,1,255,255,18,22,24,38,40,40,44,46,48,56 #default_macaddr nas_identifier=
Fri Feb 28 16:31:35 2025 kern.info kernel: [   74.067175] br-lan: port 3(phy1-ap0) entered blocking state
Fri Feb 28 16:31:35 2025 kern.info kernel: [   74.072864] br-lan: port 3(phy1-ap0) entered disabled state
Fri Feb 28 16:31:35 2025 kern.info kernel: [   74.078919] device phy1-ap0 entered promiscuous mode
Fri Feb 28 16:31:36 2025 kern.info kernel: [   74.768692] IPv6: ADDRCONF(NETDEV_CHANGE): phy1-ap0: link becomes ready
Fri Feb 28 16:31:36 2025 kern.info kernel: [   74.775704] br-lan: port 3(phy1-ap0) entered blocking state
Fri Feb 28 16:31:36 2025 kern.info kernel: [   74.781387] br-lan: port 3(phy1-ap0) entered forwarding state
Fri Feb 28 16:31:36 2025 daemon.notice netifd: Network device 'phy1-ap0' link is up
Fri Feb 28 16:31:37 2025 daemon.notice hostapd: phy1-ap0: interface state UNINITIALIZED->ENABLED
Fri Feb 28 16:31:37 2025 daemon.notice hostapd: phy1-ap0: AP-ENABLED
Fri Feb 28 16:31:37 2025 daemon.warn pppd[3366]: Could not determine remote IP address: defaulting to 10.64.64.64
Fri Feb 28 16:31:37 2025 daemon.notice pppd[3366]: local  IP address 10.250.116.217
Fri Feb 28 16:31:37 2025 daemon.notice pppd[3366]: remote IP address 10.64.64.64
Fri Feb 28 16:31:37 2025 daemon.notice pppd[3366]: primary   DNS address 194.204.159.1
Fri Feb 28 16:31:37 2025 daemon.notice pppd[3366]: secondary DNS address 194.204.152.34
Fri Feb 28 16:31:37 2025 daemon.warn openvpn(SMARTDOMguru)[2799]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: TCP/UDP: Preserving recently used remote address: [AF_INET]34.130.102.20:1194
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: Socket Buffers: R=[180224->180224] S=[180224->180224]
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: UDP link local: (not bound)
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: UDP link remote: [AF_INET]34.130.102.20:1194
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: Network unreachable, restarting
Fri Feb 28 16:31:37 2025 daemon.info hostapd: phy1-ap0: STA ce:91:01:ac:94:9d IEEE 802.11: authenticated
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: SIGUSR1[soft,network-unreachable] received, process restarting
Fri Feb 28 16:31:37 2025 daemon.notice openvpn(SMARTDOMguru)[2799]: Restart pause, 5 second(s)
Fri Feb 28 16:31:37 2025 daemon.info hostapd: phy1-ap0: STA ce:91:01:ac:94:9d IEEE 802.11: authenticated
Fri Feb 28 16:31:37 2025 daemon.info hostapd: phy1-ap0: STA ce:91:01:ac:94:9d IEEE 802.11: associated (aid 1)
Fri Feb 28 16:31:37 2025 daemon.warn pppd[3366]: Protocol-Reject for unsupported protocol 'IPv6' (0x57)
Fri Feb 28 16:31:37 2025 daemon.notice hostapd: phy1-ap0: AP-STA-CONNECTED ce:91:01:ac:94:9d auth_alg=open
Fri Feb 28 16:31:37 2025 daemon.info hostapd: phy1-ap0: STA ce:91:01:ac:94:9d WPA: pairwise key handshake completed (RSN)
Fri Feb 28 16:31:37 2025 daemon.notice hostapd: phy1-ap0: EAPOL-4WAY-HS-COMPLETED ce:91:01:ac:94:9d
Fri Feb 28 16:31:37 2025 daemon.notice netifd: Wireless device 'radio0' is now up
Fri Feb 28 16:31:38 2025 daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
Fri Feb 28 16:31:38 2025 daemon.warn pppd[3366]: Protocol-Reject for unsupported protocol 'IPv6' (0x57)
Fri Feb 28 16:31:38 2025 daemon.notice netifd: Wireless device 'radio1' is now up
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: started, version 2.90 cachesize 1000
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: DNS service limited to local subnets
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-nftset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq-dhcp[1]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for test
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for local
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Fri Feb 28 16:31:39 2025 daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: read /etc/hosts - 12 names
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 4 names
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Fri Feb 28 16:31:39 2025 daemon.notice netifd: Network device '3g-wan' link is up
Fri Feb 28 16:31:39 2025 daemon.notice netifd: Interface 'wan' is now up
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: reading /tmp/resolv.conf.d/resolv.conf.auto
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using nameserver 8.8.8.8#53
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using nameserver 194.204.159.1#53
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using nameserver 194.204.152.34#53
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for test
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for local
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.183 ce:91:01:ac:94:9d
Fri Feb 28 16:31:39 2025 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.183 ce:91:01:ac:94:9d iPhone
Fri Feb 28 16:31:40 2025 daemon.warn odhcpd[2115]: No default route present, overriding ra_lifetime!
Fri Feb 28 16:31:40 2025 daemon.warn odhcpd[2115]: No default route present, overriding ra_lifetime!
Fri Feb 28 16:31:40 2025 daemon.warn odhcpd[2115]: No default route present, overriding ra_lifetime!

**HERE IS THE CRUSH AND REBOOT** 

Mon Mar  3 09:04:47 2025 daemon.warn odhcpd[2115]: No default route present, overriding ra_lifetime!
Mon Mar  3 09:04:47 2025 daemon.warn openvpn(SMARTDOMguru)[2799]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
 

System

Hostname OpenWrt
Model TP-Link TL-WDR4300 v1
Architecture Atheros AR9344 rev 2
Target Platform ath79/generic
Firmware Version OpenWrt 23.05.5 r24106-10cc5fcd00 / LuCI openwrt-23.05 branch git-25.037.68351-2ca3f19

crontab -l
*/30 * * * * /opt/wifialive/wigialive.sh > /dev/null 2>$1
0 */4 * * * reboot

i don't have a clue how to cache the problem logs are empty, not sure what to do next. USB flash drive is a new, good quality, powersource stable over 1.5A not sure it seems like a power issue and/or something with filesystem - because the crontab reboot is not working after the crush

I wouldn't be surprised at all, if the modem causes overcurrent situations (especially while reconnecting); a powered USB hub might clarify that.

Do you have any functional need to reboot? OpenWrt does not have OEM telemetry growing OOM to justify that.

1 Like

i don't understand this comment. I need to reboot the router to get it working again, if i don't it stays dead (no internet, connections, vpn )

You can try ifup 4g-wan or if uhubctl works you can power-cycle usb port.
Fairly obvious router itself is fully functional just that it loses conneectivity.
Log entries are pretty consistent with your reboot schedule.

it's not 100% true, the luci webinterface and ssh oven locally are also dead, the cron reboot is also not working so probably any other command will also not work. I will try to put the lte modem into a usb powered hub and see if this helps

What does your wig script do? Do you have logs collected over wired connection or serial?

it's a ping checking if the internet connection is up and then restarting the vpn and now doing a reboot, but it never happened after the crush.

root@OpenWrt:~/opt/wifialive# cat wigialive.sh
#!/bin/sh
#wifi alive
echo "................................................"
date "+%Y.%m.%d %H:%M:%S"
echo " "
ping -c2 212.77.98.9

if [ $? != 0 ]
then

  echo "No network connection, restarting openvpn"


 reboot

else
   echo "Network OK"
fi
echo "................................................"
echo " "

What's the ram usage, have you got a swap file on the usb flash to help with the ram usage?

root@OpenWrt:~/opt/wifialive# free
total used free shared buff/cache available
Mem: 122028 24756 72408 116 24864 60208
Swap: 0 0 0

swap not enabled

Reboot failed?
Please examine logs leading to no connectivity, what you caught is turmoil from restatrting vpn by reboot command,
Once vpn (i think 3g modem) is down try ifup and intetface restarts, lets try to make that all into new keepalive script.

i changed it to reboot, the first assumption is to restart the vpn, but the main problem is that none of the cron commands is executing during the "freez". Tried to put reboot as a separate command to check if it will work, but still the router is not rebooting during the freez.

in case of logs - there are no logs during the freez so i can't check what is wrong.

Well what seems from time is your ping failed and reboot command did not succeed. That only logs to serial, hard to guess it is crash at boot due to memory filled with data or some of few devices in inconsistent state.

Lets disable all reboot schedules and try to restart usb mofem then vpn interface in various combinations?