Go Down

Topic: Ethershield SD and Arduino 1.0 (Read 992 times) previous topic - next topic

alkj

In the Ethernet library, DNS, has been inserted in the begin-procedure, which is not updated in the Reference-example.

Reference-example: Ethernet.begin(mac, ip, gateway, subnet);

And in Ethernet.cpp: void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway)

So the DNS will get the address of the gateway, and worse, the gateway will try to be written as the netmask, by following the reference-example in Ethernet.

I suggest that the DNS is removed from the header, as it is only a nice to know but not as important as mac, IP, nw-mask and gw.

By the way, if an SD-card has been applied to the sd-reader socket, the server will not get an IP-address if not importing the SD-library, even without the intension of using the sd-card. You can ping the board, but if reading the servers IP-address it is not initialised( IP = 0xffffffff). By removing the SD-card from the reader, server becomes the IP-address as given.
The dependency is not so obvious.

Please also state that the default GW is the IP-address with the last digit replaced by a 1, by default in the reference, the same goes for DNS, and default netmask is 255.255.255.0 if none applied.

book_woorm

This problem is also very tedious if you are using a BT Home Hub where the DNS and Gateway are 192.168.1.254!! rather than the assumed 192.168.1.1.
So if you want to use UDP to get NTP or similar and then put it out on your intranet using DCHP works fine (if you can afford the programme space overhead),
but 'Ethernet.begin(mac,ip);' doesn't want to know. You cant be lazy and have to use the full 'Ethernet.begin(mac,ip,dns,gateway,submask);'

Go Up