-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Cannot enable WPA2 Enterprise using arduino libraries #1744
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
Comments
This code is invalid. #define EAP_USERNAME "usrname"
#define EAP_PASSWORD "hunter123"
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EAP_USERNAME, strlen(EAP_USERNAME));
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)EAP_USERNAME, strlen(EAP_USERNAME));
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)EAP_PASSWORD, strlen(EAP_PASSWORD));
The define statement is just a substitution: esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)"usrname", strlen("usrname")); with this type declaration you are telling the compiler to treat the first four letters of "usrn" as the value of a pointer to a cstring of characters. the correct way would be to define a variable: const char* eap_username = "usrname";
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)eap_usernam, strlen(eap_username)); Chuck. |
Thanks for finding that bug. I have updated my original post with the revised code. However the same error persists. I am trying to follow the sample WPA2 enterprise sample |
esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
esp_wifi_sta_wpa2_ent_enable(&config); This is how #include "esp_err.h"
#include "esp_wifi_crypto_types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern const wpa2_crypto_funcs_t g_wifi_default_wpa2_crypto_funcs;
typedef struct {
const wpa2_crypto_funcs_t *crypto_funcs;
}esp_wpa2_config_t;
#define WPA2_CONFIG_INIT_DEFAULT() { \
.crypto_funcs = &g_wifi_default_wpa2_crypto_funcs \
} It looks to me that
May not have been initialized before you use it. It looks too me that you have skipped a few steps in the initialization sequence. I have no knowledge how to correctly use WPA2, so I can't be of any more help, Sorry. Chuck. |
WiFi.mode() is now required in order to init the hardware. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: Adafruit Feather ESP32
Core Installation/update date: ?8/9/2018?
IDE name: Arduino IDE and Platform.io
Flash Frequency: 80Mhz
Upload Speed: 921600
Description:
Fails on
esp_wifi_sta_wpa2_ent_enable(&config);
Sketch:
Debug Messages:
The text was updated successfully, but these errors were encountered: