Project

General

Profile

Actions

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 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
New test
Target version:
-
Start date:
2019-12-05
Due date:
% Done:

0%

Estimated time:
Difficulty:

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
Actions #1

Updated by ldevulder over 4 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.

Actions #2

Updated by ggardet_arm over 4 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:

  1. existing power supply which could be remotely controlled by USB, Ethernet, you name it.
  2. 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

Actions #3

Updated by ldevulder over 4 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:

  1. existing power supply which could be remotely controlled by USB, Ethernet, you name it.
  2. 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.

Actions #4

Updated by ggardet_arm over 4 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.

Actions #5

Updated by ggardet_arm over 4 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.

Actions #6

Updated by ggardet_arm over 4 years ago

  • Status changed from New to In Progress
Actions #7

Updated by mgriessmeier over 4 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
Actions #8

Updated by okurz about 4 years ago

  • Category set to New test
Actions #9

Updated by ggardet_arm about 4 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.

Actions #10

Updated by ggardet_arm about 4 years ago

I also used a TP-Link HS100, connected on local WiFi, and controlled from command line with python3-kasa.

Actions

Also available in: Atom PDF