ESPTelnet icon indicating copy to clipboard operation
ESPTelnet copied to clipboard

Wired LAN8720 connected check / workaround / fix?

Open HotNoob opened this issue 11 months ago • 2 comments

using Eth.H / EthClass.H

which piggy backs a bit off of the wifi events a bit...

this check, which is enabled by default will stop begin from working.

https://github.com/LennartHennigs/ESPTelnet/blob/e8bfb78e3c9a5dad064fe7147736d89ba28278de/src/ESPTelnetBase.cpp#L17

#include <ETH.h>

 if ( !ETH.linkUp() &&  WiFi.status() != WL_CONNECTED && !_isIPSet(WiFi.softAPIP())) return false; 

fixes this problem, alternatively as a work around, turning the check off via bool works too.

telnet.begin(23, false);

it does require making the lib more bulky... so could maybe use this WITHOUT <ETH.h>. only compatible

#if ESP_IDF_VERSION_MAJOR > 3
...
 if ( !(WiFiGenericClass::getStatusBits() & ETH_CONNECTED_BIT) &&  WiFi.status() != WL_CONNECTED && !_isIPSet(WiFi.softAPIP())) return false; 

instead, to avoid having to import Eth.H for wifi only builds.

works fine over eth \w main for me with some small modification.

HotNoob avatar Mar 18 '24 02:03 HotNoob