Introduction
Based on the PiKVM project, this is a 1U rack mount PiVKM IP based KVM. Using a Raspberry PI 4 and a 4-channel HDMI switcher with USB for switching inputs, as well as full relay based ATX control.
The HDMI switch I used included a 4-channel remote for selecting specific inputs 1 through 4. I used this to switch inputs from the PiKVM Web UI. The ATX relays can also be controlled from the Web UI.
The enclosure I used was from a stripped-down Sophos firewall which included a fan but any 1U enclosure with good room will work. I will admit the fabrication on the front and rear panels could have been better if I had a laser cutter.
Gallery
Images are displayed at full resolution
Configuration
This defines the configuration used for the override.yaml for PiKVM. Below defines the pins used for the specific outputs for ATX and input switching. Add this to the /etc/kvmd/override.yaml
kvmd:
atx:
type: disabled
msd:
type: disabled
gpio:
scheme:
button1: #red
pin: 26
mode: output
switch: false
inverted: true
button2: #blue
pin: 13
mode: output
switch: false
inverted: true
button3: #green
pin: 21
mode: output
switch: false
inverted: true
button4: #yellow
pin: 27
mode: output
switch: false
inverted: true
button5:
pin: 19
mode: output
switch: false
inverted: true
button6:
pin: 20
mode: output
switch: false
inverted: true
button7:
pin: 12
mode: output
switch: false
inverted: true
button8:
pin: 22
mode: output
switch: false
inverted: true
button9:
pin: 4
mode: output
switch: false
inverted: true
view:
header:
title: Input Select
table:
- ["#Inputs"]
- []
- ["#Input Toggle:", button9]
- ["#Input 1:", button1]
- ["#Input 2:", button2]
- ["#Input 3:", button3]
- ["#Input 4:", button4]
- ["#Remote Reboot"]
- []
- ["#Reboot 1:", button5]
- ["#Reboot 2:", button6]
- ["#Reboot 3:", button7]
- ["#Reboot 4:", button8]
Wiring
Below are some network diagrams of the different aspects of wiring.
Troubleshooting
USB WiringWhen wiring the USB between the PI and the HDMI switch, it is important NOT to wire the positive (red) 5v supply. This will cause a back feed from the hub and power provide power from the PCs USB inputs. This is bad for 2 main reasons,
See the wiring diagrams for USB wiring examples. |
Relay WiringEnsure the relays are NOT energized when the system is running. If the relays are energized when the PI is running, they will drop when PiKVM rebooted, and this will drop power to all devices wired into to the relay outputs. In the config, you will notice that all outputs are inverted. If your relays are energized when the PI is running, try invert them or remove the invert. |
Setting a static IPEdit the /etc/systemd/network/eth0.network and set your static IP details. [Match]Name=eth0 |



