Network works for UdpNtpClient and WevServer, but not for UdpSendReceiveString

Like the title says, the network only seems to work for certain things. I am trying to broadcast UDP packets and have them received by the arduino. I can verify that there is nothing wrong with the ethernet shield, because the UdpNtpClient and WebServer examples work fine. The issue is that the UdpSendReceiveString example does not say it is receiving anything. I have also verified that my computer is outputing UDP packets with wireshark. What could be causing this? Any help would be greatly appreciated.

vockleya,

Do you have examples of code or are you using an unmodified version of the example sketch. I am running arduino-1.0 in Windows. I am able to send a broadcast messages to the unit without a problem. Are you sending broadcast packets to the other sketches too?

I am using unmodified versions of all of them, except for ip/mac address. The other sketches are not receiving broadcast UDP from my computer. I can think of no reason, other than faulty hardware, that would make this not work. The only problem with that is the ntp and webserver sketches work perfectly.

I really need help with this. Nothing I can do makes it work. The arduino is definitely working properly, and my computer is sending udp correctly, but nothing shows up in the serial terminal when UdpSendReceivePacket is running.

I really need help with this. Nothing I can do makes it work. The arduino is definitely working properly, and my computer is sending udp correctly

Maybe, maybe not. Something you are assuming is working properly apparently isn't.

Are you monitoring the broadcast address with the arduino? Broadcast works differently than unicast. The packets are not sent to each device on the localnet. It is transmitted to the broadcast address for that network. For an example, if your ip address for the device is 192.168.0.1 with a subnet mask of 255.255.255.0, then the broadcast address for the network is 192.168.0.255.

edit: If you check with a packet sniffer, you will find the broadcast packets have the broadcast ip as a destination address.

Is there something special I have to do to make it monitor the broadcast address? The ip address of the arduino is 2.111.10.121 (as dictated by the spec for the protocol I am using), the subnet mask is 255.0.0.0, and the broadcast address I'm using on my computer is 2.255.255.255. This all appears to be right, but

I am in new territory here with the w5100. I am not certain it can be done.

You could try assigning the broadcast address to the shield, but that could potentially cause problems. First of all, you would have no internet connection with the shield. Routers almost always block forward on the broadcast address. It is not valid outside the localnet.

That might work, as this device is only supposed to work on the local network. I am away from my computer, and can't try this right now, but I see a possible problem. I have 4 of these that will eventually be on the same network. Won't this cause problems if all of them have the same ip?

I don't know. I know you will not be able to write/send. You will be lucky if you can read the packets. :slight_smile:

Try one and see how it does. If it reads the packets, try another.