I am using the Arduino mega 2560(Arduino 1.6 sdk) with Ethernet shield. I have Wireshark running to capture the UDP message. I configured my host machine (Win 7) firewall to allow UDP messages from my Arduino on port 9.
Below is the code running on the Arduino. All UDP function calls return success on the Arduino side.
My board and laptop are connected to a netgear FS605 switch .they are the only ones connected. My ipv4 setttins on my host machine are:
IP address – 192.168.0.4
Subnet mask – 255.255.0.0
Default gateway - blank
I even tried direct connect from controller to PC.
Is there anything else I can try or there something Im obviously doing wrong?
Thanks in advance!
Here is bit more information.
I ran he WebServer.ino from the examples folder. I set the mac address to my boards mac address. I then updated the ip address to 192, 168, 0, 100.
When i run that example code and it executes Serial.println(Ethernet.localIP()); it outputs 0.240.240.120 as Isnt it supposed to output 192, 168, 0, 100?
Thanks
i suspect something is wrong with my ethernet shield. Iver looked around and have read posts about the SD card pins and diabling them. I have tried that pin 10 and pin 4. I am not using an SD card.
I keep geting
0.129.129.129 when I query the local IP address even though Im setting to 192, 168, 0, 5 or any other number.
I think I have narrowed this problem down to the Ethernet shield. If I unplug the shield and run the sample web server code the ip address returned is 0.0.0.0 which is expected. When I plug the shield back in I get 0.129.129.129.
At this point I don't know if the board is bad or if I need to put jumper somewhere or download some firmware .
Any ideas is greatly appreciated
It turns out that the library version of Ethernet I was using which came from Arduino.cc does not work with the Ethernet shield 2 board I have. I downloaded the correct version from Arduino.org and all is well.
Thanks