Hi all!
I have a Duemilanove and an Ethernet Shield and I try to test the Ethernet library Server
I use this code for testing it:
#include <Ethernet.h>
// network configuration. gateway and subnet are optional.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 0, 177 };
byte gateway[] = { 192, 168, 0, 1 };
byte subnet[] = { 255, 255, 255, 0 };
// telnet defaults to port 23
Server server = Server(23);
void setup()
{
Serial.begin(19200);
Serial.println("Monitorizacion iniciada");
// initialize the ethernet device
Ethernet.begin(mac, ip, gateway, subnet);
Serial.println("Conexion de red inicializada");
// start listening for clients
server.begin();
Serial.println("Esperando peticiones");
}
void loop()
{
Client client = server.available();
if (client) {
Serial.println("Procesando peticion");
client.println("Bienvenidos al servidor telnet. Soy una arduino, hola!");
server.write(client.read());
}
else {
Serial.println(client);
}
}
The weird thing is that client is allways 0
I try to ping the board with pretty success but I never could connect it by browser nor telnet
I try several examples but never works
Could it be a hardware problem?
How can I debug the code to try to understand where the problem is?
Thank you so much!