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
[feature] spe_switch: Add spe_switch power feature #1274
base: master
Are you sure you want to change the base?
[feature] spe_switch: Add spe_switch power feature #1274
Conversation
added single-pair-ethernet power support over telnet changed name as requested in #4 (comment) set default for username and password added .vscode to .gitignore Signed-off-by: Raffael Krakau <r.krakau90@gmail.com>
Signed-off-by: Raffael Krakau <r.krakau90@gmail.com>
reworked telnet-handling moved login to function Signed-off-by: Raffael Krakau <r.krakau90@gmail.com>
Signed-off-by: Raffael Krakau <r.krakau90@gmail.com>
6a014d0
to
a7e525e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good to me.
CI test errors are not your fault, #1277 fixes them.
FYI: there is also https://github.com/pdudaemon/pdudaemon, a project that focuses only on PDUs. labgrid's PDUDaemonDriver interfaces with it. So it might be worth a thought to implement this rather over there. Let us know how you think about this.
Note: we should wait for #1277 and rebase this to make CI run this before merging.
``phoenix_fl_switch`` | ||
Controls a single-pair-ethernet powerswitch via telnet. | ||
Tested on a FL SWITCH 2303-8SP1 with FW-version 3.27.01 BETA | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about the backend name. The complete name of your device is "Phoenix Contact FL SWITCH 2303-8SP1". Could you find out which products use the same "telnet API"? Maybe have look at the firmware? Maybe something like "phoenixcontact_fl_2300"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also squashfs the existing commits into one with a title following our usual conventions, like "driver/power: add backend for Phoenix Contact FL 2303-8SP1 SPE switch".
Adding support for the telnet scheme in labgrid/driver/powerdriver.py should be a separate commit.
Otherwise it looks good.
username = "admin" | ||
password = "private" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hardcoding the credentials, you could use a URL like telnet://admin:private@1.2.3.4/
as the host. You'd need to add telnet
as a scheme in https://github.com/labgrid-project/labgrid/blob/master/labgrid/driver/powerdriver.py#L194
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would indeed be nice.
I used netio_kshell.py as inspiration for the phoenix_fl_switch.py .
Implementing a new scheme would be some effort.
If you want me to put this suggestion on our todo this will be noted ?
__login_telnet(tn) | ||
|
||
# set value | ||
tn.send(bytes(f'pse port {index} power {action}\r\n', 'utf-8')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tn.send(bytes(f'pse port {index} power {action}\r\n', 'utf-8')) | |
tn.send(f'pse port {index} power {action}\r\n'.encode()) |
Below as well.
Since I will be no longer collaborating with JUMO and therefore have no setup to test changes, I close this PR. |
Reopened as requested by @JUMO-GmbH-Co-KG. |
This PR adds the feature to set power for a phoenix_fl_switch over telnet.
Devices connected with single-pair-ethernet can now be set to power off/on/cycle.
To verify, this Driver was tested on a FL SWITCH 2303-8SP1 with FW-version 3.27.01 BETA.
Even if it's a BETA, we got the information that the power control won't experience breaking changes.
Checklist