Ethernet improvements

I’m looking to move entirely away from WiFi, to an ethernet-only configuration.

As ethernet support is relatively new, there’s a feature gap between it and WiFi. Here are some of the things I want to ensure work / have parity with WiFi:

  1. Support for specifying IP, netmask, gateway, DNS
  2. Updating configuration pages to provide first-class support for ethernet settings
  3. Validation that things “work right” when only ethernet is enabled
  4. Verification that things “work right” when both ethernet and WiFi are enabled and connected to networks, but only one of them connects to the internet

Interest? I’d love help on the config UI updates, especially…

1 Like

Hey! :slight_smile:
In my opinion, there is no feature gap between Ethernet support and WiFi.
Every WLED feature is just as usable as with using WiFi (or more, thanks to the increased bandwidth and reliablility)
Static IP for Ethernet is specified in the same fields it is for WiFi.

I agree about your points 2 and 4 however, e.g. it might not be immediately clear that some settings apply to ethernet as well. Additionally, changing the IP might require a reboot for Ethernet, which it does not for WiFi.

Especially the interoperability between WiFi and Ethernet is currently a bit problematic. I do not recommend entering WiFi credentials if Ethernet is used, while the device should fallback to WiFi if ethernet is unavailable, such behavior is not (yet) explicitely implemented/

Hi Aircookie,

Having the same IP address on two interfaces is likely (at least one) source of problem if both WiFi and ethernet are simultaneously enabled. There are reasons most DHCP servers don’t allow a single IP address to be reserved to more than one MAC address (e.g., causing network problems due to ARP table issues).

I really would not suggest configuring a device with two interfaces having a single IP address. Rather, each interface should be configurable with distinct network settings.

If it’s enforced that only one of the WiFi or Ethernet (but never both, maybe with a cooldown period to avoid fast flip-flop’ing) are enabled, then maybe this would be OK. The code doesn’t appear to have the plumbing in place currently, however, and that would seem more complex than just exposing the configuration of the two interfaces separately.

That is completely correct - if the two interfaces were to be simultaneously used, it would lead to an IP conflict.
However, I see no use case for a WiFi connection (at least in Client mode) while Ethernet is connected.

Perhaps moving the Ethernet type dropdown to the top of the settings page, renaming the None type to WiFi and hiding the SSID/Pass fields if an Ethernet type is selected would be a good compromise :slight_smile: UI-wise this would make it clear to the user that they should not supply credentials if they desire to use Ethernet.

First, I strongly agree that limiting to only one enabled interface is a Good Thing™, if for no other reason than due to existing code presuming there was only one network interface. Reduces complexity significantly. :trophy:

I really like your suggestions. In addition to hiding them, I’d also suggest explicitly saving the SSID/password fields as though they were empty, when ethernet is enabled (both in UI, and enforced in code). This is to prevent the saved credentials from being left around w/o being seen in UI.

EDIT – Just listing the foundation for next post, as there now appears to be agreement on the following:

  1. Only one IP interface should be active at any time.

  2. Therefore, when ethernet is enabled, WiFi should be disabled.

  3. Re-use of existing IP configuration page, where Ethernet of “None” is renamed to “Wifi”

  4. When Ethernet is enabled, SSID and Password fields are hidden from view, and saved as blank entries (aka deleted)

  5. WiFi fallback is not a general feature … but to be considered is enabling WiFi AP if the ethernet fails to initialize(*)

That’s a good foundation to start a list of tasks with…

(*) Why WiFi fallback is generally out-of-scope

It is acknowledged that it would be “nice” if WiFi could be automatically enabled if ethernet loses connectivity. However, the complexity of detecting this, is quite complex.

There are many edge cases and state transitions that would need defined actions, and not all of them have clear answers. As examples, what results …

  • … when ethernet is working, but there is no internet connectivity (which may be intentional)?
  • … when no IP address is initially obtained via DHCP initially? (e.g., if router with DHCP server is slower to boot, which is common).
  • … when ethernet is enabled, but no cable is connected?
  • … when ethernet is working, with cable being connected → disconnected → reconnected?

Even if the goal would be to revert to ethernet, there are cautions:

  • should WiFi be disabled? is disabling of WiFi a mainstream (tested) code path?
  • what to do with pending network connections?

Thus, although it may be considered in the future, it would make the feature much more complex (and less testable) to be rightfully considered in a first feature release.

But ... WiFi AP should be enabled if ethernet config fails ...

When configured to use ethernet, but ethernet configuration fails, it’s important to enable the WiFi AP (if that option is enabled in the GUI). This is to allow reconfiguration via the WiFi AP, if (for example) the wrong ethernet configuration was selected.

Since ethernet configuration occurs only once, at boot, this is a “safe” exception to the attempt to reduce the complexity of the system, and would not result in both WiFi and Ethernet being enabled simultaneously.

This would still be disabled, based on the UI setting to disable this capability.

1 Like

List of tasks to get this ready…

  1. UI, WiFi setup: Rename “Ethernet” option “None” to “Wi-Fi”
  2. UI, WiFi setup: When not set to Wi-Fi, hide following fields: SSID, wifi password
  3. UI, WiFi setup: When AP is not enabled, hide following fields: Hide AP name, AP password, Access Point WiFi Channel, AP Opens drop-down selection
  4. UI, WiFi setup: If Ethernet option is not “Wi-Fi”, ensure configuration does not include SSID / Password
  5. UI, WiFi setup: If AP is not enabled, ensure configuration does not include AP password
  6. Code: Start with at least PR 2123 merged.
  7. Code: Update Ethernet initialization to occur only at boot, and only attempted once.
  8. Code: Ensure, in setting of configuration, that SSID/WiFi password are cleared if not set to use WiFi
  9. Code: Ensure, in setting of configuration, that AP password is cleared, if AP is disabled