Whipped up a little script to loop over all the lanX interfaces to populate /etc/config/poe
, since by default only lan1 is set:
#!/bin/sh
# Scriptlet to populate /etc/config/poe based on available lanX port naming.
# Drawback: SFP ports are included too if they are named lanX.
for _PORT in $(uci get network.lan_vlan.ports)
do
uci add poe port
uci set poe.@port[-1].enable='1'
uci set poe.@port[-1].id="${_PORT/lan/}"
uci set poe.@port[-1].name="$_PORT"
uci set poe.@port[-1].poe_plus='1'
uci set poe.@port[-1].priority='2'
done
uci commit poe
Might help if we rename SFP ports to something else than lanX so for PoE purposes we can make an easy distinction. But that involves DTS changes as well AFAIK.
With @mrnuke's latest code, it seems to work okay here on my GS1900-8HP v1 with 22.03 HEAD, 2 PoE+ clients. @walterav My GS1900-8HP v1 has two older BCM59111KMLG controllers, my GS1900-10HP has the newer BCM59121B0KMLG.
# ubus call poe info
{
"firmware": "v17.1",
"mcu": "ST Micro ST32F100 Microcontroller",
"budget": 65.000000,
"consumption": 6.700000,
"ports": {
"lan1": {
"priority": 2,
"mode": "PoE+",
"status": "Delivering power",
"consumption": 3.500000
},
"lan2": {
"priority": 2,
"mode": "PoE+",
"status": "Searching"
},
"lan3": {
"priority": 2,
"mode": "PoE+",
"status": "Disabled"
},
"lan4": {
"priority": 2,
"mode": "Legacy",
"status": "Searching"
},
"lan5": {
"priority": 2,
"mode": "PoE+",
"status": "Disabled"
},
"lan6": {
"priority": 2,
"mode": "PoE+",
"status": "Searching"
},
"lan7": {
"priority": 2,
"mode": "PoE+",
"status": "Delivering power",
"consumption": 3.300000
},
"lan8": {
"priority": 2,
"mode": "PoE+",
"status": "Searching"