Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore function is incorrect #12

Open
rothcar opened this issue Nov 16, 2021 · 2 comments
Open

Restore function is incorrect #12

rothcar opened this issue Nov 16, 2021 · 2 comments

Comments

@rothcar
Copy link
Contributor

rothcar commented Nov 16, 2021

The restore function performs several actions:

  1. resets the PoE chip
  2. (supposedly) re-initializes the PoE chip according to the driver init defaults

What this command should do is

  1. (optionally) reset the PoE chip
  2. apply driver init defaults.
  3. load a persistent config of my choice

When I run the restore command, it immediately complains that it cannot load the persistent config. This implies that persistent config is either not applied, or not applied consistently.
Given that poed automatically overwrites the persistent config at regular intervals, this effectively means that "restore" leaves the PoE system in an unknown/inconsistent state

@leonchiang
Copy link
Contributor

leonchiang commented Nov 29, 2021

Same issues: #13 #14
Relates issue: #10

We will implement poecli cfg sub command for manipulate by manually the config file.
EX:

  • Load persistent config(P1-enable):
    poecli cfg --load
    poecli show -p 1
    1 Port On (0x01) enable low IEEE802.3AF/AT 4 400 (mW) 30000 (mW) 54.2 (V) 9 (mA)

  • Save runtime to persistent config(P1-disabled by poecli set, must delay 4~5s because runtime dump will not active imminently ):
    poecli set -p 1 -e 0
    poecli cfg --save

cat  /etc/poe_agent/poe_perm_cfg.json 
.....
   "PORTS_CONFIGURATIONS": [
        {
            "port_id": 1,
            "enDis": "enable",
            "priority": "low",
            "power_limit": 30000
        },
.....
  • Restore factory(Then apply last good config):
  1. poecli restore_poe_system
    (Runtime config become platform state after initialize done, all port disabled in runtime state)
  2. poecli cfg --load
    (Will load current persistent config to chip, Port 1 will be enabled)
  • Load an test config:
    poecli cfg --load --config /root/test_config.json

  • Save runtime config [ /run/poe_runtime_cfg.json ] to some place:
    poecli cfg --save --config /root/good_config.json

@leonchiang
Copy link
Contributor

leonchiang commented Dec 2, 2021

Please check devel-0001 branch tag:
https://github.com/leonchiang/poed/releases/tag/issue_fix_0001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants