Arduino Forum

Forum 2005-2010 (read only) => Hardware => Troubleshooting => Topic started by: myerika on Oct 30, 2008, 09:06 am

Title: No TCP/IP link,without pressing the reset button
Post by: myerika on Oct 30, 2008, 09:06 am
I have just get my first Arduino boards, Duemilanove and a Arduino Ethernet Shield. I have installed the Windows software and loaded
the Web Server example to the unit. Everything worked fine and I was able to communicate with the unit from Windows Explorer when I had the USB cabel connectet to my Laptop (with drivers)
But when I try to power the units from a routers USB port (I just want 5V from the router)  I have to press the reset button on the Ethernet Shield to have the Ethernet up and running. The router have no drivers for the Arduino units.  ??    
Title: Re: No TCP/IP link,without pressing the reset button
Post by: gnu_linux on Oct 30, 2008, 10:00 am
Your USB port may not be able to provide enough power

What kind of router do you have?

:)
Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Oct 30, 2008, 10:24 am
It's no problem with the power I got 5 Volt from the router. The router is an Dlink DIR-451 mobil broadband. It seems that when I have the USB cabel connected to the PC there are some handshaking who trigger the Ethernet link to go up.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: gnu_linux on Oct 30, 2008, 10:43 am
Have you tried using an external power supply?

The Duemilanove can take 6-12VDC from an AC to DC adapter using the power plug on the edge of the board -- make sure you move the PWR jumper from USB to EXT PWR

Please give it a try and let us know if it works

:)
Title: Re: No TCP/IP link,without pressing the reset button
Post by: kg4wsv on Oct 30, 2008, 12:05 pm
Quote
I got 5 Volt from the router.

That's half the equation - how much current do you get?

I second (or third) the recommendation to try a different power source.

-j

Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Oct 30, 2008, 01:19 pm
Same result with external power, the "FULLD" Led is blinking until I push the reset button.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Oct 30, 2008, 01:49 pm
I have done another test, external power and then I have cut of the power cable (pin1 VCC) from the USB cable. Same result when I connect the USB cable to my PC the link go up! It seems to be some magic talk between the board and the driver in the PC. No program is running in the PC.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: kg4wsv on Oct 30, 2008, 02:06 pm
Time to post your code...

-j

Title: Re: No TCP/IP link,without pressing the reset button
Post by: gnu_linux on Oct 30, 2008, 02:08 pm
Some pictures may help too :)

http://flickr.com/ is good for high-res pictures

:)
Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Oct 30, 2008, 02:13 pm
Here comes the code, I have just changed the IP address from the example:

/*
* Web Server
*
* A simple web server that shows the value of the analog input pins.
*/

#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 0, 120 };

Server server(80);

void setup()
{
 Ethernet.begin(mac, ip);
 server.begin();
}

void loop()
{
 Client client = server.available();
 if (client) {
   // an http request ends with a blank line
   boolean current_line_is_blank = true;
   while (client.connected()) {
     if (client.available()) {
       char c = client.read();
       // if we've gotten to the end of the line (received a newline
       // character) and the line is blank, the http request has ended,
       // so we can send a reply
       if (c == '\n' && current_line_is_blank) {
         // send a standard http response header
         client.println("HTTP/1.1 200 OK");
         client.println("Content-Type: text/html");
         client.println();
         
         // output the value of each analog input pin
         for (int i = 0; i < 6; i++) {
           client.print("analog input ");
           client.print(i);
           client.print(" is ");
           client.print(analogRead(i));
           client.println("<br />");
         }
         break;
       }
       if (c == '\n') {
         // we're starting a new line
         current_line_is_blank = true;
       } else if (c != '\r') {
         // we've gotten a character on the current line
         current_line_is_blank = false;
       }
     }
   }
   client.stop();
 }
} :-X :-[
Title: Re: No TCP/IP link,without pressing the reset button
Post by: kg4wsv on Oct 30, 2008, 02:43 pm
I don't know the Ethernet library, but there is nothing obvious to me wrong with the code.

Try putting a resistor, 1k to 10k, between arduino pin 0 and ground (but only when the arduino is not connected to a computer for programming, etc).

I wonder if some noise on the RX line is causing the bootloader to hang.  If your router is a wifi router, there could be plenty of RF noise to go around.

Does a single press of the reset button fix it every time, or do you have to try a few times before it starts working?

Do you hook up the ethernet cable before the USB cable?  maybe try powering up the Arduino before you plug in the ethernet cable.  If this seems to help, put a delay() of a few seconds in setup() to see if that helps.

-j

Title: Re: No TCP/IP link,without pressing the reset button
Post by: gnu_linux on Oct 30, 2008, 03:33 pm
Great advice kg4wsv

A Faraday cage would also help :)
Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Oct 30, 2008, 03:45 pm
I have tried all proposals without any success. I have even switched to
another router. Only USB connect or ONE single push on the reset button start up the ethernet link.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: kg4wsv on Oct 30, 2008, 05:12 pm
Sorry, I'm stumped.  I see no reason for the behavior you observe.

Which ethernet shield are you using?

-j

Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Oct 30, 2008, 06:50 pm
It's a Arduino Ethernet Shield.
See picture on attached link

http://www.electrokit.se/images/12200080.jpg
Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Nov 06, 2008, 02:59 pm
I order a new Ethernet Shield card and now it's working!
;D
Title: Re: No TCP/IP link,without pressing the reset button
Post by: lansing on Nov 13, 2008, 11:25 am
I, too am experiencing this same issue. It is an arduino ethernet shield (wiznet with the sd card slot). I have written some very simple tcp code, that does not work on power up, but works just fine if you then press the reset button, ground the reset pin, or open a serial connection.

Should I contact my vendor, or is it possible to fix my unit?
Title: Re: No TCP/IP link,without pressing the reset button
Post by: myerika on Nov 13, 2008, 03:33 pm
Even with my new hardware I seem to have the same problem.
I have to push the reset button or connect the USB cabel to have the Ethernet link up ?? :'(
Title: Re: No TCP/IP link,without pressing the reset button
Post by: kg4wsv on Nov 13, 2008, 04:33 pm
This sounds similar to a problem I had with my home-brew ethernet board (using the Wiznet module).  I had a 3.3V regulator that was too small and had to add a 200ms sleep in setup() to get it to work reliably.

The Arduino ethernet shield's 3.3V regulator is not undersized, but I wonder if there is some similar issue?  The Wiznet chip seems to be a bit picky about low voltage, and it's a bit hungry at 138mA to 183mA current consumption.  It also needs 10ms from the time reset goes inactive until PLOCK is good. (I assume that's a PLL lock? no other mention of that parameter in the datasheet.)

Anyway, just as a wild guess, try putting a delay() in setup() to see if that helps.

-j
Title: Re: No TCP/IP link,without pressing the reset button
Post by: lansing on Nov 13, 2008, 08:18 pm
Unfortunately the delay does not help. I tried up to 20 seconds before calling Ethernet.begin().

It's really disappointing because the ethernet shield is such a potentially cool piece of hardware, but it's not very useful if one has to press the reset switch after every power up.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: lansing on Nov 14, 2008, 05:35 am
Well, I have constructed a workaround to this issue, and it appears to be resolved. It's not exactly pretty... basically I took a little SPST, normally open relay and hooked the coil pins to ground and digital pin 02, and the switched pins to ground and the reset pin.

You can probably guess what comes next... before initializing the ethernet library, I look for a flag at an address in eeprom. If the flag is 0, we set it to 1 and then trigger the relay, and the unit resets. If the flag is 1, we assume that we just did a warm reset and set the flag back to 0, for next time we power up.

The pastie below is the code snippet I wrote if anyone is interested (let me know if there is a better way to accomplish this sort of thing, I'm new).

http://pastie.org/314577
Title: Re: No TCP/IP link,without pressing the reset button
Post by: dcb on Nov 14, 2008, 06:30 am
There is a flag somewhere that you can figure out if the atmega was power cycled or reset, don't recall where though.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: atilghman on Nov 17, 2008, 02:44 am
I've also had problems initializing the Ethernet shield after a cold reset/powerup.

My solution was to disconnect the shield's reset pin* so it could be reset independently of the arduino main board.  I then ran a jumper from a digital output pin to the shield's reset line.  

Before calling the Ethernet library, I enable that output pin, pull it low for 100ms, and then switch the port back to input mode with pullups disabled.  

(* actually, my original Arduino USB board doesn't have a socket for the reset pin, so the line wasn't connected in the first place.  If you have a newer board, you'd need to clip the shield's reset pin or cut a trace on the shield PCB.)
Title: Re: No TCP/IP link,without pressing the reset button
Post by: lansing on Nov 19, 2008, 05:37 am
agt--

Very nice, I like this solution. I'm a little nervous about cutting up my precious ethernet shield, but it does seem more elegant than self-resetting with a relay.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Dec 06, 2008, 09:47 pm
Is there any possibility to solve this problem inside the ethernet library?
Title: Re: No TCP/IP link,without pressing the reset button
Post by: mellis on Dec 07, 2008, 10:31 pm
Hmm... Ethernet.begin() calls iinchip_init() and sysinit() which supposedly resets the W5100.  Maybe the network / router doesn't expect the device to reset in that way?  What if you use a random mac address each time (note that you'll need to call randomSeed() with something like the value of analog input before using random())?  Or a random ip?
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Dec 07, 2008, 10:38 pm
It does not work even if there is no network connected during the cold start.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: mellis on Dec 08, 2008, 12:50 am
What if you call Ethernet.begin() twice?  

There's basically no code in the constructors of Client or Server, so it may be that the W5100 just doesn't work properly when powered up without a reset.  We may need to allow for a reset of the W5100 from an Arduino pin.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Dec 08, 2008, 08:59 am
No success.

I tried it also with delays, like this:

 delay(5000);
 Ethernet.begin(mac,ip,gateway,subnet);
 delay(5000);
 Ethernet.begin(mac,ip,gateway,subnet);
 delay(5000);

Also no success.



Are you able to reproduce this problem?

Is there anyone who can supply the arduino and ethernet shield with external power and network connection is up without having to push the reset button?
Title: Re: No TCP/IP link,without pressing the reset button
Post by: Stephan_Watterott on Dec 08, 2008, 06:34 pm
Hi all,

I think the normal reset time is to short for the Ethernet-Shield.
So I soldered a 100nF cap between the Reset-Pin and GND and
then the Ethernet-Shield works without pressing the reset button.
(a good position for a 100nF SMD cap is between the pins from the reset switch)


Best regards
Stephan

-----------------------
Watterott electronic
Germany
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Jan 10, 2009, 10:34 am
I soldered a 100nF cap between the Reset-Pin and GND and you were right, the external power up is now working without having to reset the ethernet shield.

But it's not possible to download sketches anymore when the ethernet shield is pluged on the arduino. I get the following error message:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x1e

It seems that the auto reset doesn't work anymore. I've got an Arduino Duemilanove. Do you have the same problem or any idea to solve it?

Title: Re: No TCP/IP link,without pressing the reset button
Post by: Stephan_Watterott on Jan 13, 2009, 09:53 am
Can you solder a smaller Cap 20 - 47 nF between the switch.
I can not test it today, because I have no board in stock.

Best regards
Stephan Watterott

---------------------
Watterott electronic
www.watterott.com
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Jan 17, 2009, 12:57 am
I tried it with 50nF (two 100nF capacitors in series) and it works. Now I can power the arduino external and the ethernet shield starts operating without a reset and the sketch upload is possible, too.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: nicpottier on Feb 04, 2009, 05:47 am

Add me to the list of people running into this problem, I'm pretty disappointed considering I just bought it, I thought perhaps they would have fixed it by now.

Can somebody post a picture (or diagram) of the cap workaround?  I tried soldering a 22nf cap between the legs of the reset switch on the ethernet shield and that doesn't seem to do it.

This is the last step to making my project complete, so I'd love any help!  Thanks!
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Feb 04, 2009, 05:57 am
Instead of soldering a SMD cap between the button's pins you can also plug a normal cap between the Reset and Ground pin. I used two 100nF in series (together 50nF). Maybe 22nF is too small.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: nicpottier on Feb 28, 2009, 07:52 pm
By the way I ended up just 'working around' this problem by instead using the LadyAda ethernet shield, which has the additional advantages of having the wiznet module on a daughterboard and allowing you to very easily independently reset it.

Plus you get to solder it together, which is always fun.

I would recommend that route for anybody who doesn't want the headache of mucking with the current 'official' ethernet shield.  Sad but true. :(
Title: Re: No TCP/IP link,without pressing the reset button
Post by: laventhol on Mar 26, 2009, 10:09 am
Thanks all --

1.  To keep that reset line low for a while, you can stick pretty much any capacitor there.  I tried it with 22uF in the reset and ground lines of the stacking header.  Worked immediately.  (Thanks Stephan).

2.  AGT's technique of using an output pin is theoretically do-able with the hardware as it stands: the Atmega 168 can have the reset pin configured as an output (by changing the hfuse value).  Then you can use the power-on reset of the Atmega (or watchdog) and drive the reset line from the CPU to reset any other circuitry -- very nice.  BUT the reset line is used by all the ISP programmers, so unless you have a non-ISP programmer you won't be able to modify the bootloader code.  (Unless you get it right first time, you won't be able to reprogram the atmega.  Thankfully I have a few spare CPUs.)

Conclusion: do it with the capacitor.

J.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: Arnonh on Nov 04, 2009, 03:39 pm
I have tried tow 100 nf capacitors in sires and ti doesn't seem to work
by the way i am using NKC Ethernet Shield and Freeduino Serial v2.0
Title: Re: No TCP/IP link,without pressing the reset button
Post by: iz6bmp on Dec 30, 2009, 12:45 am
Hello all,
I had 14 Arduinos, each equipped with ethernet shield and ID-12 RFID integrated reader and ONLY 6 of them experienced the "reset issue". Before reading this post I tried with 100nF cap (I had a lot of BAD RESET experience with Z80 and PICs) and it didn't work. I increased to 470nF and it was OK! I suggest to add a 1N4148 or similar diode from reset line (anode) to +5V (cathode) to fast discharge the capacitor when power goes off, otherwise it will discharge via the ESD diode inside the ATMEL and this is not really safe.
Hope this helps, have fun with the ETH shield + Arduino and HAPPY NEW YEAR.
Rino
Title: Re: No TCP/IP link,without pressing the reset button
Post by: DRose28357 on Mar 10, 2010, 08:14 am
I did not manage to bring Ethernet Shield into stable operation. I always have to press reset. There must be a design problem. If Ethernet Shield needs a different Reset timing then it should have its own reset cuircit.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: gazoakley on Mar 23, 2010, 10:14 pm
Is there a definitive solution to this now? Judging from the responses, it seems like a capacitor between reset and ground in the stack header looks the easiest solution. Would this be suitable?

http://www.maplin.co.uk/Module.aspx?ModuleNo=318 (JL01B or JL02C)
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Mar 24, 2010, 06:10 am
This is my working solution:

1. don't connect the reset pin of ethernet shield to the arduino (bend it a little bit away)
2. connect the reset pin of ethernet shield to a digital pin of the arduino

use the following init code:
void init_ethernet()
{
 pinMode(DO_RESET_ETH_SHIELD, OUTPUT);      // sets the digital pin as output
 digitalWrite(DO_RESET_ETH_SHIELD, LOW);
 delay(1000);  //for ethernet chip to reset
 digitalWrite(DO_RESET_ETH_SHIELD, HIGH);
 delay(1000);  //for ethernet chip to reset
 pinMode(DO_RESET_ETH_SHIELD, INPUT);      // sets the digital pin input
 delay(1000);  //for ethernet chip to reset
 Ethernet.begin(mac,ip,gateway,subnet);
 delay(1000);  //for ethernet chip to reset
 Ethernet.begin(mac,ip,gateway,subnet);
 delay(1000);  //for ethernet chip to reset
}

another positive side effect:
it is possible to run init_ethernet() whenever the ethernet chip stops working correctly
Title: Re: No TCP/IP link,without pressing the reset button
Post by: gazoakley on Mar 24, 2010, 02:16 pm
I can see how that would work, but I'm a bit hesitant to start cutting/bending pins on the ethernet shield :)

Does the trick with the capacitor work? Would the previous component I linked to be suitable?
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Mar 24, 2010, 02:29 pm
I've had the capacitor solution before and was not satisfied.

Sometimes after power failures the Ethernet shield didn't come up again.
When it hangs, there is no possibility to make a automatic reset.

Don't worry about bending the reset pin, it just needs 2 millimeter to not plug into the arduino socket.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: sasaa on Apr 15, 2010, 03:30 pm
its wierd but i had the same problem.
untill set a gateway and subnet
Code: [Select]

// doesn't work
#include <Ethernet.h>
byte mac[]     = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[]      = { 192, 168, 2, 50 };
Server server(80);


Code: [Select]

// does work without reset or annything
#include <Ethernet.h>
byte mac[]     = { 0x00, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[]      = { 192, 168, 2, 50 };
byte gateway[] = { 192, 168, 2, 1 };
byte subnet[]  = { 255, 255, 255, 0 };
Server server(80);
Title: Re: No TCP/IP link,without pressing the reset button
Post by: pluggy on Apr 15, 2010, 07:02 pm
The 100nF capacitor between GND and reset works for me, setting the gateway and subnet doesn't......
Title: Re: No TCP/IP link,without pressing the reset button
Post by: burni83 on Apr 16, 2010, 05:48 pm
I've always had a gateway and subnet set during my tests. Therefore I hardly believe that SaSaa's solution solved the reset problems in each case.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: pictux on Jun 15, 2010, 11:47 pm
@burni
Quote

1. don't connect the reset pin of ethernet shield to the arduino (bend it a little bit away)
2. connect the reset pin of ethernet shield to a digital pin of the arduino
....


thanks, your solution works very well.
I use your code also to reset Ethernet shield if it hangs (quite often).

As far as you know, that's a problem related to Wiznet 5100 chipset?
Title: Re: No TCP/IP link,without pressing the reset button
Post by: pictux on Aug 12, 2010, 09:32 am
HI all,
have you seen this:
http://arduino.cc/blog/?p=659

New Ethernet Shield:
Quote
We're very happy to announce an updated version of the Arduino Ethernet shield, with some nice new features. This revision incorporates a micro-SD card slot so you can store files to send over the network. It's compatible with the Arduino Mega (using the SPI pins on the ICSP header). It adds a reset controller which should address the problems some people have had getting it to work directly on power-up. All-in-all, we think it's a well-rounded upgrade to a useful product.


It seems that the reset issue is addressed - even if i've not tried this new shield yet.
Any feedback?

Regards
M
Title: Re: No TCP/IP link,without pressing the reset button
Post by: mellis on Aug 13, 2010, 12:15 am
In my tests, the reset controller on the revised shields seems to fix these problems.  Please let me know if it works for you.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: Nekota on Nov 07, 2010, 10:44 pm
I am new to the Arduino and can report I have not had any reset issues using the Rev5 EtherShield on a Arduino Mega. It has been plug and play hardware. I am having some connection refused with the library code with connect which brought me to this thread. It's intermittent failure at 1 per 300 or so connections and it fails with connection refused 6100 error code.
Title: Re: No TCP/IP link,without pressing the reset button
Post by: Mavromatis on Nov 08, 2010, 06:21 pm
I've created my own ethernet shield board using the WIZNET W5100 and reference designs.  Everything works great, however, I just plugged the shield into a Gigbit switch and it fails to start.  When I plug it back into a 10/100 it works fine.  Any ideas?  It should just operate at 10/100, or is the gig-switch having issues?