Hi all,
in the last days I was testing a bit with the BTHH5A to verify if it's reliable in case of DSL disconnections, or cable unplug/replug (which may happen sometimes in my case), and check if it reconnects without issues.
Speaking of the unplug/replug use case, what I see is some random behaviour. Sometimes the connection is re-established as soon as the DSL cable is plugged back in, other times the wan interface just seems to never wake up again, independently from how much time the modem has been left without cable. When this happens, no matter what kind of reset I perform (ip link set up/down, reset of the interface via LuCI, reset of the network service), the interface is just dead and reconnection never triggered... or at least it isn't for a looong time.
This night I unplugged/replugged the cable a couple of times until the interface didn't came back again (yes, this is all it's required to make it happen, just a handful of tries with some random minutes between each other). I then left the cable plugged in for the whole night, just to see if it would ever connect again by its own. And well, in the morning I found it back online! Great! But... these are the logs since the disconnection, up to the reconnection complete with PPPoE session established (some pppd debug noise stripped):
Sep 29 00:57:58 OpenWrt kernel: [102292.565925] leave showtime
Sep 29 00:57:58 OpenWrt netifd: Network device 'dsl0' link is down
Sep 29 00:57:58 OpenWrt netifd: Interface 'wan' has link connectivity loss
Sep 29 00:57:59 OpenWrt pppd[21809]: Terminating on signal 15
Sep 29 00:57:59 OpenWrt pppd[21809]: Connect time 36.9 minutes.
Sep 29 00:57:59 OpenWrt pppd[21809]: Sent 5257644 bytes, received 138515652 bytes.
Sep 29 00:57:59 OpenWrt netifd: Network device 'pppoe-wan' link is down
Sep 29 00:57:59 OpenWrt pppd[21809]: Script /lib/netifd/ppp-down started (pid 22040)
Sep 29 00:57:59 OpenWrt pppd[21809]: sent [LCP TermReq id=0x2 "User request"]
Sep 29 00:57:59 OpenWrt pppd[21809]: Script /lib/netifd/ppp-down finished (pid 22040), status = 0x1
Sep 29 00:58:02 OpenWrt pppd[21809]: sent [LCP TermReq id=0x3 "User request"]
Sep 29 00:58:03 OpenWrt netifd: Interface 'wan' is now down
Sep 29 00:58:03 OpenWrt netifd: Interface 'wan' is disabled
Sep 29 00:58:03 OpenWrt kernel: [102297.599151] IPv6: ADDRCONF(NETDEV_UP): dsl0: link is not ready
Sep 29 00:58:03 OpenWrt netifd: Interface 'wan' is enabled
Sep 29 00:58:03 OpenWrt dnsmasq[21250]: no servers found in /tmp/resolv.conf.auto, will retry
Sep 29 03:48:17 OpenWrt kernel: [112510.502412] enter showtime, cell rate: 0 - 2150, 1 - 2150, xdata addr: 0xa6040000
Sep 29 03:48:17 OpenWrt kernel: [112510.508878] IPv6: ADDRCONF(NETDEV_CHANGE): dsl0: link becomes ready
Sep 29 03:48:17 OpenWrt netifd: Network device 'dsl0' link is up
Sep 29 03:48:17 OpenWrt netifd: Interface 'wan' has link connectivity
Sep 29 03:48:17 OpenWrt netifd: Interface 'wan' is setting up now
Sep 29 03:48:17 OpenWrt kernel: [112510.526041] enter showtime, cell rate: 0 - 2150, 1 - 2150, xdata addr: 0xa6040000
Sep 29 03:48:17 OpenWrt insmod: module is already loaded - slhc
Sep 29 03:48:17 OpenWrt insmod: module is already loaded - ppp_generic
Sep 29 03:48:17 OpenWrt insmod: module is already loaded - pppox
Sep 29 03:48:17 OpenWrt insmod: module is already loaded - pppoe
Sep 29 03:48:17 OpenWrt pppd[22678]: Plugin rp-pppoe.so loaded.
Sep 29 03:48:17 OpenWrt pppd[22678]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.7
Sep 29 03:48:17 OpenWrt pppd[22678]: pppd 2.4.7 started by root, uid 0
Sep 29 03:48:22 OpenWrt pppd[22678]: PPP session is 1863
Sep 29 03:48:22 OpenWrt pppd[22678]: Connected to 54:4b:8c:97:37:10 via interface dsl0
Sep 29 03:48:22 OpenWrt pppd[22678]: using channel 8
Sep 29 03:48:22 OpenWrt kernel: [112516.011569] pppoe-wan: renamed from ppp0
Sep 29 03:48:22 OpenWrt pppd[22678]: Renamed interface ppp0 to pppoe-wan
Sep 29 03:48:22 OpenWrt pppd[22678]: Using interface pppoe-wan
Sep 29 03:48:22 OpenWrt pppd[22678]: Connect: pppoe-wan <--> dsl0
Sep 29 03:48:22 OpenWrt pppd[22678]: PAP authentication succeeded
Sep 29 03:48:22 OpenWrt pppd[22678]: local IP address edit
Sep 29 03:48:22 OpenWrt pppd[22678]: remote IP address 192.168.100.1
Sep 29 03:48:22 OpenWrt pppd[22678]: primary DNS address 85.38.28.6
Sep 29 03:48:22 OpenWrt pppd[22678]: secondary DNS address 85.38.28.7
Sep 29 03:48:22 OpenWrt pppd[22678]: Script /lib/netifd/ppp-up started (pid 22775)
Sep 29 03:48:23 OpenWrt netifd: Network device 'pppoe-wan' link is up
Sep 29 03:48:23 OpenWrt netifd: Interface 'wan' is now up
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: reading /tmp/resolv.conf.auto
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using local addresses only for domain test
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using local addresses only for domain onion
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using local addresses only for domain localhost
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using local addresses only for domain local
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using local addresses only for domain invalid
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using local addresses only for domain bind
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using local addresses only for domain lan
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using nameserver 85.38.28.6#53
Sep 29 03:48:23 OpenWrt dnsmasq[21250]: using nameserver 85.38.28.7#53
Sep 29 03:48:23 OpenWrt pppd[22678]: Script /lib/netifd/ppp-up finished (pid 22775), status = 0x1
Sep 29 03:48:23 OpenWrt firewall: Reloading firewall due to ifup of wan (pppoe-wan)
As you can see, it took almost 3 hrs to reconnect since the time i replugged the cable (just few minutes after the cable disconnection at the start of the logs). How can this be?
Also, when the wan interface goes down, pppd terminates, and I guess this is the expected behaviour as far as I've read around, since interfaces and connections should be managed by netifd, which is in charge to restart it where appropriate. So as I understand it, the culprit should not be pppd itself, but the condition that triggers a new PPPoE session -presumably some sort of DSL line detection- which is not triggered for a long time, as we can see. Please correct me about any of this if I'm wrong.
In any case, this is how pppd gets executed, if it matters:
/usr/sbin/pppd nodetach ipparam wan ifname pppoe-wan lcp-echo-interval 1 lcp-echo-failure 5 lcp-echo-adaptive +ipv6 nodefaultroute usepeerdns maxfail 1 user <user> password <password> ip-up-script /lib/netifd/ppp-up ipv6-up-script /lib/netifd/ppp6-up ip-down-script /lib/netifd/ppp-down ipv6-down-script /lib/netifd/ppp-down mtu 1492 mru 1492 plugin rp-pppoe.so nic-dsl0
I played a bit with the persist and maxfail options in /etc/ppp/options trying to keep pppd always up on the interface, but they don't seem the get applied, and since pppd executes fine whenever it's called, they don't seem to be much relevant after all.
I'd like to note that I never ever had this sort of problem using other commercial modem with OEM firmwares, so it should not be on the ISP side. And in general, when not pulling wires around, the DSL wan looks reasonably stable.
Thanks everyone for the support.