TL-WDR4300 Switch failed

Hi, all. Sorry I couldn't find what's the topic for troubleshooting.

Ever since I installed OpenWRT on my TP-Link TL-WDR4300 I have never been able to use the yellow switch ports for LAN

I tried to check the switch on the CLI and this is what I get (outputs sanitized for my sake)

root@openwrt:/# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
24: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
25: wlan-bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
root@openwrt:/# ifconfig
br-lan Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.x.1 Bcast:192.168.x.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:33799 errors:0 dropped:0 overruns:0 frame:0
TX packets:44189 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11018555 (10.5 MiB) TX bytes:35659427 (34.0 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4948 errors:0 dropped:0 overruns:0 frame:0
TX packets:4948 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:452480 (441.8 KiB) TX bytes:452480 (441.8 KiB)

wlan-bridge Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.y.201 Bcast:192.168.y.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:41636 errors:0 dropped:24 overruns:0 frame:0
TX packets:28163 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32813264 (31.2 MiB) TX bytes:11256529 (10.7 MiB)
root@openwrt:/# swconfig dev switch0 show
Failed to connect to the switch. Use the "list" command to see which switches are available.
root@openwrt:/# swconfig dev eth0 show
Failed to connect to the switch. Use the "list" command to see which switches are available.
root@openwrt:/# swconfig list
root@openwrt:/#

I have tried rebooting, resetting, factory-resetting back to stock, to ddwrt, and back to openwrt. On stock and ddwrt switch works OK.

Idk what's going on. Need help, please.

JJ

It's rather unclear what you're actually asking about…

First of all, the tl-wdr4300 is fully supported - including full switch support. Given that you're pasting a screenshot of the switch setting, you must have gotten network access 'somehow', which would only be possible over LAN (as wireless is disabled in firstboot conditions) - so what's the problem?

The tl-wdr4300 has only a single CPU port, WAN and the 4 LAN ports are all part of the same switch and get separated from each other via the switch/ VLAN configuration - so by the very nature of it, it must be working (or the device wouldn't be supported). My own is working fine, with a rather involved switch/ VLAN configuration as well.

1 Like

hi, @slh
thank you for your response.

I am not sure about that lack of wifi at first boot statement... i was able to connect to a wifi named Openwrt after first boot. there's a wireless switch on the wdr4300. i just had to switch it off and back on and it got that wifi enabled somehow.

there's no way my switch is defective. getting this back to stock make it work...
that's why i was looking for some help on how to troubleshoot that
how do you tshoot the switch then?
when i google that i got that command i mentioned

swconfig dev eth0 show
and
swconfig dev switch0 show

but all i get on both

Failed to connect to the switch. Use the "list" command to see which switches are available.

and when doing list it retrieve empty/nothing

root@openwrt:/# swconfig list
root@openwrt:/#

i change the cat6 cable to a new one. i tested both cables anyways with another linksys router and they are working fine. my desktop nic is also working OK.
i am not sure what's going but i swear the switch is not working somehow...

could you ssh/cli to yours and show me if you could get that output?

thanks for the help

JJ

Hmm, I tried the swconfig commands and they work fine on my WDR4300.

root@router-l:~# swconfig list
Found: switch0 - mdio-bus.0
root@router-l:~# swconfig dev switch0 show
Global attributes:
	enable_vlan: 1
	ar8xxx_mib_poll_interval: 0
	ar8xxx_mib_type: 0
	enable_mirror_rx: 0
	enable_mirror_tx: 0
	mirror_monitor_port: 0
	mirror_source_port: 0
	arl_age_time: 300
	arl_table: address resolution table
Port 0: MAC xx:..
[\removed]

	igmp_snooping: 0
	igmp_v3: 0
Port 0:
	mib: ???
	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:1 link:down
Port 2:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:2 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 3:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:3 link:up speed:1000baseT full-duplex txflow rxflow eee100 eee1000 auto
Port 4:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:4 link:down
Port 5:
	mib: ???
	enable_eee: 0
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 1
	link: port:5 link:down
Port 6:
	mib: ???
	enable_eee: ???
	igmp_snooping: 0
	vlan_prio: 0
	pvid: 0
	link: port:6 link:up speed:10baseT half-duplex 
VLAN 1:
	vid: 1
	ports: 0t 2 3 4 5

Are you running 19.07? Is it ath79 or ath71? Have you seen any strange kernel log messages related to the switch?

1 Like

Is it an official build? You should be running the ath79 build from downloads.openwrt.org. Then check the boot log for errors related to switch detection.

@mk24 @ergamus
Thank you for your reply.

Yeah I am. This is the one i'm using:
openwrt-19.07.7-ath79-generic-tplink_tl-wdr4300-v1-squashfs-factory.bin

Model TP-Link TL-WDR4300 v1
Architecture Atheros AR9344 rev 2
Firmware Version OpenWrt 19.07.7 r11306-c4a6851c72 / LuCI openwrt-19.07 branch git-21.044.30835-34e0d65

Kernel logs (sanitized): https://pastebin.com/G27CS5Uq
switch keyword appear on logs
[ 8.755700] mount_root: switching to jffs2 overlay
[ 0.228624] clocksource: Switched to clocksource MIPS

System logs (sanitized): https://pastebin.com/dNsbykrZ

On System logs switch keyword appear on log:

Sat May 1 18:56:45 2021 daemon.notice procd: /etc/rc.d/S20network: Failed to connect to the switch. Use the "list" command to see which switches are available.

Nothing else to show so far.

I'm not sure what's going on. I'm considering to re-flash the whole firmware to the same build but I had made some progress on my configurations and some wifi bridging i've been doing so i don't want to start all over again (if i have to i will do it anyways, just saying).

@mk24 where do I check boot logs? is it in System logs?

Thank you all for your time and ideas.

JJ

Ouch ! your dmesg is full of

[    0.492791] libphy: Fixed MDIO Bus: probed
[    0.840423] libphy: ag71xx_mdio: probed
[    0.844447] mdio_bus mdio-bus.0: MDIO device at address 0 is missing.
[    0.851108] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
...
[    1.229726] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.

last one being repeated a few times after as well.

Can you try 21.02?


I'm wondering if it's corrupted u-boot, the device is almost 10years old and you may have developed a flipped bit in flash memory somewhere causing u-boot to wrongly initialize something.

Can you boot it into tftp flashing mode? Does uboot even emit any ARP packets looking for a tftp server.

Can you checksum the u-boot partition and compare it to same region from downloadable firmware (e.g. you can binwalk the extracted zip file to find where u-boot starts in firmware update files you download from tp-link website).

Also, it might be an opportunity to try out one of the pepe2k u-boot builds.


This is interesting to me because I've recently had some flaky-ness with a wdr4300 after using it fine for about 6months (bridge between wifi and lan stops working out of the blue). But when I started having issues, I didn't have time to debug further and just swapped it for a different device altogether. wdr4300 is now sitting in my drawer - just another project device, maybe I try 21.02 on it.

2 Likes

Hello, @risk
thank you for your reply.

sorry for the delay.

i sysupgrade to 21.02.0-rc1 and the results are the same.

regarding those u-boot instructions. not sure on how to do that. never tried it before. how to check if my u-boot is corrupted? as a matter of fact i did try to tftp mode and i never got any ARP packets coming, and actually the switch port never came up at all... not sure what's going on. as I mentioned before, if i rollback to stock tplink firmware, or ddwrt, the switch works...

thanks fro the help

@risk @mk24
hello all.

im revisiting this.

when going through the website of my device, i noticed this message
https://openwrt.org/toh/tp-link/tl-wdr4300_v1

The switch ports may turn out to be not properly bridged in a default bootup config, causing connection failure. In this case you need to setup /etc/config/network or do manual swconfig setup - see [switch](https://openwrt.org/docs/guide-user/network/vlan/switch) for advice.

when comparing the default configs im running and the examples provided on the device page, and even on the swconfig doc page

nothing is similar. some uses the keyword enable on the switch config, usage of the ifname is different (on the same line)...., some others don't. mine doesn't. not sure if the document is related to an old version of the swconfig or the kernel perhaps...

example on my device website:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config switch
        option name 'eth0'
        option reset '1'
        option enable_vlan '1'

## Port: internet
config switch_vlan
        option device 'eth0'
        option vlan '1'
        option ports '0t 1'
        list comment 'port internet, eth0.1'

## Port LAN1
config switch_vlan
        option device 'eth0'
        option vlan '2'
        option ports '0t 2'
        list comment 'port lan1, eth0.2'

example on swconfig doc manual

config 'switch' 'eth0'
        option 'reset' '1'
        option 'enable_vlan' '1'
 
config 'switch_vlan' 'eth0_1'
        option 'device' 'eth0'
        option 'vlan' '1'
        option 'ports' '0 1 3t 5t'
 
config 'switch_vlan' 'eth0_2'
        option 'device' 'eth0'
        option 'vlan' '2'
        option 'ports' '2 4t 5t'
 
config 'switch_vlan' 'eth0_3'
        option 'device' 'eth0'
        option 'vlan' '3'
        option 'ports' '3t 4t'
 
config 'switch_port'
        option 'device' 'eth0'
        option 'port' '3'
        option 'pvid' '3'

my config (sanitized)

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'xxxx:yyyy:zzzz::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option gateway '192.168.x.1' #upstream_isprouter
	option ipaddr '192.168.y.1'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr 'xx:xx:xx:yy:yy:yy'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0t 2 3 4 5 1'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0t'

i really need help on getting my switch online... i don't get why it's not even listed.

root@openwrt:/etc/config# swconfig dev switch0 show
Failed to connect to the switch. Use the "list" command to see which switches are available.
root@openwrt:/etc/config# swconfig list
root@openwrt/etc/config#

this forum seems uninterested on this kind of issues... is there any moderator that can help?
can someone help me on getting this clarified? should i open a bug on the bug tracker?

@ergamus @slh hello. hope you are doing well. can you please check my message above?

the guide even mentioned to use the option setup but it just doesn't work...

root@openwrt:/etc/config# swconfig setup
swconfig list
swconfig dev [port |vlan ] (help|set |get |load |show)

i don't get this thing :frowning:

hey @risk

I sysupgraded to OpenWrt 21.02.0-rc3 r16172-2aba3e9784 for ath79

tplink_tl-wdr4300-v1-squashfs-sysupgrade.bin 8ac2bef7ead16975724dfe47d9a883e868937b73f63b2c76cbe92e15c3a98f24 5184.3 KB Tue Jun 15 12:54:50 2021

according to my device page https://openwrt.org/toh/tp-link/tl-wdr4300_v1

this kernel log should be similar to this

[    0.647823] switch0: Atheros AR8327 rev. 4 switch registered on ag71xx-mdio.0
[    0.717193] libphy: ag71xx_mdio: probed
[    1.311422] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd034, driver=Atheros AR8216/AR8236/AR8316]
[    1.322903] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII

but it's not :cry: !

still getting the same kernel error over and over:

[    0.443462] libphy: Fixed MDIO Bus: probed
[    0.782216] libphy: ag71xx_mdio: probed
[    0.786302] mdio_bus mdio.0: MDIO device at address 0 is missing.
[    0.792593] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
...
[    1.261359] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.585353] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
...
[    4.053674] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    4.062118] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    4.391091] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    4.435710] hub 1-1:1.0: USB hub found
[    4.516489] hub 1-1:1.0: 4 ports detected
[    4.628641] random: procd: uninitialized urandom read (4 bytes read)
[    4.912191] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    4.925674] random: jshn: uninitialized urandom read (4 bytes read)
...
[   18.341378] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[   20.267221] ath: EEPROM regdomain sanitized
[   20.267233] ath: EEPROM regdomain: 0x64
[   20.267237] ath: EEPROM indicates we should expect a direct regpair map
[   20.267261] ath: Country alpha2 being used: 00
[   20.267265] ath: Regpair used: 0x64
[   20.278233] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   20.280632] ieee80211 phy1: Atheros AR9300 Rev:4 mem=0xb0000000, irq=14
[   20.340719] kmodloader: done loading kernel modules from /etc/modules.d/*
[   20.605536] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.

What is going on with this build? :s how do i tshoot this kind of issues?

is it something wrong with my build on the ag71xx-mdio.0 of my router or the ag71xx.c driver of the openwrt?

this is way ahead of my knowledge. i could really use some help from some dev or someone familiar with kernel driver tshoot.

:cry:

Switch not detected means you're running the wrong firmware, or there is a hardware failure.

The standard way to check for hardware failure is to flash back to stock firmware and confirm that it functions.

1 Like

all right @mk24
i will try to revert back to stock this weekend.
thank you very much.