Remote management and power control using a Raspberry Pi

Preface: This article was originally written in Summer 2021 and was never published. I was originally going to call this article Moving to ARM part 1.5, I was writing it in conjunction with the main articles, but the following setup isn’t necessarily dependent on ARM. More articles on the ARM migration coming in the near future.

I’ve seen some articles recently about the Pi-KVM project, and wanted to use something similar with the mcbin boards I’m using to build the ARM server rack I’m building.

Unfortunately two things the mcbin doesn’t have, is a display port or a power button. When power gets applied to the board, the system boots up similar to a Raspberry Pi. The firmware also doesn’t currently support shutting the board off when you shut down the OS either.

That doesn’t mean we can’t come up with something that works though. The mcbin does support a serial console over USB, and the Raspberry Pi supports GPIO. The mcbin is powered solely off 12V, however SSDs need only 5V, so I should be able to power the entire rack off a PC power supply.

A crude drawing of the power distribution layout.
Not shown: the other 7 system boards, SATA cables, serial cables, network switch and cables, the UPS, and the USB hub.

The Pi only uses 15W, so the power supply’s standby pin should be able to power the Pi even with the output power switched off. One nice feature of the serial on the mcbin, is that the console will run as long as the USB cable is connected, regardless of whether the system is switched on.

I went online and was able to buy an ATX power breakout board, two 8 port GPIO relay boards, and an 8 port USB hub off Amazon.

Everything showed up pretty quickly as usual, however upon inspection, it appears the GPIO boards have undersized mounting holes. Something to keep an eye on if you decide to build something like this for yourself.

While I was waiting for Amazon to ship the relay boards, I whipped up some test code in Python to be able to toggle all 8 relays.

Screenshot of the Relay Control System python app

With the Pi all set up and the GPIO boards wired together and connected to power, I should be able to boot up each system individually, and connect to each console all from a single machine. The Pi has 4 USB ports, and with one of them taken up by the hub, I should also be able to connect the network switch and UPS to the Pi, leaving one port left for a combo keyboard/mouse to control the Pi with.