Go Down

Topic: Connecting the Arduino to the Internet (Read 531 times) previous topic - next topic


Hello, I have installed Windows 2003 and I have configured the DNS and the DHCP and tested if I am able to connect to the internet and I am able to. I have connected the Arduino with the Ethernet Shield and I have written the following code (you will find in the attachment). When I open the serial monitor it says connecting then it says connection failed any suggestion on how to connect to the internet with the arduino.

Thank You


You haven't specified a DNS server in your sketch but give the connect method just a host name and not an IP. How do you expect the library to resolve the host name to an IP?

BTW: the header file specifies the method like this:

Code: [Select]
  void begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet);

So you're giving the parameters in the wrong order resulting in the subnet being interpreted as the gateway address. Are you using a current IDE (version 1.0.3)?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131