1U Rackmount PiKVM Multi IP KVM

December 28, 2024
1476
Views

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.

Parts List
Raspberry PI 4B (cant be 5)
HDMI Panel Mount adapters
USB-C Panel Mount adapters
RJ45 Panel Mount adapter
USB Video Capture Device
4 Channel HDMI Switcher with USB and remote
Tobsun 12V to 5V Regulator
4 Channel relay board for ATX
HDMI cable 0.5m
Raspberry PI Termina HAT (optional)
Additional relay for input switching
90degree Type-C to A USB cable 0.5m

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 Wiring

When 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,

  1. The PI will register a low power warning even if supplied with sufficient 12v feed.
  2. It makes rebooting the PI virtually impossible. I have mine setup for the ability to reboot remotely, but if powered from the PC, simply dropping the 12v supply will not reboot the PI, as it will remain powered from the USB port.

See the wiring diagrams for USB wiring examples.

Relay Wiring

Ensure 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 IP

Edit the /etc/systemd/network/eth0.network and set your static IP details.

[Match]Name=eth0

[Network]Address=192.168.1.100/24
Gateway=192.168.1.1
DNS=<your 192.168.1.1
DNS=8.8.8.8

Leave a Reply