Pages: [1]   Go Down
Author Topic: Duemilanove + Ethernet Shield problems  (Read 4023 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
#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!
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What's at the other end of the ethernet cable?  How is that device's network configured?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mi config:

I work with a MacBook 2.4Gh aluminium
then a router
then the arduino

I try to connect them directly (the macbook ethernet changes automatically the cable assignement if you plug a device directly)

All the configuration is pretty simple this is what it turns me crazy

Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try connecting them directly and manually assigning the MacBook an IP like 192.168.0.2 and a subnet of 255.255.255.0.  You might also try turning off wireless on the MacBook.  Did you try the WebServer example?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the terminal input/output for the test:

Last login: Sun Feb 22 11:31:35 on console
macbook-de-garito:~ garito$ telnet 192.168.0.177
Trying 192.168.0.177...
telnet: connect to address 192.168.0.177: Operation timed out
telnet: Unable to connect to remote host
macbook-de-garito:~ garito$ ping 192.168.0.177
PING 192.168.0.177 (192.168.0.177): 56 data bytes
64 bytes from 192.168.0.177: icmp_seq=0 ttl=128 time=0.087 ms
64 bytes from 192.168.0.177: icmp_seq=1 ttl=128 time=0.163 ms
64 bytes from 192.168.0.177: icmp_seq=2 ttl=128 time=0.143 ms
^C
--- 192.168.0.177 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.087/0.131/0.163/0.032 ms
macbook-de-garito:~ garito$

As you can see then I try to connect with the board via telnet a time out error is raised but if I try to ping it all goes as expected

I try every single example I can found because it seems to be a hardware problem

In my original post I try to figure out how can I debug the code (the library one specifically) because I don't have arduino experience but I'm a programmer since I was a kid

What I need is to determine if the ethernet board is ok or if it has a failure or a bug or it's crashed

Thanks a lot!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 28
I need more space !!! Everyone is closing in on me
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't you need to include

Client.h
Server.h

?

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I try it but without success (you could do Sketch / Import Library but don't work so much)

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same problem here with that board. When I upload a code that uses ethernet.h, the L led goes crazy, but the board gets configured with the IP address described. Also the Wiznet chip on the ethernet shield heats up a lot.
Logged

Indiana
Offline Offline
Full Member
***
Karma: 1
Posts: 234
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My ethernet shield is working fine and the Wiznet chip does get a little warm as well so I'm assuming that's normal. After about an hour of being powered on the chip's surface temp is about 44C so it's warm, not hot.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same problem infact the client is always 0 but i don't know why.do you find a solution???
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

More people seem to be having these types of problems with the Ethernet shield. See my post here for more details on the long delay bug: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238295170
Logged

Pages: [1]   Go Up
Jump to: