1 Arduino Leonardo 3 Computers

Hi,

Is it possible to send output data from one arduino leonardo to three Mac Minis via usb?

I am running the same application on all computers and need them to all activate when the arduino is triggered.

Can this be done with a usb hub splitter maybe?

I don't know but I would be surprised if it is possible.

Can you give more details of what you want to achieve - maybe there is another way?

...R

Hi Robin,

I have a Leonardo running a capacitive touch script. The arduino is connected to a steel handle that then translates the signal to a keyboard #1 press.

The #1 press is interpreted by software on my computer to run a video. However, I have this same script running on 3 total computers, because of limitations I have with some digital displays.

What do you think? A usb hub maybe?

Something like this, perhaps? Although I would need an adapter for the micro usb on the leonardo.

Those hubs do not split a single USB signal into 4. They allow 4 separate devices to connect via a single USB socket.

USB is a very complex system. When a device communicates over USB it is a two-way "paired" conversation. I can't imagine how one Leonardo could have a two-way conversation with 3 PCs at the EXACT same time - especially as the Leonardo is only sending out one channel of conversation.

In a normal arrangement the PC is the master and the Leonardo / keyboard is the slave. If you connect 3 PCs there would be 3 masters - it can't happen.

...R

Go it, looks like i'll be using 3 arduinos, one per computer and activate all the arduinos at the control area.

I'd use Ethernet or WiFi and then one Arduino can communicate with all your computers through the network. And then use an application on the computers to interpret the network communication.

pert:
I'd use Ethernet or WiFi and then one Arduino can communicate with all your computers through the network. And then use an application on the computers to interpret the network communication.

I had though of something like that but it is difficult (if not impossible) to emulate a keyboard that way. There could also be latency problems.

With 3 Leonardos (or equivalents) it would be easy to arrange communication between them or between them and a master Arduino.

...R

Robin2:
it is difficult (if not impossible) to emulate a keyboard that way.

Not at all. You just need an application running on the computer that receives the network communication and then does the keyboard emulation(actually I prefer using command line interface instead of shortcut keys whenever possible). I use a program called EventGhost to receive TCP communication from my Arduino and then emulate keyboard or any other action I want. It also supports UDP, MQTT, and web server communication. There is also AutoHotkey and Girder that do the same thing. I think they're all Windows programs but I'm sure there are other options for any OS. As for latency yes you're probably not going to like a game controller connected over the network so much but it really depends on the application.

Robin2:
There could also be latency problems.

I can send an event from my Arduino to Eventghost and back via TCP in around 8 milliseconds, I'm sure it would take less time than that for a one way send and a keyboard emulation. I'm guessing it would be even faster using UDP.

pert:
I use a program called EventGhost to receive TCP communication from my Arduino and then emulate keyboard or any other action I want.

A clear example of two heads being better than one.

...R

Thank you for the input. This is the most feedback I have gotten, yet!

I think I am going to try to avoid the network, as the wi-fi at my school, where the project will be. Is rather unreliable.

I am more of a believer in hard wired components.

Unless there is a way to network the computers together with some kind of hub ... I am really new to all of this. Thank you!

Plus i am on Mac OS, using 3 mac minis.

chuco61:
I am more of a believer in hard wired components.

Me too, that's why my whole home automation system is connected using Ethernet.

chuco61:
Unless there is a way to network the computers together with some kind of hub

Router with at least 4 ports

chuco61:
Plus i am on Mac OS, using 3 mac minis.

If you search a bit there are definitely mac compatible alternatives or you may be able to get one of those programs I listed running on the mac.

It's just another option to consider. One reason I prefer Ethernet to USB is that I can easily use long cables. Long USB cables never seem to work reliably for me, even the active ones.

Pert,

If I were to use a router. How does the arduino communicate with the router and send the signal out to the computer?

I'm asking, because I would like to have a plan B, in the chance my extra arduinos dont arrive on time.

Or is there an article I can read up on this? looks like I may need a shield I do not have.

Thanks!

The Arduino doesn't need to communicate with the router. The router just routes network communication. Your Arduino will have an IP address and your computers each have an IP address. So when you send a message from your Arduino to the IP address of one of the computers then the router just makes sure the message goes to the right place. If it is configured correctly this will just work, and you can just pretend you're sending the message straight to the computer. A good example for this is the Ethernet library's ChatServer example.

So to use Ethernet for your project you would need an Ethernet shield or module for your Arduino. These are available with a few different Ethernet controller chips on them. I would not recommend getting one with the ENC28J60 as these are less reliable. The Arduino Ethernet library only supports the W5100 but there are other good libraries that support the W5200 and W5500 chips. The computers already have an Ethernet port. So the Arduino and the computers are all connected to the router using Ethernet cables. Usually you would also have the router connected to your Internet modem but in this case that is not necessary because you are just creating a local network.

Got it, thanks for the information. I'll look into eventghost for Mac.