I purchased the Ethernet Shield-W5500 and have been unsuccessful in getting it to function correctly. I have downloaded and tried both the Ethernet2 and WIZ_Ethernet Library and have had the same results on both.
Using the server example, if I enter in my IP address, set PIN 4 as OUTPUT, HIGH, I can get a serial print showing an IP address for the server. Issue is this IP address is not what I had set in the sketch and I can not connect to the server via a browser. Even though the serial print shows the wrong IP, I can ping the device at the correct IP address. Just can’t get anywhere from there.
The sketch is updating the IP and MAC as if I change the IP and/or the MAC, I can ping the IP and using ARP - a, I can see the IP and MAC address.
I am trying to keep things pretty simple for troubleshooting:
Arduino 1.6.8
Arduino Due
Ethernet Shield W5500
Thanks for the reply. I set D10 to HIGH without setting it as an OUTPUT…Same result.
Code Snipet:
#include <SPI.h> #include <Ethernet2.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xFE
//0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(10, 0, 1, 37);
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
// pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
delay(1);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
I did try the WizNet Library as well...Have the exact same issue no matter what library I use. Have even tried uninstalling/re-installing the IDE as I change between the two just in case of any kind of conflict.
Is there any way to hard code the gateway and ip within the cpp or h file? Looks like both the ip and the gateway are the two value that never get set correctly.