More than 4 connections with ethernet shield.

I am working on a project in which no less than 10 Arduino Uno's with Ethernet shields will be collecting and transmitting data to a central Uno with Ethernet shield. The data from the remote Uno's is being transmitted via UDP to the central Uno as soon as the data becomes available. I know that the Ethernet shield only supports 4 simultaneous connections and was wondering what everyone thought would be the best way to address this problem in the rare case that more than 4 remote Uno's send data at the the same time.

Thanks, Calvin

You can have only 4 sockets open on the Ethernet shield. In the TCP case this means 4 connections but as UDP is connectionless, you just receive and send packets, there is no connection and all this can be done with just one socket. Have you tried that and ran into problems?

I haven't had the opportunity to test this fully because our funding hasn't come in for the project yet. I was just wondering if that would be a problem when we got everything working together. But what you said makes sense and that was kind of what I was thinking myself.


If you do use TCP to send the data, the client will fail to get a connection to the server, if the server already is 4 connections. So, just wait a little and try again.

@PaulS: Just waiting works only if you have a protocol that does not have persistent connections, HTTP for example. With protocols that typically leave the connection open as long as possible (SMB or database connections tend to be in this category), waiting is probably no option and you should change to a connectionless protocol.

The OP is using UDP (which IS connectionless) and therefore should never reach the socket limit on the Ethernet shield.