KVM to Ethernet with arduino.. is it possible?

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...

Thanks!

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...

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..

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: Arduino Playground - 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 Arduino Playground - 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

:slight_smile:

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.

-j

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 - Gumstix - Wikipedia). 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 :slight_smile:

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 :slight_smile:

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.

http://www.vpi.us/cable-vga.html

Yes you're definitely onto something

Haha, nice. We're onto "something". I like it :wink:

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?

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

...and as I mentioned above, you can make "VGA to Cat5" adapters (see the relevant bits from the instructable here). I've run a video signal over a 200' patch cord using a couple of homemade adapters and it was a reasonably good signal. So long as you don't need to rout it through switching equipment this would go through wall plugs, patch panels, etc.

Actually, that's a really funny idea--I'm not actually positive how well it would work, but I suspect it would work just fine--make some HD15-to-Cat5 adapters and some USB-to-cat5 adapters (I think you could put two USB signals through one wire, but not sure of distance), and then actually use a patch panel and two Cat5 jumpers (one for video, one for keyboard/mouse) to patch your keyboard/monitor to the computer you want to control. Et voila!

Sounds pretty low-tech and cheesy, but you know I bet it would work, and no messy conversion to IP required if your cabling situation allowed it.

of course this approach would be valid only if the servers are like in another room or floor in the same building, otherwise it's not practical.
And you would have the problem how to route the signal among more than one server. Arduino could handle the PS/2 / USB part, but the video signal?

Arduino could handle the PS/2 / USB part, but the video signal?

The question is are you switching the video signal using a mux with appropriate electrical characteristics? The Arduino should be able to drive the select lines of said mux with no problems.

-j

Alright, my "final" conclusion is that it would be the easiest to put video cards (or any other way) to have composite output, and then have another server, that would have input that would be used more or less as a vnc proxy i am guessing...
It would be interesting to look inside one of those "KVM2ETHERNET" switches by epiphan systems, but I haven't had that much of a luck finding pictures online :-/
Oh well, I guess I will run back and forth for a while and when I will have more servers I will make a system like I explained above.

I have

Had a PowerPC CPU inside, lots of flash chips, a large array of FPGA Chips, an ethernet chip and a bunch of other stuff :slight_smile:

IIRC the FPGAs were Xilinx

And runs Linux of course :slight_smile: