No Ethernet on first boot - SOLVED

The EtherTen combines an Uno-equivalent Arduino-compatible board and Wiznet-based Ethernet support, along with a microSD card slot and Power-over-Ethernet support. [Product page]
Post Reply
TheBorgkollektiv
Posts: 4
Joined: Tue Feb 17, 2015 9:59 pm

No Ethernet on first boot - SOLVED

Post by TheBorgkollektiv » Tue Feb 17, 2015 10:13 pm

Kit: Etherten V3.0, POE Regulator.

When powering the device via usb via my laptop the ethernet works first time everytime, i can ping it and the webserver sketch works as expected.

When powering the etherten via a USB wallwart (Targus APA16AU 5v 2.1A) OR by the POE
Regulator the ethernet will not come up when powering on the device(Cant ping arduino, and webserver doesnt respond to requests). However pressing the reset button once powered up seems to fix the problem and the ethernet becomes available. Once powered off and on again the ethernet report no longer responds until the reset button is pressed again.

Out of curiosity i put an led and resistor between pin 9 and GND and merged the LED Blink example and the WEB Server example for some testing.
The sketch seems to be running fine regardless of the ethernet port working or not. (e.g. the led blinks fine so the sketch is running.)
Last edited by TheBorgkollektiv on Wed Feb 18, 2015 11:44 pm, edited 1 time in total.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: No Ethernet on first boot

Post by angusgr » Wed Feb 18, 2015 6:13 am

Hi,

I can't think of an initial explanation for this one. Do you have a multimeter handy? If so can you please measure the voltage between the 5V pin and ground, to confirm it's 5V in all cases?

No chance your sketch is expecting Serial input for any reason?

Angus

TheBorgkollektiv
Posts: 4
Joined: Tue Feb 17, 2015 9:59 pm

Re: No Ethernet on first boot

Post by TheBorgkollektiv » Wed Feb 18, 2015 9:13 pm

powered off targus charger
5v pin = 4.6
3v3 pin = 2.9
vin pin= 4.07

Powered off POE switch
5v pin = 5
3v3 pin = 3.2
vin pin = 9.9
Attempted to ping after taking these readings, no reply.
hit the reset button and replies started coming through, retested those voltages again afterwards and they were the same.
The sketch i'm using for testing (again just a combo of the led blink sketch and the webserver sketch)

Code: Select all

#include <SPI.h>
#include <Ethernet.h>


byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xE3};
IPAddress ip(172, 16, 0, 100);

const int ledPin =  9;
int ledState = HIGH;
unsigned long previousMillis = 0;
const long interval = 1000;

EthernetServer server(80);

void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);  

  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
  digitalWrite(ledPin, ledState);
}


void loop() {
     unsigned long currentMillis = millis();
 
  if(currentMillis - previousMillis >= interval) {
	previousMillis = currentMillis;
	ledState = ledState == LOW ? HIGH : LOW;
    digitalWrite(ledPin, ledState);
	}
    
  EthernetClient client = server.available();
  if (client) {
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (c == '\n' && currentLineIsBlank) {
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
            int sensorReading = analogRead(analogChannel);
            client.print("analog input ");
            client.print(analogChannel);
            client.print(" is ");
            client.print(sensorReading);
            client.println("<br />");
          }
          client.println("</html>");
          break;
        }
        if (c == '\n') {
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          currentLineIsBlank = false;
        }
      }
    }
    delay(1);
    client.stop();
  }
}


angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: No Ethernet on first boot

Post by angusgr » Wed Feb 18, 2015 10:32 pm

Thanks for verifying that. The Targus numbers are slightly low but probably OK, however the PoE reg numbers are perfect so if it's still a problem in that case then it's not low voltage.

I'm afraid I can't think of anything else to test. Is anything else different in the test setup between connecting via USB and via PoE/charger? Is the USB test result the same if you don't open the Serial Monitor program?

Angus

TheBorgkollektiv
Posts: 4
Joined: Tue Feb 17, 2015 9:59 pm

Re: No Ethernet on first boot

Post by TheBorgkollektiv » Wed Feb 18, 2015 11:28 pm

Nice diagnostic step.
If i power the device from the laptop without running Arduino software/serial monitor the device doesn't respond to pings. I had forgotten that serial monitor resets the device.

Ok so we have narrowed it down to "Regardless of power source, the device will run the sketch on first boot but the Ethernet is unresponsive, once pressing reset the device operates normally"

TheBorgkollektiv
Posts: 4
Joined: Tue Feb 17, 2015 9:59 pm

Re: No Ethernet on first boot

Post by TheBorgkollektiv » Wed Feb 18, 2015 11:43 pm

Solved. i just read the "Ethernet Reset IC Delay" section of the quick start guide. sure enough adding a delay(50) has solved the problem.
Thanks for you help Angus!
Regards
The Borg.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: No Ethernet on first boot - SOLVED

Post by angusgr » Sun Feb 22, 2015 10:45 pm

Hi Borg,

Glad you got it working. Sorry I didn't think of this problem (the power-on-reset) myself. I've added a more prominent note to the various Ether boards' quick start guides.


Angus

Post Reply