Closed dfmcwhir closed 3 years ago
I had it working for around 1 year with this code:
#include <WiFi.h>
#include <WiFiClientSecure.h>
#include "esp_wpa2.h"
#include "esp_wifi.h"
...
WiFi.disconnect(true); //disconnect form wifi to set new wifi connection
WiFi.mode(WIFI_STA); //init wifi mode
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_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT(); //set config settings to default
esp_wifi_sta_wpa2_ent_enable(&config); //set config settings to enable function
WiFi.begin("eduroam"); //connect to wifi
but with it stopped working with #4996 changing to:
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();
WiFi.begin("eduroam"); //connect to wifi
results in a successful connection, but only after the third try. (each dot is 200ms delay)
[ 841][D][esp32-hal-psram.c:84] psramInit(): PSRAM enabled
[ 989][V][WiFiGeneric.cpp:273] _arduino_event_cb(): STA Started
[ 990][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[ 990][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 2 - STA_START
...........
[ 3061][V][WiFiGeneric.cpp:290] _arduino_event_cb(): STA Disconnected: SSID: eduroam, BSSID: 00:00:00:00:00:00, Reason: 201
[ 3062][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[ 3069][W][WiFiGeneric.cpp:816] _eventCallback(): Reason: 201 - NO_AP_FOUND
[ 3077][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
.........
[ 5016][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
...........
[ 7079][V][WiFiGeneric.cpp:290] _arduino_event_cb(): STA Disconnected: SSID: eduroam, BSSID: 80:8d:XX:XX:XX:XX, Reason: 203
[ 7080][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[ 7087][W][WiFiGeneric.cpp:816] _eventCallback(): Reason: 203 - ASSOC_FAIL
[ 7095][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
.........
[ 9024][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
............
[ 11999][V][WiFiGeneric.cpp:285] _arduino_event_cb(): STA Connected: SSID: eduroam, BSSID: 80:8d:XX:XX:XX:XX, Channel: 1, Auth: WPA2_ENTERPRISE
[ 12001][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
........
[ 13740][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[ 13741][V][WiFiGeneric.cpp:290] _arduino_event_cb(): STA Disconnected: SSID: eduroam, BSSID: 80:8d:XX:XX:XX:XX, Reason: 8
[ 13751][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[ 13759][W][WiFiGeneric.cpp:816] _eventCallback(): Reason: 8 - ASSOC_LEAVE
...........
[ 15840][V][WiFiGeneric.cpp:285] _arduino_event_cb(): STA Connected: SSID: eduroam, BSSID: 80:8d:XX:XX:XX:XX, Channel: 1, Auth: WPA2_ENTERPRISE
[ 15842][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
.........
[ 17769][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[ 17770][V][WiFiGeneric.cpp:290] _arduino_event_cb(): STA Disconnected: SSID: eduroam, BSSID: 80:8d:XX:XX:XX:XX, Reason: 8
[ 17780][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[ 17788][W][WiFiGeneric.cpp:816] _eventCallback(): Reason: 8 - ASSOC_LEAVE
...........
[ 19868][V][WiFiGeneric.cpp:285] _arduino_event_cb(): STA Connected: SSID: eduroam, BSSID: 80:8d:XX:XX:XX:XX, Channel: 1, Auth: WPA2_ENTERPRISE
[ 19870][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
[ 19884][V][WiFiGeneric.cpp:295] _arduino_event_cb(): STA Got New IP:10.___.___.28
[ 19884][D][WiFiGeneric.cpp:795] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
[ 19891][D][WiFiGeneric.cpp:844] _eventCallback(): STA IP: 10.__.___.28, MASK: 255.255.240.0, GW: 10.___.___.254
Any idea?
I don't know, but I believe that this is a completely different issue that what I'm seeing. Looking through older issues that people have had connecting with Enterprise WPA2, some/most people have had success connecting with Eduroam networks like you are. Others have been completely unable Enterprise WPA2 networks at businesses like I me. It has been speculated that it is related to the business networks using Cisco switches.
The problem I am having, I have never been able to connect to my network throughout the ~1.5years have been trying with several different versions of the Arduino core. It looks like you have been historically able to connect to the Eduroam network and are still able to connect to it intermittently .
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
Hardware:
Board: ESP32 Dev Module Core Installation version: 1.06 IDE name: Arduino IDE Flash Frequency: 80mhz PSRAM enabled: no Upload Speed: 115200 Computer OS: Windows 10
Description:
Describe your problem here I'm trying to connect to a network using WPA2 Enterprise authentication (PEAP+MsChapv2) using the arduino IDE. I have been trying to do this off and on for ~1.5years. Recently I found that I can connect to my network using the Espressif IDF and Visual Studio Code (using their example code), so I'm pretty sure this something with the Arduino core. When I saw that core version had been updated to 1.06 I tried again and the results are below.
Sketch: (leave the backquotes for code formatting)
Debug Messages: