Ciao,
ho un problema con il seguente codice:
Code:
#include <SPI.h>
#include <Ethernet.h>
#include <Dns.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
EthernetClient client;
char server[] = "www.arduino.cc";
int serverport = 80;
void setup() {
// start serial port:
Serial.begin(115200);
// give the ethernet module time to boot up:
delay(1000);
// start the Ethernet connection using a fixed IP address and DNS server:
//Ethernet.begin(mac, ip, ipdns, ipgw, mask);
Ethernet.begin(mac);
// print the Ethernet board/shield's IP address:
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP());
}
void loop() {
DNSClient dns;
// OPENDNS
IPAddress dns_ip(208, 67, 222, 222);
IPAddress out_ip;
dns.begin(dns_ip);
dns.getHostByName(server, out_ip);
Serial.println(out_ip);
delay(5000);
}
Uso Debian Sid e Arduino 1.0.1 con Arduino Uno.
Questo codice invece di mostrarmi l'IP address dell'hostname www.arduino.cc mi mostra 0.0.0.0.
Ho trovato che il problema è nella libreria DNS ma vorrei sapere se qualcun'altro ha il mio stesso problema.
Ho anche riportarto il bug sul tracker di google code Google Code Archive - Long-term storage for Google Code Project Hosting..
Grazie mille.