Skip to content

Fix Ethernet library link status and missing functionality with recent IDF versions #7593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

ppescher
Copy link
Contributor

Description of Change

The variable eth_link was never updated, so it was always reporting link down.
Proposed fix is to use the status bits managed by WiFi callbacks, that are updated correctly.
Link duplex mode did not have an implementation for IDF versions > 3 and actually the version check was done incorrectly with the preprocessor.
Proposed fix is using the same ioctl mechanism as for the link speed.

Tests scenarios

Tested with PlatformIO and the latest stable release 2.0.5 on a custom hardware using LAN8710 and LAN8740.

Related links

Closes #6105

@me-no-dev
Copy link
Member

Thanks @ppescher for the fix!

@me-no-dev me-no-dev added this to the 2.0.6 milestone Dec 15, 2022
@TD-er
Copy link
Contributor

TD-er commented Dec 18, 2022

Just tested this and it seems to be working fine.
Ethernet connected state is reliable again and also the reported network speed/mode is working fine.

I did test by plugging and re-plugging a number of times and also by selecting the Ethernet link mode on the switch.
Half-duplex, Full duplex and auto is all reported fine. Also 10 vs. 100 Mbps link speed.

However, 10 Mbps half-duplex is not really usable as it seems to loose quite a lot of packets.
But I doubt anyone will ever use that again these days.
When the speed gets limited from the ESP side of the connection, you probably have other issues like unstable voltage to the ESP.

TL;DR
A think this should be merged.

@me-no-dev me-no-dev merged commit 72e79f0 into espressif:master Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

ESP32 ETH.h linkUp never reports true
5 participants