Sending Data From Four Arduinos To One Arduino - Over Ethernet

Hi.

I am trying to work out the feasibility of a project, after some initial failed attempts.

I am trying to replicate keystrokes on a keyboard remotely controlled by switches. The keyboard emulation will happen far away from where the switches are placed. With this in mind I have decided to use other arduinos connected to a master arduino, which will perform the keyboard emulation.

For keyboard emulation I am using the Leonardo. The keyboard emulation seems to work well on this. I’ll refer to this as the receiving arduino.

For sensing the switches I am planning on using 4 Arduinos with Ethernet Shields going into the Leonardo. I’ll refer to these as the sensor Arduinos. I have initially explored using UDP to communicate between two arduinos - a simple test reading a switches’ value on one arduino, to turning on an LED on the other one (based on this code here - - although I’ve updated it as it uses the Ethernet library used before Arduino 1.0). These Arduinos are directly connected by ethernet. I haven’t got this to work properly, so am beginning to explore using TCP. This will probably be more robust, too.

For this I thought I would use the receiving arduino as an http server, with the 4 sensor Arduinos acting as clients.

Does anybody have experience with this, and think it is likely to work?
My other question would be whether you would recommend the use of a router, or would an ethernet switch suffice?

You don't need HTTP - for simple key strokes, you can communicate directly at the transport layer. I don't see any reason why UDP wouldn't work just as well as TCP. Whether you need a router or a switch has nothing much to do with your solution and just means that somehow or other you need to have a connection between your sending and receiving network interfaces.

It sounds as if what you want is basically a networked KVM extender. It might be easier (although probably more expensive and certainly a lot less fun) just to buy one.