action #60707
closed
coordination #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
Added by ldevulder over 5 years ago.
Updated about 5 years ago.
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
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.
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.
- Status changed from New to In Progress
- 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
- Status changed from In Progress to Resolved
Also available in: Atom
PDF