Is the maximum number of sockets still 4 with 1 reserved for DHCP? Question relates to Cobra I (4.1), Hydra (4.2), ChipworkX (4.X), and Cobra II (4.2).
I’m looking for a good way to network these guys. UDP is dropping too many messages. So I was thinking maybe UDP to broadcast “Hey I’m the server, look at me, look at me” and then using TCP/IP for commands and requests.
The problem w/ that is if the socket count is 4 I only have the ability to talk to 1 device at a time (1 socket DHCP, 1 socket UDP, 1 socket for listening and the new raised socket on .Accept); which mucks things up a bit.
If that is the case are there any suggestions for working with a high count (up to 254) device network?
4 is the limit on the WizNet W5100, which is only used by, I believe, the USBizi-based boards. This limit is a hardware limit, and there’s no workaround for it. Boards that are using other networking solutions have different (software- and resource-enforced) limits, but I don’t know that any of them would be as high as 256 sockets. Certainly nothing without external RAM, such as Hydra, Spider, and G120. Even then, I think someone said that the limit for EMX was a hundred or so, with the practical limit being something less than that.
As you have seen, UDP is not a reliable protocol, meaning that it is allowed to drop packets. This does not happen with TCP, but TCP generally requires more resources than UDP.
Mesh networking setups like you’ve created here are, as you’ve discovered, vulnerable to “packet storms” where lots of traffic is generated as the devices all communicate amongst themselves.
Something like RS-485 or CAN might be more suitable?
Perfect! I plan on closing the TCP sockets between commands/messages so that should be above and beyond what I need