Git Product home page Git Product logo

Comments (6)

JAndrassy avatar JAndrassy commented on August 15, 2024

do you have some test sketch?

from arduinocore-mbed.

Goliath86 avatar Goliath86 commented on August 15, 2024

Even the basic OPTA LinkStatus example:

/*
  Link Status
  This sketch prints the ethernet link status. When the
  ethernet cable is connected the link status should go to "ON".
  NOTE: Only WizNet W5200 and W5500 are capable of reporting
  the link status. W5100 will report "Unknown".
  Hardware:
   - Ethernet shield or equivalent board/shield with WizNet 5200/5500
  Written by Cristian Maglie
  This example is public domain.
*/

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

void setup() {
  Serial.begin(9600);
}

void loop() {
  auto link = Ethernet.linkStatus();
  Serial.print("Link status: ");
  switch (link) {
    case Unknown:
      Serial.println("Unknown");
      break;
    case LinkON:
      Serial.println("ON");
      break;
    case LinkOFF:
      Serial.println("OFF");
      break;
  }
  delay(1000);
}

from arduinocore-mbed.

JAndrassy avatar JAndrassy commented on August 15, 2024

it only works after Ethernet.begin, because that starts the network interface

from arduinocore-mbed.

Goliath86 avatar Goliath86 commented on August 15, 2024

So the example is not working "out of the box". I will try after the Ethernet.begin() function and I will post here the result. Thanks for the help

from arduinocore-mbed.

JAndrassy avatar JAndrassy commented on August 15, 2024

the example is copied from the Ethernet library for Wiznet chips but there too linkStatus will work only after begin

from arduinocore-mbed.

Goliath86 avatar Goliath86 commented on August 15, 2024

@JAndrassy you were right: after the Ethernet.begin() function (successfully or not) the Ethernet.linkStatus() function works as intended. Thank you

from arduinocore-mbed.

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.