Pages: [1]   Go Down
Author Topic: More than 4 connections with ethernet shield.  (Read 344 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Thanks
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 46091
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.
Logged

Pages: [1]   Go Up
Jump to: