Closed bittorf closed 1 year ago
ubus call poe manage ' { "port" : "lan1", "enable" : true }'
ubus call poe manage ' { "port" : "lan1", "enable" : false }'
root@switch-realtek-838x-zyxel-gs1900-8hp:~# ubus call poe info { "firmware": "v22.4", "mcu": "ST Micro ST32F100 Microcontroller", "budget": 170.000000, "consumption": 0.000000, "ports": { "lan1": { "priority": 2, "mode": "PoE+", "status": "Searching" } } }
"Searching" tells me what I need to know: your PoE device hasn't responded to the low-level protocol to request power in the first place. The port is nevertheless enabled.
FWIW Sometimes this comes out of a port mapping issue, I believe we've tested the GS1900-8HP though.
thanks a lot @mrnuke - my mistake was really,
that \"enable\" was not correctly escaped,
so both are working:
ubus call poe manage '{ "port" : "lan1", "enable" : false }'
or
ubus call poe manage "{ \"port\" : \"lan1\", \"enable\" : true }"
for the record, after writing a full configfile,
i can switch off and on all ports using above method - bravo!
root@switch-realtek-838x-zyxel-gs1900-8hp:~# cat /etc/config/poe
config global
option budget '170'
config port
option enable '1'
option id '1'
option name 'lan1'
option poe_plus '1'
option priority '2'
config port
option enable '1'
option id '2'
option name 'lan2'
option poe_plus '1'
option priority '2'
config port
option enable '1'
option id '3'
option name 'lan3'
option poe_plus '1'
option priority '2'
config port
option enable '1'
option id '4'
option name 'lan4'
option poe_plus '1'
option priority '2'
config port
option enable '1'
option id '5'
option name 'lan5'
option poe_plus '1'
option priority '2'
config port
option enable '1'
option id '6'
option name 'lan6'
option poe_plus '1'
option priority '2'
config port
option enable '1'
option id '7'
option name 'lan7'
option poe_plus '1'
option priority '2'
config port
option enable '1'
option id '8'
option name 'lan8'
option poe_plus '1'
option priority '2'
a full info dump including all 8 ports looks like this.
spot the ports 2, 4 and 8, which are enabled AND active.
oot@switch-realtek-838x-zyxel-gs1900-8hp:~# ubus call poe info
{
"firmware": "v22.4",
"mcu": "ST Micro ST32F100 Microcontroller",
"budget": 170.000000,
"consumption": 0.400000,
"ports": {
"lan1": {
"priority": 2,
"mode": "PoE+",
"status": "Searching"
},
"lan2": {
"priority": 2,
"mode": "PoE+",
"status": "Delivering power",
"consumption": 3.700000
},
"lan3": {
"priority": 2,
"mode": "PoE+",
"status": "Disabled"
},
"lan4": {
"priority": 2,
"mode": "PoE+",
"status": "Delivering power",
"consumption": 2.900000
},
"lan5": {
"priority": 2,
"mode": "PoE+",
"status": "Disabled"
},
"lan6": {
"priority": 2,
"mode": "PoE+",
"status": "Searching"
},
"lan7": {
"priority": 2,
"mode": "PoE+",
"status": "Disabled"
},
"lan8": {
"priority": 2,
"mode": "PoE+",
"status": "Delivering power",
"consumption": 0.400000
}
}
}
i am sure my syntax is wrong,
can sombody please give a working example?