Go Down

Topic: KVM to Ethernet with arduino.. is it possible? (Read 10285 times) previous topic - next topic


I had this project on my mind for quite awhile to make sort of a remote KVM switch, so that I could see and access BIOS and other stuff on my servers remotely without having to lag around my monitor and such.
I have already seen some solutions that do that, but they are usually commercial and very expensive.
I haven't used Arduino or such yet, but I coded in C and PHP for some years now, and I'm pretty new to electronics in general as well.

As far as I understand I can use Arduino with Ethernet shield for my project, please correct me if I'm wrong. My biggest problem as I see it is to convert signal from VGA port... as far as I understand VGA has 3 8-bit colors and h-sync with v-sync and I would think that I could use ADCs on Arduino, but in Reference it says that to convert analog to digital takes about 100us, but as far as I understand for 640x480@60hz would require 31.5kHz (which is about every 33us there's another pixel) so I would imagine it would skip pixels left and right and it wouldn't work or maybe there's a work around? I was also wondering if I would do it in assembly code would it read it faster and work? Or maybe I should use something even more powerful or some dedicated chip to do all that?

I'm a bit confused, and I realize that this project on the same level as my knowledge, but I would still want to try.
I hope there's someone that has done something similar or could help me out...



You would not need to process the video, just switch it - so the Arduino should be fast enough.
But KVM switches are not very expensive, you could probably buy a four way switch for much less than the cost of an Arduino plus all the components you would need.


kvm switches are cheap... but what I'm talking about it something like this
http://www.epiphan.com/products/other-applications/kvm2ethernet/ it costs $1600 too...
so pretty much anything would be cheaper than using it.
I hope this clears up what i meant...


Jan 12, 2009, 05:58 am Last Edit: Jan 12, 2009, 06:00 am by mem Reason: 1
The Arduino is not a good choice for providing a hardware solution for what you want to do.

Have you considered a software solution for remote monitoring? I use VNC http://www.realvnc.com/products/download.html


Yes.. I used VNC, and all it's clones for many years now. Problem arises when I need to fix something on lower level than OS, or if OS doesn't boot..etc. This would allow me to do practically anything without me having to go to my attic every time I need to press reset button or if I'm playing with kernels and it won't boot..


Jan 12, 2009, 08:20 am Last Edit: Jan 12, 2009, 08:20 am by scootabug Reason: 1
I'm interested in figuring this out too.  How many remote systems do you want to be able to switch to and control?

The hard part no doubt would be switching the RGB/DVI video signal.  Do you actually want to see the video signal over TCP/IP or are you happy to have something hardwired over ethernet perhaps?  Cos the first thing I can think of is having a pair of Video > Cat5 adapters (not sure how many pairs of Cat5 they use...hopefully only 6 of 8 wires so you can use the other 2 wires for serial between the Arduino).

So with that, you can see the video on a remote screen over Cat5.  Then all you've gotta do is get keyboard and mouse (is PS2 good?  cos USB would be a challenge I think) commands between 2 Arduino's over serial.  Boo ya!

Receiving mouse data from PS2 looks to be sorted: http://www.arduino.cc/playground/ComponentLib/Ps2mouse
Keyboard...needs more research!

I wonder though, if you can just resample the signals received and then replicate them on the other end.  Sounds messy straight off the bat.


Well... I would think that there would be interference (especially since the cable would be 50ft long or so) which wouldn't look pretty, and I would need to plug it into monitor every time.. and yes I would want it all to go over TCP/IP.
For keyboard this should work http://www.arduino.cc/playground/Main/PS2Keyboard I think...
For right now I would just control 1 computer.
I could write a client for it in C I would think too... All I need to figure out is how to sort of buffer a single frame (take a screenshot in a way) and the rest shouldn't be hard.


A junky IP KVM can be had for about $300 - $400 however when it comes to IP KVM switches you usually get what you pay for

The nice expensive models ( $2,000 - $6,000 ) are usually 10 times better than the cheap ones

You would need to emulate a PS2 or USB keyboard and mouse and for a proper implementation you would also need to capture frames from the VGA, encode, compress and encrypt them in real time and send them out the ethernet interface

Unfortunately, while the arduino could emulate the keyboard and mouse I don't believe it could handle the VGA signal

Some server motherboards support IPMI and allow you to redirect the console over serial in the BIOS

That may be a better solution



Now if you just want to wire the video through ethernet CABLE -- a different thing -- there are some decent instructables out there, and you can route a video signal a good long way through cat-5 (and I'm sure the keyboard signal can go a similar route).  This has NOTHING TO DO with IP!  It is just running video/keyboard signals over a different wire; I've done this myself (no switch, just a really long video cable).

The reason I mention this is that I want to make sure we understand--do you really need it to go over a switched IP network, or will you have point-to-point cables?  If it's the latter, it really is just a switch and you will be better off making a mechanical circuit and adaptors, not an Arduino project.  If it is some scheme where you are converting a hardware video signal into switchable packets that can be routed through an IP network and converted to a video signal on the opposite end, you are asking for something fairly cosmic, ie not an insignificant piece of kit (and again, probably not an Arduino project; converting a video signal in real-time to some data that can be passed over ethernet is probably going to swamp your wee chip).


The Arduino isn't capable of implementing KVM over IP on its own; there's simply too much signal to handle.



As kg4wsv said the arduino isn't powerful enough to handle the signal

This is the reason the really nice multi-port IP KVM switches cost so much ( $2,000 - $6,000 ) - granted a lot of that is profit and R&D

They usually have a powerful PPC CPU, lots of RAM, several megs of flash, a large array of FPGA Chips and run Linux

This is not a trivial task


I agree, if you want to put the data over TCP/IP, you're going to find that it'll be practically impossible.  You'll need something with far more grunt than the Arduino.  If I were you, I'd be looking into those little Gumstix systems (powerful enough to run Linux etc, I'm sure you've heard of them - http://en.wikipedia.org/wiki/Gumstix).  Maybe even a VIA Pico system?

I reckon I'm onto something here.  You might be able to use a combination of both Arduino (for keyboard and mouse emulation and switching your video input/kb + mouse outputs) and you'll need the Gumstix/Pico to get your incoming video from the other systems and encode it into a video stream of some description.  So try to find a baby motherboard with Composite video input (or just get video card with Composite video in).

If I were you, I'd be aiming to smash together a (Linux) VNC Server, that creates the VNC "video stream" based on composite video input (rather than from the video cards output buffer).  Clearly you'll need to adapt the RGB signal from DSUB/DVI to Composite Video for each system you want to control.

You then just have a standard VNC client to control your Gumstix/Pico VNC server, which whilst sending you the video from the other system, will receive your keyboard & mouse commands and send them to your Arduino, which will pump the real PS2 signals to the real servers.

Hell yeah, let's get crackin' on this thing!


Yes you're definitely onto something :)

I think composite is the way to go, even though the quality will be much worse

High quality VGA frame grabbers are very complex and outrageously expensive, while capture cards with composite inputs can be had for less than $20

VNC will make this much easier to implement :)


It strikes me that you can buy 50' and even 100' shielded VGA cables. All you have to do now is use a normal VGA KVM on the headless computers, and figure out a way to extend your mouse and keyboard. Even though PS/2 is a digital protocol, you can still find shielded cables up to 100', so you may not need any active hardware besides the KVM device. This is the first source of long PS/2 cables I could find, so I doubt they're the cheapest, they also have the long VGA cables.
Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store


Yes you're definitely onto something

Haha, nice.  We're onto "something".  I like it ;-)

It strikes me that you can buy 50' and even 100' shielded VGA cables.

Right you are Mace.  I guess the question is not how can I control a computer from 100' away, but, how can I make an IP KVM switch?

Go Up