Pages: 1 [2]   Go Down
Author Topic: Ethernet shield not allowing repeated connections  (Read 2198 times)
0 Members and 1 Guest are viewing this topic.
London, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Paul - I just got my ethernet shield in the post and so I'd be interested (and I'm sure the rest of the forum would too) to see what you did in your source to check for the lock-up
Logged

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

OK.  This is not the recommended solution as the libraries ought to be fixed.  What I did was:

          // ready to send something
          while (!client.connect()) {
            digitalWrite(13,HIGH);         // flash LED if it hangs
            delay(200);            
            digitalWrite(13,LOW);
            tries++;
            if (tries > 100) {                 // ok we have problem
              Ethernet.begin(mac, ip);    // solve it by brute force
              tries=0;
            }
          }
          // OK to send now
          client.print("GET /etc...

As I mentioned above this is not the right fix but a reasonable workaround until the libraries get fixed.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 269
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@Paul Tanner

Could you please post all your changes in the libary.
Because mine still hangs up after 20-30 reconnects
to a PHP site.

Thx
Geko
« Last Edit: February 01, 2009, 04:47:54 pm by GekoCH » Logged

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

@GekoCH.  I only made one change in the library.  It's the one (posted above) relating to changing the port number.  In the application I made a change that I also posted above.  This is the one about restarting the shield if and when it won't connect.

Please post again here if you have these changes and it still hangs.  We really need help on this from the author of the library or someone familiar with the code.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 269
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

ok I've changed those things in the libary and made some changes in my sketch.
Every time I send data to my PHP skript I start the Modul again with:
Code:
Ethernet.begin(mac, ip);
like you've done in your sketch.

Thx
Geko
Logged

Pages: 1 [2]   Go Up
Jump to: