-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/i2s_sr
- Loading branch information
Showing
9 changed files
with
399 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,11 @@ | |
/*|----------------------------------------------------------|*/ | ||
#include <WiFi.h> | ||
#include <HTTPClient.h> | ||
#if __has_include ("esp_eap_client.h") | ||
#include "esp_eap_client.h" | ||
#else | ||
#include "esp_wpa2.h" | ||
#endif | ||
#include <Wire.h> | ||
#define EAP_IDENTITY "identity" //if connecting from another corporation, use [email protected] in Eduroam | ||
#define EAP_PASSWORD "password" //your Eduroam password | ||
|
@@ -42,10 +46,17 @@ void setup() { | |
Serial.println(ssid); | ||
WiFi.disconnect(true); //disconnect form wifi to set new wifi connection | ||
WiFi.mode(WIFI_STA); //init wifi mode | ||
#if __has_include ("esp_eap_client.h") | ||
esp_eap_client_set_identity((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide identity | ||
esp_eap_client_set_username((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide username | ||
esp_eap_client_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); //provide password | ||
esp_wifi_sta_enterprise_enable(); | ||
#else | ||
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide identity | ||
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide username --> identity and username is same | ||
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); //provide password | ||
esp_wifi_sta_wpa2_ent_enable(); | ||
#endif | ||
WiFi.begin(ssid); //connect to wifi | ||
while (WiFi.status() != WL_CONNECTED) { | ||
delay(500); | ||
|
1 change: 0 additions & 1 deletion
1
libraries/WiFi/examples/WiFiClientEnterprise/WiFiClientEnterprise.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#include <WiFi.h> //Wifi library | ||
#include "esp_wpa2.h" //wpa2 library for connections to Enterprise networks | ||
#define EAP_IDENTITY "login" //if connecting from another corporation, use [email protected] in Eduroam | ||
#define EAP_USERNAME "login" //oftentimes just a repeat of the identity | ||
#define EAP_PASSWORD "password" //your Eduroam password | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,11 @@ | |
|
||
#include <WiFi.h> | ||
#include <WiFiClientSecure.h> | ||
#if __has_include ("esp_eap_client.h") | ||
#include "esp_eap_client.h" | ||
#else | ||
#include "esp_wpa2.h" | ||
#endif | ||
#include <Wire.h> | ||
#define EAP_ANONYMOUS_IDENTITY "[email protected]" //anonymous identity | ||
#define EAP_IDENTITY "[email protected]" //user identity | ||
|
@@ -64,10 +68,17 @@ void setup() { | |
Serial.println(ssid); | ||
WiFi.disconnect(true); //disconnect form wifi to set new wifi connection | ||
WiFi.mode(WIFI_STA); //init wifi mode | ||
#if __has_include ("esp_eap_client.h") | ||
esp_eap_client_set_identity((uint8_t *)EAP_ANONYMOUS_IDENTITY, strlen(EAP_ANONYMOUS_IDENTITY)); //provide identity | ||
esp_eap_client_set_username((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide username | ||
esp_eap_client_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); //provide password | ||
esp_wifi_sta_enterprise_enable(); | ||
#else | ||
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EAP_ANONYMOUS_IDENTITY, strlen(EAP_ANONYMOUS_IDENTITY)); //provide identity | ||
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)EAP_IDENTITY, strlen(EAP_IDENTITY)); //provide username | ||
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD)); //provide password | ||
esp_wifi_sta_wpa2_ent_enable(); | ||
#endif | ||
WiFi.begin(ssid); //connect to wifi | ||
while (WiFi.status() != WL_CONNECTED) { | ||
delay(500); | ||
|
Oops, something went wrong.