Bringing support for realtek-poe to mainline OpenWrt

Your recent package installs fine now without errors but how long does the debug output runs?

/etc/init.d/poe stop
/etc/init.d/poe disable
realtek-poe -d

TX -> 0x20 0x01 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x18
RX -> 0x20 0x01 0x02 0x18 0x00 0xe1 0x11 0x11 0x00 0x01 0x01 0x40
TX -> 0x17 0x02 0x02 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x13
RX -> 0x17 0x02 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x11
TX -> 0x02 0x03 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xfd
RX -> 0x02 0x03 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xfd
TX -> 0x18 0x04 0x00 0x00 0x00 0x00 0x00 0xff 0xff 0xff 0xff 0x18
RX -> 0x18 0x04 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x15
TX -> 0x06 0x05 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x03
RX -> 0x06 0x05 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x03
TX -> 0x18 0x06 0x00 0x06 0xa4 0x00 0xaa 0xff 0xff 0xff 0xff 0x6e
RX -> 0x18 0x06 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x17
TX -> 0x1a 0x07 0x00 0x02 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x1c
RX -> 0x1a 0x07 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x1a
TX -> 0x1c 0x08 0x00 0x03 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x20
RX -> 0x1c 0x08 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x1d
TX -> 0x15 0x09 0x00 0x01 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x18
RX -> 0x15 0x09 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x17
TX -> 0x13 0x0a 0x00 0x02 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x18
RX -> 0x13 0x0a 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x16
TX -> 0x11 0x0b 0x00 0x01 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x16
RX -> 0x11 0x0b 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x15
TX -> 0x10 0x0c 0x00 0x03 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x18
RX -> 0x10 0x0c 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x15
TX -> 0x00 0x0d 0x00 0x01 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x07
RX -> 0x00 0x0d 0x00 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x06
TX -> 0x00 0x0e 0x01 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x08
RX -> 0x00 0x0e 0x01 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x08
TX -> 0x00 0x0f 0x02 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x0a
RX -> 0x00 0x0f 0x02 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x0a
TX -> 0x00 0x10 0x03 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x0c
RX -> 0x00 0x10 0x03 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x0c
TX -> 0x00 0x11 0x04 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x0e
RX -> 0x00 0x11 0x04 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x0e
TX -> 0x00 0x12 0x05 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x10
RX -> 0x00 0x12 0x05 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x10
TX -> 0x00 0x13 0x06 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x12
RX -> 0x00 0x13 0x06 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x12
TX -> 0x00 0x14 0x07 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x14
RX -> 0x00 0x14 0x07 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x14
TX -> 0x23 0x15 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x2f
RX -> 0x23 0x15 0x00 0x00 0x00 0x00 0x07 0x02 0xff 0xff 0xff 0x3e
TX -> 0x2a 0x16 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x38
RX -> 0x2a 0x16 0x00 0x11 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0xc1
TX -> 0x26 0x17 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x35
RX -> 0x26 0x17 0x00 0x03 0x01 0x4d 0x02 0x00 0xff 0xff 0xff 0x8d
TX -> 0x30 0x18 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x40
RX -> 0x30 0x18 0x00 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x14
TX -> 0x26 0x19 0x01 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x38
RX -> 0x26 0x19 0x01 0x00 0x00 0x4d 0x00 0x01 0xff 0xff 0xff 0x8b
TX -> 0x30 0x1a 0x01 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x43
RX -> 0x30 0x1a 0x01 0x00 0x00 0x00 0x00 0x00 0xcd 0x00 0x00 0x18
TX -> 0x26 0x1b 0x02 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x3b
RX -> 0x26 0x1b 0x02 0x00 0x00 0x4d 0x00 0x02 0xff 0xff 0xff 0x8f
TX -> 0x30 0x1c 0x02 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x46
RX -> 0x30 0x1c 0x02 0x00 0x00 0x00 0x00 0x00 0xce 0x00 0x00 0x1c
TX -> 0x26 0x1d 0x03 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x3e
RX -> 0x26 0x1d 0x03 0x00 0x00 0x4d 0x00 0x03 0xff 0xff 0xff 0x93
TX -> 0x30 0x1e 0x03 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x49
RX -> 0x30 0x1e 0x03 0x00 0x00 0x00 0x00 0x00 0xce 0x00 0x00 0x1f
TX -> 0x26 0x1f 0x04 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x41
RX -> 0x26 0x1f 0x04 0x00 0x00 0x4d 0x00 0x04 0xff 0xff 0xff 0x97
TX -> 0x30 0x20 0x04 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x4c
RX -> 0x30 0x20 0x04 0x00 0x00 0x00 0x00 0x00 0xca 0x00 0x00 0x1e
TX -> 0x26 0x21 0x05 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x44
RX -> 0x26 0x21 0x05 0x00 0x00 0x4d 0x00 0x05 0xff 0xff 0xff 0x9b
TX -> 0x30 0x22 0x05 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x4f
RX -> 0x30 0x22 0x05 0x00 0x00 0x00 0x00 0x00 0xc9 0x00 0x00 0x20
TX -> 0x26 0x23 0x06 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x47
RX -> 0x26 0x23 0x06 0x00 0x00 0x4d 0x00 0x06 0xff 0xff 0xff 0x9f
TX -> 0x30 0x24 0x06 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x52
RX -> 0x30 0x24 0x06 0x00 0x00 0x00 0x00 0x00 0xcb 0x00 0x00 0x25
TX -> 0x26 0x25 0x07 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x4a
RX -> 0x26 0x25 0x07 0x00 0x00 0x4d 0x00 0x07 0xff 0xff 0xff 0xa3
TX -> 0x30 0x26 0x07 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x55
RX -> 0x30 0x26 0x07 0x00 0x00 0x00 0x00 0x00 0xc9 0x00 0x00 0x26
TX -> 0x26 0x27 0x08 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x4d
RX -> 0x26 0x27 0x08 0x00 0x00 0x4d 0x00 0x08 0xff 0xff 0xff 0xa7
TX -> 0x30 0x28 0x08 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x58
RX -> 0x30 0x28 0x08 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x2c
TX -> 0x26 0x29 0x09 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x50
RX -> 0x26 0x29 0x09 0x00 0x00 0x4d 0x00 0x09 0xff 0xff 0xff 0xab
TX -> 0x30 0x2a 0x09 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x5b
RX -> 0x30 0x2a 0x09 0x00 0x00 0x00 0x00 0x00 0xcb 0x00 0x00 0x2e
TX -> 0x26 0x2b 0x0a 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x53
RX -> 0x26 0x2b 0x0a 0x00 0x00 0x4d 0x00 0x0a 0xff 0xff 0xff 0xaf
TX -> 0x30 0x2c 0x0a 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x5e
RX -> 0x30 0x2c 0x0a 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x32
TX -> 0x26 0x2d 0x0b 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x56
RX -> 0x26 0x2d 0x0b 0x00 0x00 0x4d 0x00 0x0b 0xff 0xff 0xff 0xb3
TX -> 0x30 0x2e 0x0b 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x61
RX -> 0x30 0x2e 0x0b 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x35
TX -> 0x26 0x2f 0x0c 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x59
RX -> 0x26 0x2f 0x0c 0x00 0x00 0x4d 0x00 0x0c 0xff 0xff 0xff 0xb7
TX -> 0x30 0x30 0x0c 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x64
RX -> 0x30 0x30 0x0c 0x00 0x00 0x00 0x00 0x00 0xc9 0x00 0x00 0x35
TX -> 0x26 0x31 0x0d 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x5c
RX -> 0x26 0x31 0x0d 0x00 0x00 0x4d 0x00 0x0d 0xff 0xff 0xff 0xbb
TX -> 0x30 0x32 0x0d 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x67
RX -> 0x30 0x32 0x0d 0x00 0x00 0x00 0x00 0x00 0xca 0x00 0x00 0x39
TX -> 0x26 0x33 0x0e 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x5f
RX -> 0x26 0x33 0x0e 0x00 0x00 0x4d 0x00 0x0e 0xff 0xff 0xff 0xbf
TX -> 0x30 0x34 0x0e 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x6a
RX -> 0x30 0x34 0x0e 0x00 0x00 0x00 0x00 0x00 0xcb 0x00 0x00 0x3d
TX -> 0x26 0x35 0x0f 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x62
RX -> 0x26 0x35 0x0f 0x00 0x00 0x4d 0x00 0x0f 0xff 0xff 0xff 0xc3
TX -> 0x30 0x36 0x0f 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x6d
RX -> 0x30 0x36 0x0f 0x00 0x00 0x00 0x00 0x00 0xc9 0x00 0x00 0x3e
TX -> 0x26 0x37 0x10 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x65
RX -> 0x26 0x37 0x10 0x00 0x00 0x4d 0x00 0x10 0xff 0xff 0xff 0xc7
TX -> 0x30 0x38 0x10 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x70
RX -> 0x30 0x38 0x10 0x00 0x00 0x00 0x00 0x00 0xca 0x00 0x00 0x42
TX -> 0x26 0x39 0x11 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x68
RX -> 0x26 0x39 0x11 0x00 0x00 0x4d 0x00 0x11 0xff 0xff 0xff 0xcb
TX -> 0x30 0x3a 0x11 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x73
RX -> 0x30 0x3a 0x11 0x00 0x00 0x00 0x00 0x00 0xcb 0x00 0x00 0x46
TX -> 0x26 0x3b 0x12 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x6b
RX -> 0x26 0x3b 0x12 0x00 0x00 0x4d 0x00 0x12 0xff 0xff 0xff 0xcf
TX -> 0x30 0x3c 0x12 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x76
RX -> 0x30 0x3c 0x12 0x00 0x00 0x00 0x00 0x00 0xcb 0x00 0x00 0x49
TX -> 0x26 0x3d 0x13 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x6e
RX -> 0x26 0x3d 0x13 0x00 0x00 0x4d 0x00 0x13 0xff 0xff 0xff 0xd3
TX -> 0x30 0x3e 0x13 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x79
RX -> 0x30 0x3e 0x13 0x00 0x00 0x00 0x00 0x00 0xca 0x00 0x00 0x4b
TX -> 0x26 0x3f 0x14 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x71
RX -> 0x26 0x3f 0x14 0x00 0x00 0x4d 0x00 0x14 0xff 0xff 0xff 0xd7
TX -> 0x30 0x40 0x14 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x7c
RX -> 0x30 0x40 0x14 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x50
TX -> 0x26 0x41 0x15 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x74
RX -> 0x26 0x41 0x15 0x00 0x00 0x4d 0x00 0x15 0xff 0xff 0xff 0xdb
TX -> 0x30 0x42 0x15 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x7f
RX -> 0x30 0x42 0x15 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x53
TX -> 0x26 0x43 0x16 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x77
RX -> 0x26 0x43 0x16 0x00 0x00 0x4d 0x00 0x16 0xff 0xff 0xff 0xdf
TX -> 0x30 0x44 0x16 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x82
RX -> 0x30 0x44 0x16 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x56
TX -> 0x26 0x45 0x17 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x7a
RX -> 0x26 0x45 0x17 0x00 0x00 0x4d 0x00 0x17 0xff 0xff 0xff 0xe3
TX -> 0x30 0x46 0x17 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x85
RX -> 0x30 0x46 0x17 0x00 0x00 0x00 0x00 0x00 0xcc 0x00 0x00 0x59

EDIT:
Well ubus does output something this time:

ubus call poe info
{
	"firmware": "v17.1",
	"mcu": "ST Micro ST32F100 Microcontroller",
	"budget": 170.000000,
	"consumption": 0.000000,
	"ports": {
		"lan7": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		}
	}
}

Realtek-poe is a daemon, so it will keep running and spitting out things until you kill it :slightly_smiling_face:.

As in CTRL + C since the original init.d deamon was already stopped and didn't show up in ps | grep poe? How much output / lines is relevent to collect also compared to previous output the checksum errors are gone but also the status text messages?

Looking at the ubus output it really does detect something, as soon as a POE device gets plugged in the status changes from Searching to unknown when swapping a device from port 3 to port 5.

$ 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'
$ ubus call poe info
{
	"firmware": "v17.1",
	"mcu": "ST Micro ST32F100 Microcontroller",
	"budget": 170.000000,
	"consumption": 0.000000,
	"ports": {
		"lan1": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan2": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan3": {
			"priority": 2,
			"mode": "PoE+",
			"status": "unknown"
		},
		"lan4": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan5": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan6": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan7": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan8": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		}
	}
}

$ ubus call poe info
{
	"firmware": "v17.1",
	"mcu": "ST Micro ST32F100 Microcontroller",
	"budget": 170.000000,
	"consumption": 0.000000,
	"ports": {
		"lan1": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan2": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan3": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan4": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan5": {
			"priority": 2,
			"mode": "PoE+",
			"status": "unknown"
		},
		"lan6": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan7": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan8": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		}
	}
}

Yes, that's something I saw on my GS1900-8HP v1 frequently as well with the older codebase.

Port 9-16 with following config (guess that I have to change OPTION ID aswell) show Disabled or Other fault instead of Searching and inconsistent of being which port. As in having port 15 connected shows port 9 as unknown... and port 9 connected shows port 9 as fault...

$ /etc/init.d/poe restart
$ cat /etc/config/poe
config global
	option budget	'170'

config port
	option enable	'1'
	option id	'9'
	option name	'lan9'
	option poe_plus	'1'
	option priority	'2'

config port
        option enable	'1'
        option id	'10'
        option name	'lan10'
        option poe_plus '1'
        option priority '2'

config port
        option enable	'1'
        option id	'11'
        option name	'lan11'
        option poe_plus '1'
        option priority '2'

config port
        option enable	'1'
        option id	'12'
        option name	'lan12'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '13'
        option name     'lan13'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '14'
        option name     'lan14'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '15'
        option name     'lan15'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '16'
        option name     'lan16'
        option poe_plus '1'
        option priority '2'
ubus call poe info
{
	"firmware": "v17.1",
	"mcu": "ST Micro ST32F100 Microcontroller",
	"budget": 170.000000,
	"consumption": 0.000000,
	"ports": {
		"lan9": {
			"priority": 2,
			"mode": "PoE",
			"status": "Other fault"
		},
		"lan10": {
			"priority": 2,
			"mode": "PoE",
			"status": "Disabled"
		},
		"lan11": {
			"priority": 2,
			"mode": "PoE",
			"status": "Disabled"
		},
		"lan12": {
			"priority": 2,
			"mode": "PoE",
			"status": "Disabled"
		},
		"lan13": {
			"priority": 2,
			"mode": "PoE",
			"status": "Disabled"
		},
		"lan14": {
			"priority": 2,
			"mode": "PoE",
			"status": "Disabled"
		},
		"lan15": {
			"priority": 2,
			"mode": "PoE",
			"status": "Disabled"
		},
		"lan16": {
			"priority": 2,
			"mode": "PoE",
			"status": "Disabled"
		}
	}
}

EDIT:

Port 17-24 renaming same option-id as 9-16, keeps all ports in Disabled state. So only port 9 behaves differently... using this config?

Maybe it has something to do with how the port status is requested? A port index of 0xff isn't valid, but there still appears to be a reply. The all-zero reply from from port 0 is also odd (if the port isn't actually set as disabled, that is)

Current findings are inline with @hurricos except I didn't read anything about how port 9 or higher functions in his situation.

I do have to say that I use "pseudo" POE devices currently a Mikrotik Hex-POE(rb960pgs) or Ubiquite AC MESH(uap-ac-m) which commonly work with dumb/passive POE and lower voltage as well. They do however auto power on by POE and work by running the ZyXEL OEM 2.70 firmware.

Later today I try a real 802.3af POE device Netgear WNDAP360.

Maybe @bmork his findings on enabling POE on 1900-10HP which uses slightly different BCM59121 vs BCM59111 (24HP/8HP) may give insight, however the GPIO pins he mentions are not available anymore:

That's because there is a gpio-hog in the dts, which just enables the poe by default now. But maybe they have used a different pin or somehting like that?

1 Like

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"
1 Like

If building and running a custom OpenWrt build with this gpio-hog removed from the DTS will this automatically bring back a list of GPIO pins you had and worth triggering by manually echo 1 to it?

		compatible = "realtek,rtl8231-gpio";
		#gpio-cells = <2>;
		gpio-controller;
		indirect-access-bus-id = <0>;

		poe_enable {
			gpio-hog;
			gpios = <13 GPIO_ACTIVE_HIGH>;
			output-high;
		};
	};

Nice to see your progress on the 8HP but are you still using your earlier released realtek-poe package or already a newer compiled one?

md5sum Downloads/realtek-poe_2022-05-29-b07fbee9-1_mips_4kec.ipk 
4d1978aea888b73f6ff45b4e3a36001a

This is the one I compiled this morning and have put up for download.

# opkg list-installed|grep realtek-poe
realtek-poe - 2022-05-29-b07fbee9-1
1 Like

That request looks okay to me:

  • Hey, can I have request=0x2a, sequence id = 0x16, port = 0x00 ?
  • Sure, here's request=0x2a, sequence id = 0x16, port = 0x00:
    • port 0 is 0x11
    • port 1 is 0x10
    • et cetera.

Right, I should learn to read my own documentation:

Return the short status for eight ports, starting at the requested port.

The reply format was apparently documented incorrectly. Fixed that, and also updated the name of the first byte to first_port to make the sequence more obvious.

3 Likes

I think I figured out why the status shows as "unknown". It fixes the reporting, but not the power delivery aspect:

I've spotted found a few more realtek-poe bugs for devices with more than 8 ports. I would advise only testing the first 8 ports for the time being

@hurricos, should we start a matrix of which devices work/don't work, and what version of realtek-poe makes them happy?

1 Like

FWIW, the "get port status" command has enum status value 0x3 listed as "Test mode". If wonder if that corresponds to the classification stage, if that isn't already covered by "Searching".

Tested with the latest commits on the GS1900-8HP v1. Output below. Seems a bit hit and miss though, with the package I compiled this morning, the switch (which I powercycled multiple times today) came up with just one PoE+ client out of two. Seems all good again now.

Updated 2022-06-15-b07fbee9 package here.

# ubus call poe info
{
	"firmware": "v17.1",
	"mcu": "ST Micro ST32F100 Microcontroller",
	"budget": 65.000000,
	"consumption": 7.100000,
	"ports": {
		"lan1": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Delivering power",
			"consumption": 3.400000
		},
		"lan2": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan3": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan4": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan5": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		},
		"lan6": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Disabled"
		},
		"lan7": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Delivering power",
			"consumption": 3.900000
		},
		"lan8": {
			"priority": 2,
			"mode": "PoE+",
			"status": "Searching"
		}
	}
}

Do you know how to make github build packages automatically?