
Show HN: TinyPilot – Build a KVM over IP using a Raspberry Pi - mtlynch
https://mtlynch.io/tinypilot/
======
x87678r
This looks awesome. I was looking for a solution like this last year. I
budgeted a few hundred bucks but couldn't find anything. Ideally would have a
way to handle a few different boxes.

I did see something called Intel AMT, part of Intel vPro.
[https://www.howtogeek.com/56538/how-to-remotely-control-
your...](https://www.howtogeek.com/56538/how-to-remotely-control-your-pc-even-
when-it-crashes/) Does anyone have experience with this? (I have AMD box so
doesn't help me) - actually looks like AMD has similar
[https://developer.amd.com/tools-for-dmtf-
dash/](https://developer.amd.com/tools-for-dmtf-dash/)

~~~
Haemm0r
It works, however you need a non-free special client called VNC Viewer Plus
[1]. Afaik it is Windows only. You can enable regular VNC protocol
capabilities for AMT[2], but then you can't use the interesting stuff anymore.

[1]
[https://www.realvnc.com/en/products/viewerplus/](https://www.realvnc.com/en/products/viewerplus/)
[2] [https://blog.michael.kuron-germany.de/2011/10/using-intel-
am...](https://blog.michael.kuron-germany.de/2011/10/using-intel-amts-vnc-
server/)

//edit: link [2] added.

~~~
tyingq
This seems to show a reasonable option from Linux:
[https://www.cyberciti.biz/faq/remotely-access-intel-amt-
kvm-...](https://www.cyberciti.biz/faq/remotely-access-intel-amt-kvm-linux-
desktop/)

~~~
plett
I've used instructions similar to those to get AMT KVM working with a normal
VNC client, it works fine. The only catch is that the AMT seems to intercept
_all_ traffic to port 5900 coming in through the NIC, not just that addressed
to the IP of the AMT. It's only the "legacy" port 5900 VNC which is affected,
the other ports such as 16992 for AMT's web admin are unaffected.

------
cerberusss
Fantastic project. Amazing how you overcame each obstacle, and very well
written to boot. Kudos.

Quite funny how you brought 1000 ms latency down to 200 ms. I wonder how this
compares to iDRAC and that Raritan device.

~~~
EvanAnderson
I've used virtually all of the iDRACs. They're probably in that 200ms area
(based on my gut feeling w/ no empirical measurements). They've been fairly
responsive in my experience.

~~~
Bnshsysjab
Out of curiosity do they bring any functionality that this device does not?

~~~
DrPhish
The most interesting stuff is generally:

-Remotely mounting images (ISO/FS/IMG/etc) on the host for bare-metal installs or any other purpose

-Hard power options for unresponsive servers or emergencies

-Heavily integrated diagnostics (fan RPMs, thermals, RAID status, etc etc) with eg. snmp output

~~~
yencabulator
> -Remotely mounting images (ISO/FS/IMG/etc) on the host for bare-metal
> installs or any other purpose

For what it's worth, that stuff has always been incredibly unreliable for me.
Enough so that old school PXE booting was the only way to maintain a server
pool, couldn't get them to consistently reimage through the proprietary stuff.

The remote power control is very nice, and I didn't see anything on this page
about that. (Though now I'm just imagining the "useless PC" [1] that just
tells a smart power plug to turn itself off.)

[1]
[https://en.wikipedia.org/wiki/Useless_machine](https://en.wikipedia.org/wiki/Useless_machine)

~~~
stjohnswarts
I never had a single issue with it if I mounted it from an onsite drive.
Mounting from home in my den is a bit more iffy and pretty slow. PXE is
definitely better, but the iso method is nice for when that's not an option.

------
dukoid
I have given up on KVMs altogether and I am using the following approach now:

\- Most monitors have multiple digital inputs. Connect each computer to one of
them

\- Use a USB switch keyboard and mouse

\- Before switching the USB switch, press the "lock screen" key combination
and make sure locking the screen drops the video signal

\- After switching the USB switch, pressing shift should bring up the login
dialog and re-activate video output. Since the monitor has just lost the
signal in the previous step, it will scan the inputs and switch to the desired
signal.

~~~
jbob2000
I did this for a while, the problem is that there's really no such thing as a
high-quality USB switch. They are all garbage and mess with USB devices in
some way (at least at the consumer level).

~~~
btgeekboy
I have an old Belkin USB 2.0 switch from god-knows when that works
beautifully. I use it to share a hub with a keyboard and mouse attached. I’ve
given up trying to find a 4K60 x2 DisplayPort KVM that doesn’t suck.

~~~
stamps
I have this one[0] that works great.

Wendell at Level1Techs does good work and there's even newer ones that can do
8k30.

[0] [https://store.level1techs.com/products/kvm-switch-dual-
monit...](https://store.level1techs.com/products/kvm-switch-dual-monitor-
model)

~~~
ajford
I couldn't find the details on their site, but do you know whether the 3.5mm
audio jack is 3 or 4 pole? I've found that most KVMs have the 3 pole jack,
meaning it just supports audio out, but I need 4-pole so my headset microphone
works.

~~~
lathiat
You can get USB audio dongles that have that. Which could then switch on the
KVM instead.

------
vmurthy
If you want to support the author and purchase the whole kit, here it is
[https://tinypilotkvm.com/](https://tinypilotkvm.com/)

(Edit: No affiliation. Just happy to see something like this for hacking :) )

~~~
mtlynch
Thanks for your support!

------
numpad0
That MacroSilicon MS2109 capture is super interesting! $11 shipped for 1080p30
capture is unbeatable. I wonder what kind of host SBC is going to be necessary
to build a clone BlackMagic ATEM Mini without choking up USB bandwidth.

~~~
mmastrac
A USB 2.0 device can use up to 480Mbps and MJPEG is on the order of 10s of
Mbps (estimated), so I don't think you're anywhere near needing to worry about
bandwidth.

Your biggest complication will be real-time re-encoding and compositing with
effects.

~~~
numpad0
I can't believe it until I see it. I've seen USB EHCI choke up from just three
webcams.

------
dannyw
Hey OP, I was reading your linked HomeLab article and you mentioned you'd
rather have gotten a mobo with integrated GPUs next time.

Actually, motherboards do not include integrated graphics, it's all in the
CPU/APU. The mobo you linked would not provide graphics either.

AMD unfortunately does not have a high end APU released to consumers right now
(there are some 4000 series, but only to OEMs I believe). However, for a
HomeLab setup, you might find a cheap GPU to be useful for many things
(including hardware video transcoding).

~~~
PaulKeeble
I have MSI 450 MITX board and a Ryzen 3600 that is doing NAS/homeserver duty
and it refused to POST without a GPU plugged in. Given its MITX and it only
has a single slot needing it for PCI-E is a real pain, I intended to use it
for SATA ports so it hurt my plans quite a bit.

Its motherboard dependent but its definitely something to check with AMD Ryzen
motherboards.

~~~
boring_twenties
Hm, I guess I lucked out then. I bought the cheapest motherboard I could find
(at the time) for my 3600, an ASRock B450M Pro4. It makes a bunch of annoying
beeps, but doesn't stop booting.

~~~
tokenk
Second this. I got an unraid server working headless with an ASRock B450M ITX
board (Fatal1ty) but it's still a real pain having to put in a GPU to boot
into BIOS. Was hoping this could fix that for me :(

~~~
boring_twenties
Yeah, it's a real pain in the ass. I miss the workstations of yesteryear where
you could do everything with just a serial console. Another example of
technology actually getting worse over time.

Even hardware that is made to be run headless ("server-class") is hopelessly
broken. They give you a proprietary graphical console that isn't even just a
VNC server but has to be accessed with a web browser. And, if the server is
more than a few years old, some deprecated, unsupported plugin like Java or
.NET will be required. I have an old Dell R710 whose remote console I will
never be able to access, because it only works with Java 6 (or so I'm told,
I'm certainly never trying that; I wouldn't even know where to begin to try to
set that shit up.)

------
lxe
Oh man, the video latency woes. I've been going through the same motions
trying to get minimal-latency stream-to-browser from an Amcrest (Dahua) IP
camera. Their app and cloud services leaves much to be desired, so I tried to
roll my own. They cameras send h264-encoded stream over rtmp but also through
some kind of custom HTTP protocol which their browser app (requiring a scary
binary native plugin) decodes, but it's challenging to reverse-engineer.

~~~
hasperdi
From experience trying to minimise latency of Raspberry Camera stream, two
biggest factors of latency are H264 encoding (maybe because it's temporal) and
RTMP.

MJPEG and UDP/TCP streaming work better (for me at least).

------
EvanAnderson
This looks great. To be useful in the datacenter environments I work in such a
device would need VGA capture, though. Most servers don't have HDMI ports in
my experience.

Anybody know of a good, cheap V4L2 USB-based VGA capture dongle?

~~~
diabeetusman
Could always add another dongle with something like this:
[https://www.amazon.com/dp/B07BKYBKGP](https://www.amazon.com/dp/B07BKYBKGP)
maybe?

~~~
bserge
Most obvious choice, but the USB port might not be able to provide enough
power. You could splice in an external adapter with a bit of work, though :)

------
bronco21016
Because of COVID my work on the road has come to a screeching halt. I was
always using my iPad with an external keyboard for nearly everything and
became really accustomed to having iMessage always a key command away.

Now I work at home at a desktop with Ubuntu. It's a huge disruption to use
iMessage now as I have to switch devices/keyboards.

I had the thought of doing almost exactly this with the Ligthning-> HDMI
adapter and some form of Bluetooth keyboard emulation. I can't wait to build
one of these and start experimenting.

~~~
rjeli
oh, i wrote software that does this over airplay wifi mirroring and a
bluetooth dongle as a mouse. i gave up because I couldn’t convince my phone to
take a tablet hid profile for seamless mouse capture. it’s messy but I’ll
throw it on github in a bit

~~~
bronco21016
How did you get the AirPlay mirroring working? Is there a library available
for that? If I could just do that and use my keyboard's ability to switch
bluetooth devices that might be sufficient.

~~~
rjeli
[https://github.com/FD-/RPiPlay](https://github.com/FD-/RPiPlay)

------
mtlynch
Author here. Happy to answer any questions or take any feedback about this
post.

~~~
wojciii
Cool project, but what about power management? What happens if the PC being
controlled crashes and does not let you reboot it using keyboard shortcut?

I'm might be damaged by testing and working with embedded development.

~~~
mtlynch
Thanks for reading!

> _Cool project, but what about power management? What happens if the PC being
> controlled crashes and does not let you reboot it using keyboard shortcut?_

Yeah, that's one of the limitations. TinyPilot can't control power for the
target computer.

I don't know of any way to manage power without connecting the Pi to the
target machine's motherboard, but that increases complexity significantly. I'm
using this for a homelab, so it's easy for me to walk over and cycle power if
that ever comes up, but for this to support more remote scenarios, I'd need to
address this.

~~~
voltagex_
Can highly recommend the TP-Link HS100 for this - it's "just" a wifi power
switch. Change your motherboard settings to "power on after power loss" and
you've got your remote reboot.

------
mudkip
This is pretty cool (for managing servers cheaply), but I remain disappointed
that remotely controlling computers over a network with low latency is still a
difficult task. I've been trying to find a way to use a bunch of machines
remotely over my LAN (for gaming / media playback on multiple devices), and
have been somewhat disappointed at the quality / latency of the various
options I've played around with. It's especially disappointing when you have
10gbps networking, and sending uncompressed 1080p60 video over over the
network with a couple ms of latency should be trivial, from a bandwidth
perspective. Obviously this is a different problem than what you're trying to
solve (remote management, so you have to do HDMI + USB stuff in hardware,
adding some latency), but it's still annoying that there aren't great lower
latency software options.

~~~
xiao_haozi
Steam link does it, and fast enough to play games with no noticeable latency.

Not sure what the magic is, though.

~~~
mudkip
I haven't tried Steam Link yet, but I might give it a shot. I was originally
looking for purely remote desktop stuff for a combination of managing
computers and gaming, so I was mostly testing stuff not specifically marketed
to gamers. Ideally I'd also like something that does software<->hardware (at
higher latency obviously), so I can stream older computers or game consoles to
a variety of devices as well.

I did end up trying Parsec, since I saw some people recommending it, and that
was terrible. Latency was fine (~10ms software <-> software) and video quality
was alright, but audio quality was terrible despite being set to the highest
option - which is especially bad, because there's no option to send
uncompressed audio, and whatever "optimization work" they were doing to reduce
bandwidth made their entire product unusable, despite the fact that there's no
need to try saving 1mbps over a wired LAN.

~~~
fock
the cool thing about this solution seems also, that it conveniently alleviates
the "need a screen"-problem of the windows-screencapture-approach.

------
twicetwice
There was another approach to the same problem posted on HN just yesterday[0],
which took a very different route! Very interesting to compare/contrast the
two appraches. That one doesn't do video, just gets you a terminal. (Not sure
if it would let you mess with the BIOS or install a new OS like this one does?
Not familiar enough with serial ports to assess.)

But anyway, TinyPilot is super cool! I'd love to get it set up one day. And
the "life story" as to how it came to be was really neat, and made me feel
like I understood the whole solution. Great article!

[0]
[https://news.ycombinator.com/item?id=23915777](https://news.ycombinator.com/item?id=23915777)

------
ed25519FUUU
Really neat project. Small optimization, you can use the RPI’s gpu accelerated
h264 decoding and free up a lot of CPU:

Change:

    
    
        ffmpeg -vcodec libxh264
    

To:

    
    
        ffmpeg -vcodec h264_mmal

~~~
mtlynch
Thanks, good tip! I ended up not using ffmpeg after I discovered uStreamer,
but this is a good trick to have in my back pocket.

------
Severian
You could also probably add power/reset functionality by hacking something
like this:

[https://www.amazon.com/SilverStone-Technology-Wireless-
Compu...](https://www.amazon.com/SilverStone-Technology-Wireless-Computer-SST-
ES02-USB-USA/dp/B0859PKPKT/)

Or possibly just wiring up a transistor to the power button pin (not sure if
it sources or sinks) between motherboard and the Pi, and just hold it high
until it boots.

~~~
smcleod
Just be careful with that - it doesn't look like it's encrypted, so you could
easily have random people resetting your server or you might even be opening
your neighbours garage door ;)

------
superkuh
The hardest part of this seems to be the V in the KVM and the solution of the
author's is pretty neat. But I think things could still be improved by
dropping his keyboard/mouse setup and just switching to the standard:
barrier/synergy,
[https://github.com/debauchee/barrier](https://github.com/debauchee/barrier)

~~~
mtlynch
Thanks for reading!

I'm not familiar with Barrier, but is my understanding correct that it
requires software running on the target computer? If that's true, it wouldn't
work for things like installing a new OS or managing BIOS because you'd have
to wait for the computer to boot up fully before you're able to enter keyboard
or mouse input.

------
grosswait
I just finished building a Pi KVM about a month ago using project
[https://github.com/pikvm](https://github.com/pikvm). Has been great so far.

~~~
mtlynch
Yeah, I'm really impressed with that project and love Max's work! There's a
bit of a barrier to entry though, as it requires you to compile the OS
yourself. My goal with TinyPilot was to create something that's easier for
newcomers to install and simpler for me to reason about.

~~~
grosswait
Any plans to add power control to tiny pilot?

------
franga2000
This seems to be extremely similar to what I've been working on writing up
(which I'm slightly salty about :D) and it's great to see this stuff finally
getting affordable. My design using the same capture card and a 3D-printed
enclosure set me back just under 25€ shipped, which includes KVM, as well as
USB/IP, CD emulation and power control (not to mention that you can program it
to do basically anything else). I don't even know if anything like it exists
on the market, let alone how much it might cost. Despite how buggy and
horrible this kind of strange Chinese hardware is, it is absolutely incredible
what you can accomplish with it.

~~~
mtlynch
I'd love to see your write-up when it's ready!

I think as more people discover this equipment, we're going to see better and
more inexpensive software in this space, and hopefully all these projects can
benefit from one another.

------
fulafel
A major con of the enterprisey ilom systems (such as the idrac) is their
atrocious security track record. You are basically giving up your "the network
is untrusted, I can survive its compromise" badge if you plug in one of those.

~~~
parliament32
Well those ports should never face the internet anyway. Most servers will have
a dedicated (physical) port you use for IPMI or whatever -- vlan that and only
allow access from your VPN. If you're extra secure you can full on disable the
switchport until you need it.

~~~
fulafel
This fail-open "should" is bad besides for the obvious reasons, also because
it'll be extra ops complexity compared to a secure kvm widget that you don't
have to handle with kid gloves.

(And thirdly because of the sibling comment noted footgun.. or silent foot-
boobytrap more properly)

~~~
parliament32
The problem is BMC has an astounding array of features[1] that are worth the
operational complexity. This isn't just KVM like in OP's post... being able to
remote mount images is a godsend when you're provisioning a server or
diagnosing hardware issues or doing a BIOS update on the other side of the
globe (with your other alternative being shipping a flash drive[2], then
paying $200/hr for DC remote hands to plug it in for you).

[1] [https://www.supermicro.com/en/solutions/management-
software/...](https://www.supermicro.com/en/solutions/management-software/bmc-
resources)

[2] don't even try to talk about PXE booting if you've never tried to get
DHCP+BOOTP to work over a WAN

~~~
mtlynch
The Pi is capable of remote mounting images.[0] I haven't implemented support
for it in TinyPilot yet, but it should be possible.

[0] [http://www.isticktoit.net/?p=1383](http://www.isticktoit.net/?p=1383)

------
znpy
the best thing in this article is the immediate link named "I don’t want your
life story; just tell me how to build it "

~~~
mtlynch
Haha, that was inspired by my experience of searching cooking recipes online.

~~~
erikig
Which begs the question - which cooking recipes start off with a biography of
the author? Now I want to see those!

~~~
mtlynch
Oh, they all kind of do that. "Life story" is an exaggeration, but most recipe
authors provide a lot of fluff backstory to a recipe before sharing the
instructions because Google seems to favor longer content in search results.
Here's a not so egregious example on a blog I follow, but it's ~8 paragraphs
of fluff before they explain the recipe:

[https://www.ketoconnect.net/protein-waffle-
recipe/](https://www.ketoconnect.net/protein-waffle-recipe/)

------
rglover
This is great, Michael :) One question before I buy...

I'd like to use these to do development work like you suggested, too. Is the
Hacker option the build with the best latency/least issues (set it and forget
it)?

~~~
mtlynch
Thanks for reading!

Honestly, the overhead from TinyPilot is so small that it's just a question of
how powerful you want the device for other activities.

Here's a screenshot I took earlier today on a Pi 4 with 2 GB of RAM. TinyPilot
is streaming video over WiFi, and top shows that it's only using ~4% of CPU
and ~2% of RAM:

[https://imgur.com/GadzDOr](https://imgur.com/GadzDOr)

~~~
rglover
Sold. Just picked one up. Thank you for figuring this out and making it easy
to get!

------
pdimitar
I'll use the opportunity to ask for a KVM switch help here if that's not
breaking the board's rules (and I feel it's related to the topic):

I got a company laptop recently and bought an Aten CS782DP KVM switch so I can
reuse my gaming PC's monitor on it (using DisplayPort 1.4 cables). But when
using my gaming PC the display now flickers very often when gaming and it's
driving me crazy. Some people said it's the length of the DP 1.4 cables (they
are very short though, <1m), some even say gas spring chairs introduce signal
disturbance (wtf?), others say make sure the DP 1.4 cables don't touch any
other cables.

In any case: would a KVM switch like the one in the post help? I suspected
NVIDIA's G-Sync but turning it off for several days made no difference. :(

For the record, the display runs at 144Hz in both Win10 and Ubuntu. But it
only flickers in Win10. The only thing that comes to mind is that the miniDP-
to-DP cable that runs from my PC's videocard to the KVM switch is no good --
but not sure. I sadly can't use the KVM switch's DP-to-DP cable because my
videocard only has miniDP on its rear.

Anybody had similar struggles in the past?

~~~
techntoke
Have you tried lowering to 60Hz in Windows to see if it helps? What about
another switch?

~~~
pdimitar
In the very few games I play 60Hz is way too low so I haven't attempted it at
all -- I want the maximum Hz/FPS.

As for another switch, I am open to ideas if you have them. In my local market
I was only able to find like 2-3 of them [that support DP 1.4] and they are
all north of $250 -- which I don't mind but it would be non-pleasant to buy 5+
of them just to experiment.

Maybe my requirement for DP 1.4 is silly though. Maybe HDMI would be fine.

~~~
techntoke
My guess is that switch simply doesn't support 144Hz, so if it works at 60Hz
then you have your answer.

~~~
pdimitar
They advertise 4K@60Hz and my display is at 2560x1080 @ 144Hz. Math says my
case should be supported but yeah, computer standards are often non-intuitive.
I'll try with 120Hz and then 60Hz just to ascertain limits as you suggest.
Thanks.

------
Jaruzel
I have a similar solution in place. For _reasons_ ... I have a machine that is
100% locked down by the client. I cannot install software on it, nor does it
have any sort of remote access tools installed on it. To keep my work space
clear, and negate the need for second monitor (as I need to be able to see the
screen of this machine AND my main machine at the same time), I use an Elgato
CamLink HDMI dongle[1] to capture the video output of the machine, and I use
VLC to display it in a window on my main desktop. I use a bluetooth keyboard
and mouse combo to control it. The latency on the video capture is very low
(it doesn't feel any more laggy than a normal remote sesson), and as an added
bonus I can screen capture the video stream, which is really useful for
documentation. The CamLink is locked at 1080p, so as long as the machines
desktop resolution matches that, I get a very crisp picture. I've been using
this setup for almost two years now, on a daily basis with no issues.

\--

[1] [https://www.elgato.com](https://www.elgato.com)

------
C1sc0cat
Oh nice I will have to look into this as I was considering Using a dual pc set
up for streaming and this would be great for controlling the second pc (mac
mini)

I want to have main pc for running ROLLd20 and a daw - then use a mac mini to
run the processed audio from my DAW into hangouts.

This is so I can properly play in audio and , music cues as well as altering
my voice to suit the character eg a galdos style for a robot

~~~
lukevp
You could probably do this with the loopback features of a podcast style
interface and not need a second computer. The one I use is the MOTU M4, the M2
is a little cheaper.

[https://m.youtube.com/watch?v=IKjKymjc_R8](https://m.youtube.com/watch?v=IKjKymjc_R8)

~~~
C1sc0cat
Yes I have looked at virtual loop back like Voicemeeter and might be able to
do it with the routing aspects of the focusrite software.

It is of course the sort of thing that should be baked into the OS.

------
bserge
This is some great timing, I might need a KVMoIP setup soon and I couldn't
find anything cheap. Very nicely written article, thanks!

~~~
mtlynch
Awesome, glad it was helpful! Thanks for reading.

------
somethingwitty1
Awesome! I could have built this with what I have at home, but I purchased
because this is something worth supporting.

~~~
mtlynch
Thanks for reading and for purchasing!

------
NietTim
Great little project! I had no idea capture cards got that cheap

~~~
mtlynch
Thanks for reading! Yeah, my understanding is that these capture cards are
fairly recent. I think my timing was pretty lucky because a lot of earlier
projects had to do HDMI->S-Video and S-Video->USB[0] to keep costs down
because there weren't any inexpensive HDMI->USB options at the time.

[0] [https://github.com/Fmstrat/diy-ipmi#setting-up-the-
hardware](https://github.com/Fmstrat/diy-ipmi#setting-up-the-hardware)

------
crypt1d
KVMs have been a the bane of my existence over the last 10 years. Almost 99%
of the time they come with some ancient Java dependency that breaks on any
modern OS and is barely usable. Not to mention the nightmare-ish KVM
experience big players like OVH and Hetzner provide.

This is a superior solution to all of them.

~~~
louwrentius
No. Modern IPMI is HTML5 based. Lightyears better than the old java/.net
clients or this (awesome) hobby project.

~~~
crypt1d
Sure, the modern ones are better. But they are also very expensive, and
usually only come with the higher end hardware too.

If you are looking for a reasonably priced server today, you are likely to end
up with the shitty Java-based KVM.

~~~
TheSmiddy
Dell, HP, Lenovo, and Supermicro all have firmware patches for their current
line of servers that replace the java kvm with html5 versions. I assume most
other manufacturers are following suit. It would be exceptionally rare to buy
a brand new server today with a java based remote console.

------
bsharitt
Nice, I had thought about an HDMI capture device but plugged it in, played
with it for about 5 minutes trying to tune out the latency(I'm not exactly and
ffmpeg pro) and didn't make much head way. I was also using either a pi 2 or
3, so that maybe have been part of the problem too. I'm glad someone actually
had the time to see it through and put together a solution. Having one of
these would have been super useful the past few days when I was having kernel
panics due to a failing root disk on my home server, but I had any spare
monitors stored away because I'm in the middle of moving. I'll have to give
this a look once I get all settled in again.

------
wjdp
Not tried anything like this before: looking at TinyPilot and Pi-KVM which one
should I use?

I'm happy doing some soldering. Is there anything that TinyPilot has that Pi-
KVM doesn't?

Has Pi-KVM added support for the HDMI dongle you used?

~~~
mtlynch
Thanks for reading!

I'd say, in short, Pi-KVM is more feature rich, while TinyPilot is simpler and
more approachable with less functionality.

Pi-KVM has several nice features that TinyPilot doesn't yet have, including
power management, mouse support, authentication, TLS, and USB storage
mounting.

TinyPilot has a quicker install. Pi-KVM requires you to compile the OS
locally, which takes about an hour. If you've got a Raspberry Pi OS system
(aka Raspbian) already, you can configure it for TinyPilot with two commands,
and the install takes 5-10 minutes.

One of my goals with TinyPilot was to avoid a requirement for soldering/jumper
cables, but if you don't mind soldering, that might not matter much to you.
Pi-KVM works without soldering as well, but the documentation assumes
soldering/breadboards.

I hope that there's space for both projects, and Max and I have talked about
ways to potentially collaborate.

~~~
wjdp
I do too! Much healthier when multiple projects are tackling a problem from
multiple perspectives. Your write-up has already shown both projects
benefiting. I wouldn't have heard about this space at all without this
article.

I'm looking to build a new home-server and was looking at mobos with
management support. No need for that now though! Now looking for ways to keep
the Pi inside the server case. Ideally want to have a ethernet, power jack and
HDMI end built into a PCI bracket so it remains movable.

Thanks for the detailed reply. I'll likely give both projects a go.

------
cptnapalm
I tried something like this, but instead of a KVM, a remote "terminal" for
multiseat in Linux. usbip worked fine, but I couldn't get video to work for a
damn. The idea was to have the main computer stream video from one seat to the
RP and act as a client for the keyboard and mouse attached to the RP using
usbip. Had I been able to get the video portion to work, then next step would
have been setting the RP to boot to a fullscreen vlc (or what have you) which
displayed the gdm login screen from the main computer.

------
iron2disulfide
This is cool. Any chance this would scale for many machines? I have a ~15
machine lab with no KVM setup right now, and could really use something like
this if it works for a large number of devices.

~~~
jolmg
I'm not really into electronics, but I imagine it wouldn't be that difficult
to control the switch of a cheap KVM-switch with the GPIO pins of the RPi. One
might even control multiple KVM-switches and daisy-chain them.

~~~
iron2disulfide
Haha, I am kind of the opposite: I work on electronics, and am not much of a
sys admin. One of the problems I've run into is that I haven't found a single
switch solution with enough connections. I _could_ build a multi-level
multiplexer with many switches, but that's too much effort. If TinyPilot can
support multiple KVM-over-IP connections, it would be a perfect fit for me.

~~~
jolmg
> If TinyPilot can support multiple KVM-over-IP connections, it would be a
> perfect fit for me.

RPis only have 1 OTG port, though. A device that could get it to handle more
machines with that single port would functionally be a KVM-switch. I don't
think there's a way around that, at least not one that'd be cheaper or more
practical.

~~~
tjoff
Couldn't you just connect a usb-hub?

~~~
jolmg
I don't think there are usb-hubs that can work with the idea of one slave to
multiple masters. Do you know of a USB hub that would work to connect one
keyboard to multiple computers? That'd simply be against USB protocol. KVM
switches are the devices that allow you to connect one slave to multiple
masters by giving you a control of what master the slave should engage with at
any one time.

~~~
tjoff
Yeah, my bad, I thought of another usecase.

------
louwrentius
I respect this effort, I think it's a great accomplishment.

I think most people are better off building their own home (lab) server with a
motherboard that supports IPMI (KVM over IP) natively.

Supermicro (only brand I've experience with) or other brands that build server
motherboards all include IPMI with HTML5 support.

Doing so will save you a lot of trouble. Maybe you may not be able to run the
kind of hardware you want, but it's all a tradeoff. You have to choose.

I have HP Microservers (quiet) and a Proliant (loud) all with ILo (HP IMPI)
and it's awesome.

~~~
voltagex_
So the recent Supermicros have a HTML5 iKVM, but mine originally came with a
Java-only thing. When I had to send my box away to get repaired (Intel C2000
bug) it magically came back with a newer firmware that wasn't listed on their
site and supported HTML5. I haven't been able to get remote ISOs working with
the new interface, though.

~~~
toast0
At my last job, some of the Supermicro servers I worked with needed their SSD
firmware updated. The hosting company's firmware update tool didn't actually
update the SSD firmware (ugh) and it took forever, so I started doing the
updates with remote ISOs, but some of the hosts had gone through the hosting
company's tool which sometimes updated the IPMI firmware even though I didn't
tell it to (double ugh). For those, I ended up loading the ISOs via PXELINUX's
ISO loader. Kind of gross, but it got the job done -- might be an option for
you?

~~~
voltagex_
Yeah, I think PXELINUX and iPXE are using the same kind of tricks to load ISOs
like this (if anyone wants to do a writeup I'd love to read it). I think I'm
going to have to dig in and understand the "redfish" API that also appeared
with the update.

------
ape4
Sorry to ask but what's it cost to buy a KVM over IP device?

~~~
EvanAnderson
You're not going to find a decent one sub $500. Used devices can be had for
less, but most of the older ones I've seen use terrible Java-based clients
that are a major pain to get running on modern browsers. For multi-device KVMs
you usually have to figure in the prices for the individual interface module
dongles that plug into each computer, too.

StarTech makes a USB-to-KVM that looked promising to me, but it's still >$400:
[https://www.startech.com/Server-Management/KVM-
Switches/Port...](https://www.startech.com/Server-Management/KVM-
Switches/Portable-USB-PS-2-KVM-Console-Adapter-for-Notebook-PCs~NOTECONS01)

~~~
ape4
Thanks and that StarTech doesn't have HDMI. Maybe its cloud VMs that are
removing the need for KVM over IP. I still want it.

~~~
AaronFriel
I wouldn't say cloud VMs have removed the need, they've just made infra admins
have to live without it. For the most part it's fine on well supported and
tested OSes but before the container/kubernetes revolution I managed some
personal VMs with esoteric distros in various clouds and so many things have
to go right for that to work. A bad update or install of grub, initrd,
dhclient, a handful of system services and maybe systemd, or sshd and the
machine is effectively dead. You have to attach the disk to another machine to
debug it.

A more extreme example was when I went down the rabbit hole of trying to set
up remotely unlocked full disk encryption on a cloud, just to see what was
possible. This was maybe 4-5 years ago. This involved a pre-boot environment
that would run from memory only, packaged into an initramfs and used dropbear
as an ssh server to accept a connection.

I really, really wish cloud VMs had virtual KVMs. It turns out, it's really
easy to mess this up, and when you do recovery is Non Trivial.

The best I found was that Azure's cloud allows you to connect (read/write!) a
virtual serial port via web interface so you can use the Linux serial console
to recover. That was a game changer for playing with this. If dropbear failed
to come up, I _at least_ got a shell into the pre-boot environment.

~~~
rob-olmos
Google Cloud also provides read/write serial ports over SSH:
[https://cloud.google.com/compute/docs/instances/interacting-...](https://cloud.google.com/compute/docs/instances/interacting-
with-serial-console) \-- but I think AWS still doesn't.

One thing I've ran into was root not having a password since the cloud images
are typically SSH key auth only. That was annoying when trying to fix
something simple like iptables or entering maintenance mode for a disk check.

~~~
AaronFriel
Thank you! I wasn't aware this was possible back then. I'm glad they
implemented this.

------
Neil44
I got a cheap Lantronix Spider KVM from eBay, it works quite well. Mine was an
older VGA model but you can use it with a DP or HDMI to VGA adapter.

~~~
TwoNineFive
I also have a couple of Lantronix Spiders. I use them at remote client sites.

Some of the models have video-passthrough, which is an awesome feature. The
ability to redirect an SMB share or local disk image to an emulated disk over
the network is also a great feature for installing an OS.

I recently had seen some article on CNX about those cheap USB video adapters
and wondered about doing something like this to replace these old Spiders.

There is definitely a market for a low-cost product here. It doesn't have to
be perfect. As the article highlights, the pricing for this kind of product is
just stupid.

------
jbj
I use barrier on my raspberry pi, and have a keyboard shortcut to pick wich
machine receives the keystrokes and mouse movement. Additionally to this
keyboard shortcut, I also need to click a button on my monitor since it can
receive hdmi from multiple machines.

It works great, If I could get it done with only a keyboard shortcut, I would
only pick this solution if it does not induce additional lag.

------
fuzzy2
Very nice. I’ve been looking into the same thing, with a different video
grabbing method though: A HDMI-to-CSI bridge (Auvidea B101/B102). Hopefully,
this could somehow work with a Raspberry Pi Zero W, which is very compact and
also supports USB-OTG. Unlike the Raspberry Pi 4, a single USB port can easily
power it.

Unfortunately, the much more powerful B102 bridge isn’t available. :(

------
michaelyoshika
Great product! Although I also gave up on KVM already, I wouldn't hesitate to
get a disruptor if it's 10x better.

------
captn3m0
Was stuck with latency issues on a unrelated streaming project, thanks for
writing about ustreamer - going to try that out.

------
burnte
Oy! I've been designing a HAT for a year to do this, but it would take VGA
rather than HDMI. You've done well! :D

------
punnerud
Love this! Startet building the same in 2018 with LKV373A and RPi Zero, and
figured out that a better solution (for my need) was to host multiple virtual
machines (11 x Ubuntu) under Windows Pro.

One of the VMs is used for remote connection with SSH and reverse port
forwarding, so i easily can connect, use RDP to Windows ++

------
naggie
Brilliant idea. I have an idea to extend this!

1\. A relay to reset the PC like iDRAC/iLO

2\. 2 dual pole relay to move a USB flash drive to and from the PC it's
connected to, in combination with (1) you could then boot ISOs remotely by dd-
ing the ISO to the flash drive and then connecting it to the host PC with a
relay

~~~
agwa
It should be possible for the Raspberry Pi to emulate a USB flash drive using
the OTG connection, though I'm not sure if it can emulate a keyboard and a
mass storage device at the same time. It would be a very valuable feature for
sure.

~~~
Nexxxeh
Alternatively, just use a microcontroller for the USB HID stuff, and talk to
it via BT/WiFi/40-pin header.

------
altmind
Is there any chance to have remote reset? Getting the control over reset/power
pins over the rpi gpio?

------
ed25519FUUU
I can't tell if the USB port that usually delivers power is the only one that
supports "USB Device Mode" (USB OTG). Can someone confirm? If I could use
_any_ port, then there would be no need for powering the pi with a serial USB
adapter.

~~~
radiowave
From memory, this is correct. It's only the USB-C port that allows OTG
operation. I remember a while back seeing someone selling a special splitter
cable for the rpi4 which provided 2 separate USB connectors, one for powering
the rpi and one for attaching the pi as a gadget to a USB host port. But I
can't remember where I saw it, and haven't been able to turn up a link to it.

------
martinmunk
I've long considered creating a KVM IP thingie for VGA video with a BeagleBone
Black. IIRC the PRUs (200mhz coprocessors) and the on-chip ADC should be fast
enough to sample the video as-is, and have DMA access into main-cpu ram.

------
walrus01
as a side note for things that use the 'uvc' webcam video driver, there's
$20-25 microscopes now that are standard usb webcams. Cheap things with
plastic lenses. If you had a need to set up a fixed mounted microscope taking
30fps imagery of things on a production line (perhaps for a non critical
quality control test?), you could totally do it with a rpi and one of these.

[https://trendowner.com/products/1000x-zoom-usb-microscope-
ca...](https://trendowner.com/products/1000x-zoom-usb-microscope-camera)

------
devwastaken
Are there any projects that can do similar but on a VPS? Used to be a group
video service called rabb.it where you could get a streamed Ubuntu desktop for
groups that you can control through the browser.

~~~
tfolbrecht
Check out Apache Guacamole! "clientless remote desktop gateway" basically
VNC/RDP through a browser

[https://guacamole.apache.org/](https://guacamole.apache.org/)

------
deeblering4
This is a cool project, but I’ve given up on KVMs over IP because they are
laggy and offer you a screen shot of the remote system at best. You can’t
copy/paste or easily log the output of a KVM.

Most modern x86 systems support boot input/output via serial, as does
grub/grub2, the linux kernel and the userspace. It takes some trial and error
to get the serial console set up for all steps in the boot sequence, but once
that’s done you’ve got out of band access in a standard terminal with output
history, copy, paste, etc.

Pair this with a switched PDU or “smart” outlet and you’ve got a full remote
managed server on a shoestring budget. Any adjacent or spare computer with a
usb port can host a $5 usb serial adapter and play the role of the console
server.

------
yetanta
Using a timer on a screen to SEE latency. Why did I not think of that?!

~~~
mtlynch
Thanks for reading!

I got the idea from danman, but his setup is much cooler than mine:

[https://blog.danman.eu/new-version-of-lenkeng-hdmi-over-
ip-e...](https://blog.danman.eu/new-version-of-lenkeng-hdmi-over-ip-extender-
lkv373a/)

------
cryptonector
Wow, this is fantastic. I think you can cut more latency by getting rid of
nginx from the video path. That requires more functionality in ustreamer
(e.g., authentication, TLS).

------
RealStickman_
Funnily enough I'm waiting for my hdmi to usb capture card to arrive so I can
play on my PS3 while also having the option of switching back to the desktop
instantly.

~~~
swiley
That has to add a lot of latency.

Although honestly I think some of the latency complaints by gamers are a
little much. Personally I have a Bluetooth mouse/keyboard connected to my
desktop with a super duper cheap projector pointed into the living room and
can play FPS games on it just fine.

~~~
ctas
It has a lot of latency indeed. I tried the raspberry as a Steam Link
alternative, but as far as I know the ethernet port is not suitable (?). I've
also read that it actually gets worse if you plug in any USB peripherals.
Correct me if I'm wrong though.

~~~
swiley
Yes the Ethernet port is on USB so you’re sharing (the already small)
bandwidth between that and all the peripherals.

This may have changed with the pi4 though.

------
fowl2
Interesting! I wonder if it'd be possible to skip the capture card and have
the pi act as a USB graphics adaptor.

Most firmware environments probably don't support them I guess.

~~~
yencabulator
I fear that's gonna end up as one of those "we transport HDMI over an USB-C
cable without making it actually be USB" things that require hardware support.

(And the "USB monitor" projects meant to be a second display need drivers,
seem to all be way too proprietary, and won't work for early boot.)

------
cmer
This is a game-changer! Thanks for all your work on this.

Do you have any plans to allow controlling more than 1 computer remotely? I'd
love to implement this in my homelab.

~~~
mtlynch
> _This is a game-changer! Thanks for all your work on this._

Thanks for reading!

> _Do you have any plans to allow controlling more than 1 computer remotely? I
> 'd love to implement this in my homelab._

Right now, I can't think of a way to do this. The Pi only has one USB OTG
port, so I don't know of a way to share that among multiple machines.

A friend suggested an interesting solution of chaining TinyPilot together with
a "dumb" multi-machine KVM that supports switching via hotkey. So it would go:

TinyPilot -> legacy KVM -> server1, server 2, ...

You could still use a web interface and hop between servers using keyboard
shortcuts that the legacy KVM understands.

~~~
cmer
That's a really great and simple idea, actually. I might give this a try.

------
nanomonkey
KVM = Keyboard, Video and Mouse

For those, like me, who were ignorant of this particular use of KVM, and
couldn't find it in the article or comments.

------
Chris2048
also featured here: [https://hackaday.com/2020/07/24/tinypilot-provides-kvm-
over-...](https://hackaday.com/2020/07/24/tinypilot-provides-kvm-over-ip-with-
low-cost-and-even-lower-latency/)

------
Naac
This is a great writeup.

I wonder if this can be extended to connect multiple servers to a single Pi.

------
annoyingnoob
A cool solution to a common problem.

------
tmikaeld
Raspberry 3B is too slow for this?

~~~
Nexxxeh
More likely the lack of OTG being an issue, as elsewhere in the comments the
author showed the CPU usage of the Pi 4. It's not even making a dent. It's
super low overhead. I'd be surprised if it maxed out a 3B.

------
neocodesoftware
dell 2162ds are $60 each used on ebay for 16 ports not including pods

------
babuloseo
great blog post! will try to watch the video at some point.

------
gyrgtyn
RaspberryIPMI

------
atum47
fantastic tutorial

------
systemBuilder
This guy has apparently never heard of lynx browser. He wasted $40 and a lot
of time because of that!

~~~
detaro
How does lynx browser help you adjust the BIOS or fix the boot process of a
remote machine?

------
vidanay
I'm all in favor of cool projects, and I have done my fair share of useless
experiments. But wouldn't it just be simpler to attach a dumpster-sourced
monitor and keyboard to the server in question for the 3-4 times a year you
brick it? To me the idea of a locally placed 1:1 KVM "switch" (huh? it's not
switching anything if it's 1:1) is crazy. It makes sense if it is remotely
located, but not if it's within your own home.

~~~
detaro
not sure why you talk about "switch"? The word never appears in the article?

And at such a no-brainer price (especially if you already have a Pi), kind of
worth it just to avoid the hassle of moving a screen around.

~~~
vidanay
[https://mtlynch.io/tinypilot/raritan-
kvm.png](https://mtlynch.io/tinypilot/raritan-kvm.png)

~~~
mtlynch
I think the confusion is that the original comment was worded as if _I_ called
TinyPilot a switch, but I think you're actually saying you think it's strange
that Raritan calls _their_ device a switch, despite the fact that it's only
1-port.

