Skip to content

Add support for WPA-Enterprise #3195

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Chasethechicken
Copy link

Adds options to the WiFi settings, to enable connecting to an enterprise WiFi.

Screenshot WiFi Settings Screenshot WiFi Settings

WPA-Enterprise on ESP32 needs [env:esp32dev_V4_dio80] for a recent Arduino Core, so is disabled for other ESP32 targets.

Tested using an ESP32. Should also work for ESP8266.

Currently only supports Identity and Password on ESP8266 and Anonymous Identity, Identity and Password on ESP32.

Thanks to

Fixes #2749

Copy link
Collaborator

@blazoncek blazoncek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution. It will be a great addition for WLED.

Still, I would like the two issues somehow justified or changed prior to merging. We constantly fight low memory condition on ESP8266 se any and all PRs should be mindful of restrained RAM on ESP8266.

wled00/wled.h Outdated
@@ -284,7 +299,11 @@ WLED_GLOBAL char ntpServerName[33] _INIT("0.wled.pool.ntp.org"); // NTP server

// WiFi CONFIG (all these can be changed via web UI, no need to set them here)
WLED_GLOBAL char clientSSID[33] _INIT(CLIENT_SSID);
WLED_GLOBAL char wifiEncryptionType[2] _INIT("0");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why character string? Why not just uint8_t?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now a byte with definitions for WIFI_ENCRYPTION_TYPE_PSK and WIFI_ENCRYPTION_TYPE_PSK.

wled00/wled.h Outdated
WLED_GLOBAL char clientPass[65] _INIT(CLIENT_PASS);
WLED_GLOBAL char enterpriseAnonymousIdentity[65] _INIT(ENTERPRISE_ANONYMOUS_IDENTITY);
WLED_GLOBAL char enterpriseIdentity[65] _INIT(ENTERPRISE_IDENTITY);
WLED_GLOBAL char enterprisePass[65] _INIT(ENTERPRISE_PASS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reuse clientPass? Consuming 180 bytes of RAM is quite stressful on ESP8266.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I am now reusing clientPass.

@Chasethechicken Chasethechicken marked this pull request as draft May 4, 2023 13:38
@Chasethechicken
Copy link
Author

Thank you for the quick review.
I have converted this to a Draft for now, because I think I will be able to test this on an ESP8266 next week.

@blazoncek
Copy link
Collaborator

Please don't force-push your changes. It makes reviewing changes so much harder.

@blazoncek
Copy link
Collaborator

Hi. Any news or updates?
I bet there are several users waiting to get a hand on this. 😄

@blazoncek blazoncek added connectivity Issue regarding protocols, WiFi connection or availability of interfaces waiting for feedback addition information needed to better understand the issue labels Aug 21, 2023
@davidmonro
Copy link

I can test this on both ESP32 and ESP8266 if you can do a build.

@davidmonro
Copy link

OK so I built Chasethechicken:wpa-enterprise for a lolin s2 mini, and it seems to work.

I tried building it for d1_mini, and I get the following from my radius server:

Oct 25 22:07:52 infrapi radiusd[22331]: (711) eap: WARNING: !!! We requested to use an EAP type as normal.
Oct 25 22:07:52 infrapi radiusd[22331]: (711) eap: WARNING: !!! The supplicant rejected that, and requested to use the same EAP type.
Oct 25 22:07:52 infrapi radiusd[22331]: (711) eap: WARNING: !!!     i.e. the supplicant said 'I don't like X, please use X instead.
Oct 25 22:07:52 infrapi radiusd[22331]: (711) eap: WARNING: !!! The supplicant software is broken and does not work properly.
Oct 25 22:07:52 infrapi radiusd[22331]: (711) eap: WARNING: !!! Please upgrade it to software that works.

Now when I configured an esphome device with a d1_mini in it, I got the same message, but it did actually work; for the WLED build, it doesn't work.

I then tried cherry-picking the commit on top of v0.14.0, and building for the s2_mini - and it didn't work. Allowed me to configure it, but then I got the following from radius:

Oct 25 08:43:20 infrapi radiusd[22331]: (411) eap: ERROR: rlm_eap (EAP): Aborting! More than 50 roundtrips made in session with state 0x297d58461bad4d3e

So clearly my attempt to port it forward was not successful :-(

@blazoncek blazoncek added the keep This issue will never become stale/closed automatically label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connectivity Issue regarding protocols, WiFi connection or availability of interfaces keep This issue will never become stale/closed automatically waiting for feedback addition information needed to better understand the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WPA2 Enterprise Support
3 participants