Hurricos / realtek-poe

5 stars 10 forks source link

disabling a PoE port in `/etc/config/poe` removes the whole port status from `ubus call poe info` #16

Closed walterav1984 closed 2 years ago

walterav1984 commented 2 years ago

ZyXEL GS1900-24HPv1 realtek-poe all versions affected till CI31

Bug or feature?

This has been around from the beginning of testing the realtek-poe package. Although we have seen ports being flagged unwanted as status Disabled in the past and those ports were not delivering PoE anymore.

Currently Disabling and Enabling ports via /etc/config/poe does work but shouldn't the ubus call poe info reflect the port status as Disabled instead of not showing the port at all when disabled?

$ cat /etc/config/poe #snippet
config port
        option enable   '1'
        option id       '23'
        option name     'lan23'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '1'
        option id       '24'
        option name     'lan24'
        option poe_plus '1'
        option priority '2'

$ ubus call poe info #snippet
        },
        "lan23": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Searching"
        },
        "lan24": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Delivering power",
            "consumption": 2.000000
        }

$ cat /etc/config/poe #snippet
config port
        option enable   '1'
        option id       '23'
        option name     'lan23'
        option poe_plus '1'
        option priority '2'

config port
        option enable   '0'
        option id       '24'
        option name     'lan24'
        option poe_plus '1'
        option priority '2'

$ ubus call poe info #snippet
        },
        "lan23": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Searching"
        }
> The disabled PoE port 24 is just missing

Shouldn't it look like this when disabling a PoE port?

$ ubus call poe info #snippet
        },
        "lan23": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Searching"
        },
        "lan24": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Disabled"
        }
mrnuke commented 2 years ago

That was the original design intent. Not very intuitive though.

This should be improved.

mrnuke commented 2 years ago

realtek-poe all versions affected till CI31

BTW, you don't need to test all versions. If it happens with the CI from the main branch (realtek-poe), that's good enough for a new issue.

walterav1984 commented 2 years ago

True, think I formulated that somewhat not usefull since I meant I have noticed this behaviour from the start and till the last release I tested but thats just a selection of CI releases not all.

walterav1984 commented 2 years ago

This seems to be fixed for CI36 when disabling port 23 in a 24port enabled poe config. Doing multiple enabled/disabled tests with a /etc/init.d/poe reload to apply the current /etc/config/poe indeed disables and enables PoE on that port at will and powers on and off the PoE device correctly.

        },
        "lan22": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Searching"
        },
        "lan23": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Disabled"  #<--- PoE device is powered off
        },
        "lan24": {
            "priority": 2,
            "mode": "PoE+",
            "status": "Searching"
        }

However just tried version CI40 and Ci41 in those versions the whole port 23 is missing again from the status info.

        },
        "lan21": {
            "priority": 2,
            "status": "Searching"
        },
        "lan22": {
            "priority": 2,
            "status": "Searching"
        },
        "lan24": {
            "priority": 2,
            "status": "Searching"
        }