Pages: [1]   Go Down
Author Topic: Long Term Reliability of WizNet Shield  (Read 640 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been working on a sensor node that monitors power consumption, and some other environmental characteristics. I have some simple code that seems to work well, for a while. It then freezes up, and I am not exactly sure why.

I have research this issue around this forum, as well as on the internet and come up with a few possible scenarios.

1. WizNet chip is having issues > could connect a reset pin
2. My code is crap (very likely)
3. Arduino itself is freezing up (probably due to 2)

I am not exactly sure where to procede, but I have a few questions for any knowledgeable person:

Is it safe to call Ethernet.begin() repeatedly? If so, what condition should cause me to call it? Should there be a timeout first?

I am using the EthernetDHCP library (http://gkaindl.com/software/arduino-ethernet/dhcp), so I call EthernetDHCP.maintain() in my loop

Will that maintain the WizNet, as well as try to give me a nice IP address when my lease expires?

Also, I am trying to user yaler (yaler.org), to enable easy firewall penetration.

If anyone has experience with it, let me know. I am also uncertain about implementing it reliably.  

Isaac
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the "software reset pin" change installed.

I have a (re-)initialization routine that's called at startup and after a timeout.  It looks,  in part,  like this:
Code:
     pinMode(WIZNET_RESET_PIN, OUTPUT);
      digitalWrite(WIZNET_RESET_PIN, HIGH);
      delay(50);
      digitalWrite(WIZNET_RESET_PIN, LOW);
      delay(50);
      digitalWrite(WIZNET_RESET_PIN, HIGH);
      delay(100);

      Ethernet.begin(mac, my_ip, gateway);
I haven't tried repeating Ethernet.begin without the Wiznet reset,  so I won't predict what will happen without it.

Ran
Logged

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

Hi Isaac,

we currently use about the following code to run a Web service on an Arduino / WIZnet Ethernet shield and make it accessible via Yaler:

Code:
#include <Ethernet.h>
#include <EthernetDHCP.h>

byte mac[] = ...
byte yalerIp[] = ...
const char yalerId[] = "my-arduino";

...

void setup() {
  EthernetDHCP.begin(mac); // calls Ethernet.begin()
  ... sensor setup ...
}

void loop() {
  Client client(yalerIp, 80);
  client.connect();
  if (client.connected()) {
    sendYalerPostRequest(client, yalerId);
    int status = receiveYalerResponse(client);
    if (status == 101) {
      receiveBrowserRequest(client, ...);
      ... read sensor ...
      sendBrowserResponse(client, ...);
    } else {} // 204
    client.stop();
  }
}


With our DHCP server / office LAN, calling EthernetDHCP.maintain(); seems not to be necessary, as long as the DHCP server keeps running.

Cheers,
tamberg

http://yaler.org/
Logged

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

Here's a detailed write up of the Yaler Arduino Web LED demo including source code:
http://www.instructables.com/id/Arduino-Web-LED/

Cheers,
tamberg
Logged

Pages: [1]   Go Up
Jump to: