action #60707
closedcoordination #60518: [functional][u][rpi][epic] Add support for real systems without IPMI or KVM-IP in openQA/os-autoinst
[functional][rpi] Add a way to remotely POWERON/POWEROFF RPi board
0%
Description
To be able to test real arm board (Raspberry Pi 3/4 would be the first targets) we need to be able to remotely POWERON/POWEROFF these boards.
There is multiple options:
- using "generalhw" backend with GENERAL_HW_POWERON_CMD and GENERAL_HW_POWEROFF_CMD
- creating a new backend
Updated by ldevulder over 5 years ago
Code for new backend: https://github.com/ldevulder/os-autoinst/commit/7ce834c70492c75e8591c2860b65dea0efdc3bc1.
It uses the same principle as the IPMI backend.
The same GPIO logic can be applied in a script for "generalhw" backend, as well as the console connection with picocom (for the serial/graphical redirection, mainly useful for the boot process). "Standard" connection should be done by SSH.
Updated by ggardet_arm over 5 years ago
ldevulder wrote:
Code for new backend: https://github.com/ldevulder/os-autoinst/commit/7ce834c70492c75e8591c2860b65dea0efdc3bc1.
It uses the same principle as the IPMI backend.The same GPIO logic can be applied in a script for "generalhw" backend, as well as the console connection with picocom (for the serial/graphical redirection, mainly useful for the boot process). "Standard" connection should be done by SSH.
I think we should reuse existing backend as much as possible. See parent task.
Anyway, we also need to define some hardware first. Could be:
- existing power supply which could be remotely controlled by USB, Ethernet, you name it.
- custom control (GPIO?) controlling a relay, such as https://www.amazon.com/DAOKI-Arduino-Indicator-Channel-Official/dp/B00XT0OSUQ/ref=sr_1_5?keywords=ELEGOO+relay&qid=1575536135&sr=8-5
which default to power off.
Solution 1 is great if it exists at all.
Solution 2 will require some hardware work to do it properly
Updated by ldevulder over 5 years ago
ggardet_arm wrote:
I think we should reuse existing backend as much as possible. See parent task.
Agree.
Anyway, we also need to define some hardware first. Could be:
- existing power supply which could be remotely controlled by USB, Ethernet, you name it.
- custom control (GPIO?) controlling a relay, such as https://www.amazon.com/DAOKI-Arduino-Indicator-Channel-Official/dp/B00XT0OSUQ/ref=sr_1_5?keywords=ELEGOO+relay&qid=1575536135&sr=8-5
which default to power off.Solution 1 is great if it exists at all.
Solution 2 will require some hardware work to do it properly
I used Solution 2 for my tests, it works well but needs some code and not so "professional" (but it's the cheapest version :D). Definitely Solution 1 would be better for o3.
Updated by ggardet_arm over 5 years ago
I have a Tenma 72-2535 which can be controlled by USB (/dev/ttyACMx
port) with a simple python lib: https://github.com/kxtells/tenma-serial
I used it successfully with:
Power OFF script:
#!/bin/sh
echo "Powering OFF"
tool_path=/tmp/tenma-serial/tenma
device=/dev/ttyACM0
pushd $tool_path/
python tenmaControl.py --off $device
popd
Power ON script:
#!/bin/sh
echo "Powering ON"
tool_path=/tmp/tenma-serial/tenma
device=/dev/ttyACM0
pushd $tool_path/
python tenmaControl.py -c 3100 -v 5000 --verbose $device # Set to 5V and max 3.1A
python tenmaControl.py --on $device
popd
But you still need to connect wires from Power Supply to GPIO header (2x 5V, 2x Ground), or build a custom micro-USB (or USB-C for RPi4) cable to connect to the standard power supply connector.
Not sure if such a power supply would fit in o3 room, though.
Updated by ggardet_arm over 5 years ago
We could also use a smart power strip, such as: https://www.netio-products.com/en/device/netio-4
and just use regular PSU for the SUT.
Updated by mgriessmeier over 5 years ago
- Subject changed from Add a way to remotely POWERON/POWEROFF RPi board to [functional][rpi] Add a way to remotely POWERON/POWEROFF RPi board
- Assignee set to ggardet_arm
Updated by ggardet_arm over 5 years ago
- Status changed from In Progress to Resolved
We could also use a USB/Relay such as https://electropeak.com/usb-relay-control-module
We now have a number of available solutions, so set it as resolved.
Updated by ggardet_arm about 5 years ago
I also used a TP-Link HS100, connected on local WiFi, and controlled from command line with python3-kasa.