Pages: [1]   Go Down
Author Topic: Connecting the Arduino to the Internet  (Read 269 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

* sketch_feb13a.ino (1.17 KB - downloaded 9 times.)
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 112
Posts: 5288
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: