Arduino to Arduino Communication Over Internet (w/ middle man)

I have an idea for a project but I'm not sure where to start with this part of it as I've barely used Ethernet shields/modules.

Idea: two boxes with a button and light, and Ethernet(internet) connection. the button on the one box will light up the light on the other box and vise-versa (and maybe more functionality later on). Now the two arduinos wont know (IP) where the other one is, so my thought was have 3rd one that's the middle man that the boxes can talk trough to talk to the other box.

Most simply I want to have 3 arduinos, Arduino-1 will be on a network that has a static IP that I'll know and wont change. But the other two will be on a network (internet access). My thinking is to have Arduino-1 be the middle man because the other two arduinos wont necessarily know where to look IP wise to communicate.

To start off I just need to be able to send essentially On and Off between the boxes, was thinking maybe making a way to check if they're both pressed at the same time and maybe other functions with more inputs later on, but I want to learn how to do a "basic" thing first.

I did a little research and there's a way to open a socket between two arduinos? (where i was reading wasn't very clear how they did it) but this seemed like the best method so there's no weird HTML based communication.

Hope someone can point me in the right direction of where to start :slight_smile:

The concept of having one device act as a web server with a static IP address with other devices acting as "browsers" connecting to the server is very straightforward.

But I wonder is there any advantage in using an Arduino as the server. You will probably be paying an ISP to provide the static IP address so why not host the server on their system ?

And I wonder if an Arduino plus Ethernet shield is any cheaper than a Yun? The Yun has a LOT more capability.

If I was going to use an Arduino as a server I would definitely use a Yun in that role - but a RaspberryPi would be cheaper.


I'm makes in the devices from scratch hopefully in the end(I have an arduino uno which I'll use to prototyping). I've ordered a bunch of components and atmegas and ENC28J60s (not that expensive really), also my home network is static (how it is in my area) which is where I plan to keep the server arduino for the other two to communicate through.
And I know how to portforward so that won't be an issue either.