Following up on my efforts for a remote PC console, I gave PiKVM a try. Very impressive! A great first experience: once you find your way to the right docs it is great. This remote console option is a winner and I’m going to stick with it.
Skip down to the section about software if you’re curious what it’s like to use the thing. I spent a lot of time hacking up some hardware to run it so first notes on that.
Hardware
PiKVM runs an Raspberry Pis. The simple thing is to buy an assembled device from them. You get a CM4, video capture device, an ATX power controller, a power supply, and other stuff all in a nice case. I think the V4 Mini at about $300 is what I’d need. It’s not a bad price for the convenience. OTOH at that price you have a choice of other IP KVMs. I’m not sure if PiKVM is the best choice.
Update: I bought the PiKVM Mini v4. It’s a very nicely prepared product, well built and nicely packaged with plenty of cables. The Mini isn’t just cheaper than the Plus, it’s smaller too. Not a huge thing but I appreciated it. I should have just bought this to start, could have saved myself a fair amount of time.
I’m stubborn and wanted to build my own. They have a very nice guide on doing that, including what hardware to buy. I took their recommendations. $50-$100 depending on what parts you may have lying around already.
- Raspberry Pi Zero 2 W. A tiny $15 computer, these things are very versatile. I had one lying around.
- A HDMI-CSI bridge. A $30 HDMI capture device. It takes HDMI as the input. The output is an RPi Camera device (Camera Serial Interface).
- A CSI ribbon cable. $9 for a set of cables, you only need one. This adapts the wider CSI output to a narrower CSI input on the RPi Zero.
- A quality USB power supply for the RPi.
- An ordinary Micro USB to USB A cable (maybe with some tape, see below)
- Optional: an ATX power interface. This seemed complicated to build, I haven’t looked at it.
The drawback with the RPi Zero is both USB ports are busy doing things and it’s not really practical to have an ethernet adapter. I’m OK just using on-board WiFi but obviously that’s not ideal.
Also this camera interface is pretty hacky. They say it’s capable of 1080p@50 maximum, the product page says 1080p@30. Either way it can’t do the bog-standard 1080p@60 that everything expects these days and that could cause a problem. My Linux PC is happily putting out 720p for it and that works fine.
Physical challenges
The ribbon cable is very fiddly to install. this is not a normal consumer connector. I found this video helpful. Basically you have to unsnap something in the connector, stick in the cable, then snap it in again.
It’d be nice to have a case. The parts are all exposed circuit boards and a delicate ribbon cable. And the HDMI and USB cables are heavier than the computer, which ends up putting a lot of strain on that delicate ribbon cable connector.
No one seems to have a case that fits both boards at once but this 3d printed kludge looks plausible. There’s lots of pre-fab cases for the RPi Zero by itself, that might help.
A note on power
The RPI Zero 2 W has pretty squirrely power. The board has one USB 2.0 port just for power and one just for data. But the power lines of both USB ports are hardwired together. This means if you provide power to the power port you may be dumping that power down the data port into the PC you’re plugged in to. Not good! Alternately, if you only plug the data port into the PC then the RPi will more or less manage to power itself off the data port, which isn’t reliable.
For the problem of backfeeding power to the PC, the PiKVM docs suggest taping off the power leads on your USB cable plugged in to your PC. That’s probably a good idea but I haven’t bothered and so far haven’t fried anything. Here’s hoping my PC’s motherboard is robust. OTOH I ordered this USB power blocker: $6.50 for peace of mind.
What about powering the PiKVM just off the data port connected to the PC? It sorta works! In a previous experiment I measured the RPi Zero 2 W using 165 mA when idle at 570 mA at max load. The USB spec promises 500 mA of power from the USB port so it’s almost enough, and in practice probably is enough if you’re not at max load. PiKVM does work and is usable with just data port power. But then it failed on me once and I have no idea why, was it a brownout? Also it makes the PiKVM dependent on the PC’s power and USB ports which is probably not a great thing in a debugging tool. Independent power seems like a good idea.
One last power note: RPis have a WiFi power saving mode that can cause problems for long-running servers like PiKVM. It’s easy to turn off. PiKVM doesn’t by default. (They wisely don’t recommend using WiFi at all.)
Software: Installation and use
The docs are pretty great and easy to follow. Basically you flash an SD card with their OS. Then edit a text file in a FAT32 partition for initial setup options (like wifi password). Then boot and it’s all pretty automatic. From there it’s all a pretty standard Linux experience. Arch, btw.
But I’ll say this, the PiKVM web interface is great. It was very easy to get it up and going and see my PC’s screen and type at the PC. Super easy to do the basic thing. And the screen sharing UI has nice options like shortcuts for sending weird keystrokes (Ctrl-Alt-Del or Alt-PrScr-T).
One weird thing: the PiKVM filesystem is mounted readonly by default. You have to explicitly issue an rw command to switch to read-write, then ro to go back. In practice you almost never need to do this manually, maybe when you’re changing the root password or something.
I’ve noticed the video feed flakes out when the PiKVM system is busy installing upgrades or fetching system logs. (Even when it has a separate power supply). It may be the RPi Zero CPU is just not powerful enough to keep up. Shouldn’t matter in normal use.
Advanced capabilities
There’s lots of cool hacker extras beyond the basic IP KVM. Some things it can do:
- Tailscale
- Cellular backup network connection
- Fancy HDMI and video options. They seem to care about providing a good video feed, not just an adequate one.
- OCR for the video feed so you can get text of what’s on the screen.
- Audio and microphone
- ATX power control so you can reset or power off/on your PC
- Serial and Ethernet over the USB link to the PC
- GPIO access on the RPi for special-purpose hacking
- VNC server
- An HTTP API
- Extra hardware for a KVM switch for four devices
It’s a remarkably impressive product.
I noticed my Linux box sees a bunch of USB devices when I plug in the PiKVM: keyboard, mouse, CDROM. And I guess ethernet and serial are also possible if I enabled them.