In command line, how do I read the state of the port ?
The switch is the MT7530 inside the MT7621 chip
system message show alone:
[ 630.238798] mt7530 mdio-bus:1f lan1: Link is Down
[ 656.153255] mt7530 mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
But every attempt to ask it has failed.
root@OpenWrt:/# swconfig dev switch0 port 0 show
Failed to connect to the switch. Use the "list" command to see which switches are available.
root@OpenWrt:/# swconfig list
root@OpenWrt:/# swconfig show
As per the other reply, you need to be looking at DSA anyway, so you’re in the wrong part of the script. Forget about swconfig (on this device).
Rather than trying to understand the script, you could just give it a go.
Or if you post the contents of /etc/board.json, I’ll run the script against it and show you what the output would be. If you want to use it further you can go from there.