How can I connect multiple Arduinos for simple communication?

I'd like to have a 'master' Arduino that listens via ethernet for TCP/IP commands and then sends that data to one of three 'slave' Arduinos that each emulating USB HID devices connected to different PCs.

My idea is to create an ethernet (TCP/IP) to multiple USB HID keyboard device.

For example, a network machine could send a command like 'KEYSTROKE_A_PC1' and my master Arduino would see the keystroke command (KEYSTROKE_A) and then relay it to slave Arduino 1 and finally emulate the keystroke 'A'.

Does that make sense?

What device(s) would I need? I was thinking an Arduino Mega that has four UARTs and then connect to something simple like Teensy 2.0s?

I think what you want to do is possible, with the help of an internet chip. If you have a wirless router, you can take the dirt cheap ESP8266 and configure it through the Arduino to be a server. But from the tone of your question, I think you have a good bit of learning curve to climb.

Receive data from the internet on one Arduino and pass it by wired connection to 3 other Arduinos that are each capable of acting as HID devices (Leonardo or Micro). ?

I suspect if you explain what your project is about you will get better advice.

...R

Hi, At the basic "Multiple Arduinos" question: One good possibility is RS485 'serial' communication. It is low cost, multiple stations, long distances. See THIS: page for some ideas.

If you get farther along don't miss Nick Gammon's page HERE:

I'm looking at RS485 serial communication but that seems to require extra hardware?

Can't I just connect a master Arduino to slave Arduinos by connecting the UART TX/RX pins together or is it more complicated than that?

My plan is to have one small project box with both the master Arduino and slave Arduinos. The ports on the box would be an ethernet RJ45 port (connected to master Arduino) and multiple micro-USB ports (for each slave Arduino).

The master arduino would connect to my network and listen for commands. (not across the internet, but local machines broadcasting TCP/IP commands)

When a command was received, it was send it to a slave Arduino as a keystroke (because each slave arduino would be connected to a different PC and emulating a USB HID keyboard).

Does that make more sense?

sofakng: Can't I just connect a master Arduino to slave Arduinos by connecting the UART TX/RX pins together or is it more complicated than that?

You can certainly do that.

If you are using Micros (which have an extra HardwareSerial port) it will be especially easy.

...R Serial Input Basics

Thanks Robin!

Thanks Robin!

I’m just curious but when would I need RS485 or other methods?

The master arduino would connect to my network and listen for commands. (not across the internet, but local machines broadcasting TCP/IP commands)

When a command was received, it was send it to a slave Arduino as a keystroke (because each slave arduino would be connected to a different PC and emulating a USB HID keyboard).

The 32U4 uC based devices like Leonardo and micro, have HID capability already. Sparkfun micro The software for HID on these devices is mature as they have been around for a while.

Ray

mrburnette, yes that's what I am using the 32u4 boards for but I need several of them because I want to emulate different HID devices on several machines all being controlled by a master device over tcp/ip.

My ideal board would be something has one RJ45 ethernet port and three or four micro-USB ports. The RJ45 would connect to my network, and each micro-USB would connect to a different PC and emulate USB HID keyboards.

However, since I can't find a board like that I need to setup a master/slave situation using multiple boards.

Instead of using the UARTs for communcation, would it be difficult to use I2C? It looks like I just connect two analog pins across ALL master and slaves and that's it? Would power be a concern because each slave is powered across micro-USB when it's plugged into each PC?