Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.83k stars 3.2k forks source link

WPA2-Enterprise support? #1001

Closed EssKayz closed 3 years ago

EssKayz commented 4 years ago

Hi,

sounds like your company network is an enterprise network. Those aren't easy to connect to, currently WLED only supports home networks (WPA2-PSK). It seems like it is possible though: https://www.google.com/search?q=esp8266+enterprise+wifi

I'll keep this in mind and maybe I can add support soon! Cheers!

Originally posted by @Aircoookie in https://github.com/Aircoookie/WLED/issues/242#issuecomment-537598332

Hi! Is there currently any plans for WPA2-Enterprise to be supported? If not, I'll see if I can't jerry-rig it in my local copy somehow :)

garyd9 commented 4 years ago

I'll just leave this little block of code I inserted in initConnection() here (mostly taken from various google search results)... Oh, and it does work. On my particular network, my username must be "domain\user" instead of just "user", but it does work fine on PEAP/MSCHAPv2 (coming from an ESP32 device)

(requires "esp_wpa2.h" to be included to get at the WPA2 type and macro)

  const char *username = "MYDOMAIN\\username";
  const char *password = "mypassword";

  WiFi.disconnect(true);
  WiFi.mode(WIFI_STA);  // didn't work without this.  odd.
  esp_wifi_sta_wpa2_ent_set_username((uint8_t *)username, strlen(username));
  esp_wifi_sta_wpa2_ent_set_password((uint8_t *)password, strlen(password));
  esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
  esp_err_t code = esp_wifi_sta_wpa2_ent_enable(&config);
  Serial.print ("enable response code: ");
  Serial.println(code);
  const char *ssid = clientSSID;
  Serial.print("wifi Begin connection to: "); Serial.println(ssid);
  WiFi.begin(ssid);

To use this properly, the HTTP UI would need to prompt for an additional piece of info: a username. I just hard-coded everything to try it out. (I'm still exploring this esp32 dev board. it's fun.)

EssKayz commented 4 years ago

I eventually did manage to get it working aswell, I just had to give up on using ESP8266, and buy an ESP32. Also just ended up coding everything myself from scratch, since I decided I'll save myself some headache. Not sure if ESP8266 can even be made to work with all WPA2-Enterprise networks :)

stale[bot] commented 3 years ago

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. Thank you for using WLED!

tudi235 commented 2 years ago

Hey! I didn't managed to get it working. Can you copy paste your code under initConnection? Thanks :)