Ethernet code problem

18 Feb 2012

EthernetNetIf eth; NTPClient ntp;

EthernetErr ethErr = eth.setup(); if (ethErr) { pc.printf("ERROR!!!"); return -1; }

Hey guys, my program involves connecting to the ethernet, but it keeps failing at this stage. Can anyone tell me whats wrong with my code?

06 Mar 2012

Is your ethernet router working as a DHCP server? If not, you have to define IP address and some parameters like below.

EthernetNetIf eth(
    IpAddr(192, 168, 0, 10),  // IP Address
    IpAddr(255, 255, 255, 0), // Subnet mask
    IpAddr(192, 168, 0, 1),   // Gateway
    IpAddr(192, 168, 0, 1)    // DNS
);

I hope it helps.