With the following patch, set_poe is working too for all 8 ports on the RB5009:
--- a/mtpoe_ctrl.h 2023-04-01 02:15:03.221613194 +0200
+++ b/mtpoe_ctrl.h 2023-04-01 02:15:11.878279985 +0200
@@ -6,7 +6,7 @@
//ключ субконфига uci->network в котором находятся настройки PoE
#define MTIK_POE_UCI_CONFIG_KEY "mtik_poe"
//сколько всего PoE портов
-#define POE_PORTS_N 4
+#define POE_PORTS_N 8
//где находится файл с board_name
#define BOARD_NAME_FILE "/tmp/sysinfo/board_name"
@@ -78,7 +78,7 @@
define_str_opt(poe_uci_config_key),
define_int_opt(period, 0, 3600),
define_flag_opt(verbose),
- define_int_opt(port, 0, 3),
+ define_int_opt(port, 0, 7),
define_int_opt(val, 0, 0xFFFF),
define_flag_opt(version),
define_str_opt(raw_hex_val),
--- a/mtpoe_ctrl.c 2023-04-01 02:18:21.894949422 +0200
+++ b/mtpoe_ctrl.c 2023-04-01 02:18:00.398282442 +0200
@@ -219,8 +219,8 @@
action для устанавки состояние определенного PoE порта
*/
static void do_action_set_poe(void){
- if(port < 0 || port > 3)
- die_and_mess(-20, "port value must be 0..3");
+ if(port < 0 || port > 7)
+ die_and_mess(-20, "port value must be 0..7");
if(val < 0 || val > 2)
die_and_mess(-20, "PoE value must be 0..2");
__set_poe(port, val);
So only get_poe is not working when using the PoE v3 protocol.