Pages: [1]   Go Down
Author Topic: Network works for UdpNtpClient and WevServer, but not for UdpSendReceiveString  (Read 971 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

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

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

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

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

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9549
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5982
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
http://en.wikipedia.org/wiki/Broadcast_address

edit: If you check with a packet sniffer, you will find the broadcast packets have the broadcast ip as a destination address.
« Last Edit: April 27, 2012, 07:12:43 am by SurferTim » Logged

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

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
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5982
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

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

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5982
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Pages: [1]   Go Up
Jump to: