-
Notifications
You must be signed in to change notification settings - Fork 7.6k
wpa2-enterprise does not work in the last arduino cores #1686
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
please decode that stack trace :) |
ok. Thanks. Decoding stack results |
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. |
Hi,
In previous arduino cores, I could connect without problem to wpa2 enterprise radius network, but with last arduino cores fails the connection with same program.
Is the same problem comented in this issue:
espressif/esp-idf#2181
When I call "WiFi.begin(ssid)" the ESP32 try to connect, but a Stack smashing protect failure error occurs.
I tested it on ESP-WROOM-32 and ESP-WROVER default profile with same result.
Program works great until "2018-06-24 14:59:16" arduino core update. From "2018-06-27 09:06:02" update until the last Arduino core update the program fails with same error.
Analizing the Arduino core code, this error is shown when function "esp_wifi_connect()" is executed inside function:
wl_status_t WiFiSTAClass::begin(const char* ssid, const char passphrase, int32_t channel, const uint8_t bssid, bool connect)
in "WiFiSTA.cpp" file
This is the error message with Backtrace:
Connecting to network: Uni-Net
Mode: STA
Channel: 1
SSID (7): Uni-Net
Passphrase (0):
BSSID set: 0
.
Stack smashing protect failure!
abort() was called at PC 0x400ea028 on core 1
Backtrace: 0x4008f6f4:0x3ffbb6e0 0x4008f8f7:0x3ffbb700 0x400ea028:0x3ffbb720 0x400de649:0x3ffbb740 0x400de6f6:0x3ffbb800 0x400db587:0x3ffbb840 0x400db9c2:0x3ffbb880 0x400da7a9:0x3ffbb8a0 0x400da1cc:0x3ffbb8f0 0x400da239:0x3ffbb930 0x400d8c37:0x3ffbb950 0x400d8e39:0x3ffbb990 0x400d7f8d:0x3ffbb9b0 0x400e79aa:0x3ffbba30 0x400e7c36:0x3ffbba60
Rebooting...
This is my program. It is a modified version of "WiFiClientEnterprise.ino" example from Arduino core:
//Sketch edited by: Martin Chlebovec
//Personal website: https://arduino.php5.sk
#include "esp_wpa2.h"
#include <WiFi.h>
#define EAP_IDENTITY "[email protected]" //eduroam login --> [email protected]
#define EAP_PASSWORD "blablablabla" //your Eduroam password
String line; //variable for response
const char* ssid = "Uni-Net"; // Eduroam SSID
const char* host = "arduino.php5.sk"; //external server domain for HTTP connection after authentification
int fault=0;
void setup() {
fault=128;
WiFi.mode(WIFI_STA);
Serial.begin(115200);
delay(10);
Serial.println();
Serial.print("Connecting to network: ");
Serial.println(ssid);
WiFi.disconnect(true); //disconnect form wifi to set new wifi connection
WiFi.printDiag(Serial);
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
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 to default (fixed for 2018 and Arduino 1.8.5+)
esp_wifi_sta_wpa2_ent_enable(&config); //set config to enable function (fixed for 2018 and Arduino 1.8.5+)
WiFi.begin(ssid); //connect to Eduroam function
WiFi.setHostname("PINGER"); //set Hostname for your device - not neccesary
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
delay(6000);
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address set: ");
Serial.println(WiFi.localIP()); //print LAN IP
}
void loop() {
delay(5000);
if (WiFi.status() != WL_CONNECTED) { //if we lost connection, retry
WiFi.begin(ssid);
delay(500);
}
Serial.print("Connecting to website: ");
Serial.println(host);
WiFiClient client;
if (!client.connect(host, 80)) { // HTTP connection on port 80
Serial.println("Connection lost! - Failed response");
}
String url = "/rele/rele1.txt"; //read .txt file
Serial.print("Requesting URL: ");
Serial.println(url);
client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "Connection: close\r\n\r\n");
unsigned long timeout = millis();
while (client.available() == 0) {
if (millis() - timeout > 5000) {
Serial.println("Client timed out! - retry");
}
}
while(client.available()) {
line = client.readStringUntil('\n');
Serial.println(line);
}
Serial.println();
Serial.println("End connection");
client.stop();
}
The text was updated successfully, but these errors were encountered: