Skip to content
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

Feature request: button to turn off Ethernet in E32 #1167

Closed
bbqkees opened this issue May 3, 2023 · 6 comments
Closed

Feature request: button to turn off Ethernet in E32 #1167

bbqkees opened this issue May 3, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@bbqkees
Copy link
Contributor

bbqkees commented May 3, 2023

The E32 and some other boards use a GPIO pin (16 for E32) to turn on (the oscillator of) the Ethernet chip.
Lot's of E32 owners use only WiFi, so in those cases it can be beneficial to turn off Ethernet to save some of the precious RAM.

Currently you can turn it off by selecting a custom board profile and deselect the Ethernet NIC.
An on/off or checkmark button would be more convenient here.

@proddy proddy added the enhancement New feature or request label May 3, 2023
@proddy
Copy link
Contributor

proddy commented May 3, 2023

when EMS-ESP starts up it will always load the Eth library and tries to connect (costing RAM) to see if the ethernet is connected, so plug&play with an E32 works first time. But with this addition, it'll save memory so a good thing to implement.

@MichaelDvP
Copy link
Contributor

We disable Wifi by leaving ssid blank, why not use the same logic?
Enable eth is wifi-ssid is blank and wifi is disabled, disable eth if wifi is enabled.
The network status page already shows only one connection and two active connections cost a lot of ram.
This is only a text change: NETWORK_BLANK_SSID: 'leave blank to disable WiFi and enable ETH', and some lines in system::netowrk_init()

    bool disableEth;
    EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & settings) {
        disableEth = settings.ssid.length() > 0;
    });

    // no ethernet present or disabled
    if (phy_type_ == PHY_type::PHY_TYPE_NONE || disableEth) {
        return;
    }

I think most users will not recognize an extra checkbox and leave it on default.

@proddy
Copy link
Contributor

proddy commented May 5, 2023

that will work, and prevent the costly ETH.begin() from being called in WebSettings::update()

@MichaelDvP
Copy link
Contributor

Hmm, the ETH.begin in WebSettings is only called if load_board_profile failed: once on the first start. Then the board profile is set to E32 or S32 and this fallback is never executed again (only after factory reset). With board profile set the ETH.begin is only called in system::network_init., where the above ssid check prevents it.

@bbqkees
Copy link
Contributor Author

bbqkees commented May 8, 2023

Enable eth is wifi-ssid is blank and wifi is disabled, disable eth if wifi is enabled.

That will work as well indeed.

@proddy
Copy link
Contributor

proddy commented May 27, 2023

this is in dev12

@proddy proddy closed this as completed May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants