Using realtek-poe on DGS-1210-10P revision F3

I have a D-Link DGS-1210-10P (revision F3) running OpenWRT snapshot.

When I use realtek-poe to talk to the PoE controller on /dev/ttyS1, it does not seem to turn on PoE. I'm including the output from realtek-poe -d below.

realtek-poe: TX -> 20 01 ff ff ff ff ff ff ff ff ff 18
realtek-poe: RX <- 20 01 61 ff ff ff ff ff ff ff ff 7a
realtek-poe: TX -> 17 02 02 ff ff ff ff ff ff ff ff 13
realtek-poe: RX <- 17 02 61 ff ff ff ff ff ff ff ff 72
realtek-poe: TX -> 02 03 00 ff ff ff ff ff ff ff ff fd
realtek-poe: RX <- 02 03 00 ff ff ff ff ff ff ff ff fd
realtek-poe: TX -> 18 04 00 06 a4 00 aa ff ff ff ff 6c
realtek-poe: RX <- 18 04 00 ff ff ff ff ff ff ff ff 14
realtek-poe: TX -> 13 05 7f 02 ff ff ff ff ff ff ff 92
realtek-poe: RX <- 13 05 ff ff ff ff ff ff ff ff ff 0f
realtek-poe: TX -> 10 06 7f 03 ff ff ff ff ff ff ff 91
realtek-poe: RX <- 10 06 01 ff ff ff ff ff ff ff ff 0f
realtek-poe: TX -> 1a 07 00 02 ff ff ff ff ff ff ff 1c
realtek-poe: RX <- 1a 07 61 ff ff ff ff ff ff ff ff 7a
realtek-poe: TX -> 1c 08 00 03 ff ff ff ff ff ff ff 20
realtek-poe: RX <- 1c 08 61 ff ff ff ff ff ff ff ff 7d
realtek-poe: TX -> 11 09 00 01 ff ff ff ff ff ff ff 14
realtek-poe: RX <- 11 09 00 ff ff ff ff ff ff ff ff 12
realtek-poe: TX -> 15 0a 00 01 ff ff ff ff ff ff ff 19
realtek-poe: RX <- 15 0a 00 00 ff ff ff ff ff ff ff 18
realtek-poe: TX -> 00 0b 00 01 ff ff ff ff ff ff ff 05
realtek-poe: RX <- 00 0b 00 ff ff ff ff ff ff ff ff 03
realtek-poe: TX -> 23 0c ff ff ff ff ff ff ff ff ff 26
realtek-poe: RX <- 23 0c 61 ff ff ff ff ff ff ff ff 88
realtek-poe: TX -> 28 0d 00 01 01 01 02 01 03 01 ff 3e
realtek-poe: RX <- 28 0d 61 ff ff ff ff ff ff ff ff 8e
realtek-poe: Invalid port status packet (port=97)
realtek-poe: TX -> 26 0e 00 ff ff ff ff ff ff ff ff 2c
realtek-poe: RX <- 26 0e 61 ff ff ff ff ff ff ff ff 8d
realtek-poe: TX -> 30 0f 00 ff ff ff ff ff ff ff ff 37
realtek-poe: RX <- 30 0f 61 ff ff ff ff ff ff ff ff 98
(from here on, commands 0x23, 0x26, 0x28 and 0x30 repeat with similar outputs)

Notice the complaints about an invalid port number in response to command 0x28 ("get all port status"). Going by the documentation here, my feeling is that 0x61 it is some kind of error code, and not a port number. It also pops up in response to command 0x1a earlier.

Interestingly, when I change the port ID in /etc/config/poe from 1 to 2...

config global                                                                                                                      
        option budget   '170'                                                                                                       
                                                                                                                                   
config port                                                                                                                        
        option enable   '1'                                                                                                        
        option id       '2'                                                                                                       
        option name     'lan1'                                                                                                     
        option poe_plus '1'                                                                                                        
        option priority '2'

... the PoE device on the other end of the line turns on! The error about port 97 remains, however:

realtek-poe: TX -> 20 01 ff ff ff ff ff ff ff ff ff 18
realtek-poe: RX <- 20 01 61 ff ff ff ff ff ff ff ff 7a
realtek-poe: TX -> 17 02 02 ff ff ff ff ff ff ff ff 13
realtek-poe: RX <- 17 02 61 ff ff ff ff ff ff ff ff 72
realtek-poe: TX -> 02 03 00 ff ff ff ff ff ff ff ff fd
realtek-poe: RX <- 02 03 00 ff ff ff ff ff ff ff ff fd
realtek-poe: TX -> 18 04 00 06 a4 00 aa ff ff ff ff 6c
realtek-poe: RX <- 18 04 00 ff ff ff ff ff ff ff ff 14
realtek-poe: TX -> 13 05 7f 02 ff ff ff ff ff ff ff 92
realtek-poe: RX <- 13 05 ff ff ff ff ff ff ff ff ff 0f
realtek-poe: TX -> 10 06 7f 03 ff ff ff ff ff ff ff 91
realtek-poe: RX <- 10 06 01 ff ff ff ff ff ff ff ff 0f
realtek-poe: TX -> 1a 07 01 02 ff ff ff ff ff ff ff 1d
realtek-poe: RX <- 1a 07 61 ff ff ff ff ff ff ff ff 7a
realtek-poe: TX -> 1c 08 01 03 ff ff ff ff ff ff ff 21
realtek-poe: RX <- 1c 08 61 ff ff ff ff ff ff ff ff 7d
realtek-poe: TX -> 11 09 01 01 ff ff ff ff ff ff ff 15
realtek-poe: RX <- 11 09 00 ff ff ff ff ff ff ff ff 12
realtek-poe: TX -> 15 0a 01 01 ff ff ff ff ff ff ff 1a
realtek-poe: RX <- 15 0a 01 00 ff ff ff ff ff ff ff 19
realtek-poe: TX -> 00 0b 00 00 ff ff ff ff ff ff ff 04
realtek-poe: RX <- 00 0b 00 ff ff ff ff ff ff ff ff 03
realtek-poe: TX -> 00 0c 01 01 ff ff ff ff ff ff ff 07
realtek-poe: RX <- 00 0c 00 ff ff ff ff ff ff ff ff 04
realtek-poe: TX -> 23 0d ff ff ff ff ff ff ff ff ff 27
realtek-poe: RX <- 23 0d 61 ff ff ff ff ff ff ff ff 89
realtek-poe: TX -> 28 0e 00 01 01 01 02 01 03 01 ff 3f
realtek-poe: RX <- 28 0e 61 ff ff ff ff ff ff ff ff 8f
realtek-poe: Invalid port status packet (port=97)
realtek-poe: TX -> 26 0f 00 ff ff ff ff ff ff ff ff 2d
realtek-poe: RX <- 26 0f 61 ff ff ff ff ff ff ff ff 8e
realtek-poe: TX -> 30 10 00 ff ff ff ff ff ff ff ff 38
realtek-poe: RX <- 30 10 61 ff ff ff ff ff ff ff ff 99
realtek-poe: TX -> 26 11 01 ff ff ff ff ff ff ff ff 30
(again, commands 0x23, 0x26, 0x28 and 0x30 repeat with similar outputs)

Does anybody have a recommendation on how to proceed with debugging? I suppose I could go out and buy a logic analyzer to snoop the traffic between the stock firmware and the controller, although I'm a bit hesitant to do this as I have no experience with these kinds of things.

Before going to a logic analyzer, I would check what happens if you enable all the PoE ports. @svanheule, @hurricos, do you have handy a known working realtek-poe config for the DGS-1210-10P ?

I would also look at the output of
ubus call poe info

I sadly don't own one. @hanno -- you'd be best served grabbing that logic analyzer and working against Svanheule's docs: https://svanheule.net/switches/software/broadcom_poe_control_protocol?s[]=poe

I don't have config handy...

But, if you trust /etc/board.json to be correct regarding PoE info, you could use the script from https://github.com/Hurricos/realtek-poe/pull/31/commits/43d5a8bd20edfa79e3a492d952c263f2c856f1dd to generate a basic valid config. You'll nee to move/remove /etc/config/poe first though.

Hi gents, thanks for the responses! I wasn't expecting this to get any attention still, but this is all very helpful.

For now, the output of ubus call poe info looks like this:

{
        "firmware": "v255.255",
        "budget": 170.000000,
        "consumption": 2508.699951,
        "ports": {
                "lan1": {
                        "priority": 2,
                        "status": "unknown"
                }
        }
}

This is based on the config in my first post.

Maybe instead of getting a logic analyzer, I could connect a Raspberry Pi to the UART header and snoop it that way? My impression is that it's the same kind of interface as the serial UART header I had to use to install OpenWRT in the first place.

Thanks! I'm going to be away for a bit, but I think I'll try this first when I get back.

While is it a UART like any other, you need two input lines if you want to snoop traffic. Otherwise you can only follow traffic in one direction using the Rx line of you RPi. Probably best to also add a series resistor to limit current flowing to/from you sniffer (although Rx should be high impedance input).

@hanno, Do you have pictures of the insides? I think your switch may have a Realtek PSE instead of Broadcom.

Alright! I'll give it a try; I think I can try to convince my Pi to expose a second UART interface.

Interesting - I'll try and make some pictures when I get back home (some time next week).

I finally got around to taking the thing apart and taking pictures of the inside. Here they are.


Yup, that's a Realtek PSE. realtek-poe support for it is still a work in progress [1]

[1] https://github.com/Hurricos/realtek-poe/pull/35

Sweet! Do you reckon I could give that branch a go? I'm happy to beta-test this, unless you think it needs some more polishing first.

There should be a github action that builds a package. It's only for snapshot though. Not sure if it installs on 23.05