Coder Social home page Coder Social logo

Comments (4)

maxgerhardt avatar maxgerhardt commented on June 3, 2024

Addendum: This actually also fails when not giving the interrupt pin in the constructor (i.e. polling mode).

from arduino-pico.

earlephilhower avatar earlephilhower commented on June 3, 2024

This is expected behavior. Ethernet PHY status is via isLinked(), not connected() which is only looking at IP addressing. It's done this way mostly for backward compatibility. If you try:

void loop() {
  Serial.println("Ethernet connected: " + String(eth.connected()) + " isLinked:" + String(eth.isLinked()));
  Serial.print("IP address: ");
  Serial.println(eth.localIP());
  delay(1000);
}

You'll see something like

15:30:16.874 -> Starting Ethernet port
15:30:16.874 -> Ethernet connected: 0 isLinked:1
15:30:16.874 -> IP address: (IP unset)
15:30:17.866 -> Ethernet connected: 1 isLinked:1
15:30:17.866 -> IP address: 192.168.1.229
15:30:18.859 -> Ethernet connected: 1 isLinked:1
15:30:18.859 -> IP address: 192.168.1.229
15:30:19.885 -> Ethernet connected: 1 isLinked:1
15:30:19.885 -> IP address: 192.168.1.229
15:30:20.877 -> Ethernet connected: 1 isLinked:1
15:30:20.877 -> IP address: 192.168.1.229
15:30:21.871 -> Ethernet connected: 1 isLinked:0
15:30:21.871 -> IP address: 192.168.1.229
15:30:22.863 -> Ethernet connected: 1 isLinked:0
15:30:22.863 -> IP address: 192.168.1.229
15:30:23.889 -> Ethernet connected: 1 isLinked:0
15:30:23.889 -> IP address: 192.168.1.229
15:30:24.882 -> Ethernet connected: 1 isLinked:0
15:30:24.882 -> IP address: 192.168.1.229
15:30:25.875 -> Ethernet connected: 1 isLinked:0
15:30:25.875 -> IP address: 192.168.1.229
15:30:26.867 -> Ethernet connected: 1 isLinked:0
15:30:26.867 -> IP address: 192.168.1.229
15:30:27.860 -> Ethernet connected: 1 isLinked:1
15:30:27.893 -> IP address: 192.168.1.229
15:30:28.886 -> Ethernet connected: 1 isLinked:1
15:30:28.886 -> IP address: 192.168.1.229

It may be worthwhile to && isLinked into the connected() logic, though...thoughts?

from arduino-pico.

earlephilhower avatar earlephilhower commented on June 3, 2024

Oh, and the W5100 does not report PHY state, or at least the driver here doesn't know how to get that bit of info.

from arduino-pico.

maxgerhardt avatar maxgerhardt commented on June 3, 2024

Hmm then it was a API misunderstanding of mine. The connected() and isLinked functions are properly documented, in my IDE's mousehover.

from arduino-pico.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.