-
Notifications
You must be signed in to change notification settings - Fork 13.3k
2.4-rc2 crash while connecting to WPA2 Enterprise (Eduroam) #3842
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
Can you please tell me if you solved it? |
I can confirm that this code works in v2.4.0. For future reference to people finding this from google: use edit: it appears to work one time, but when you reset the chip, it will take a very long time to connect or even never connect at all. Also when the password is wrong, it will just attempt to connect indefinetly as WiFi.status() will keep returning WL_DISCONNECTED. |
@L0laapk3 do you mean that the sketch in the original post works for you? |
send us sketch please. |
The sketch is literally in the first post lol. I had it work somewhat consistently provided I power down the chip for a minute before I try to connect. When I reset the chip it would fail almost every time. Need to do some additional testing to confirm that this is an issue with the underlying code and not some weird local wifi issue. |
hi, my version is sdk 2.2.1/ core 2.4.1 , i tried connecting to my school network but still get errors: SDK:2.2.1(cfd48f3)/Core:2.4.1/lwIP:2.0.3(STABLE-2_0_3_RELEASE/glue:arduino-2.4.1) Connecting to NTUSECURE Exception (3): ctx: sys
ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 1384, room 16 Anyone got any idea how to fix this? |
Hi,
I try to connect the ESP8266 with eduroam with the new 2.4-rc2 (build d1e8fe9) Arduino lib pulled via git as in the descriptions. The code connects to Eduroam as I can see connections results in our university log (only one line, sorry no output of log from radius). At some point, I get a crash and an error stack. I paste the code and the error stack below.
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
#include "wpa2_enterprise.h"
}
// SSID to connect to
char ssid[] = "eduroam";
char wlpasswd[] = "";
char username[] = "--------------------";
char identity[] = "------------------";
char password[] = "-------------";
char new_password[] = "-----------";
const char* host = "ipinfo.io";
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
wifi_station_set_wpa2_enterprise_auth(1);
// Clean up to be sure no old data is still inside
wifi_station_clear_cert_key();
wifi_station_clear_enterprise_ca_cert();
wifi_station_clear_enterprise_identity();
wifi_station_clear_enterprise_username();
wifi_station_clear_enterprise_password();
wifi_station_clear_enterprise_new_password();
wifi_station_set_enterprise_identity((uint8*)identity, strlen(identity));
wifi_station_set_enterprise_username((uint8*)username, strlen(username));
wifi_station_set_enterprise_password((uint8*)password, strlen(password));
wifi_station_set_enterprise_new_password((uint8*)new_password, strlen(new_password));
//wifi_station_set_enterprise_ca_cert(ca_pem, ca_pem_len);
WiFi.begin(ssid, wlpasswd);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
}
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
delay(5000);
Serial.print("connecting to ");
Serial.println(host);
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}
client.print(String("GET ") + "/ip" + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
delay(500);
while(client.available()){
String line = client.readStringUntil('\r');
Serial.print(line);
}
return;
}
The console result reads:
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0
Connecting to eduroam
....
Exception (28):
epc1=0x4000df60 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: sys
sp: 3ffffd70 end: 3fffffb0 offset: 01a0
3fffff20: 40223496 0ee83a2c 2300baa7 d02739eb
3fffff30: 40225346 5060d027 3fff0007 00000000
3fffff40: 3fff211c 4021cd6f 3ffee130 3ffec92c
3fffff50: 3ffec92c 0000002e 00000000 00000035
3fffff60: 00000002 0000001a 40230caf 3ffee130
3fffff70: 3ffec920 3fffdcc0 3ffea7c0 3ffea7c0
3fffff80: 00000080 3ffee130 00000000 3fffdcc0
3fffff90: 4023058b 3fffdab0 00000000 402035c3
3fffffa0: 3ffea7c0 40000f49 3fffdab0 40000f49
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode:(1,6)
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
And the decoded error stack reads:
Decoding 9 results
0x402187f9: ieee80211_decap at ?? line ?
0x40223496: wpa_set_pmk at ?? line ?
0x40225346: wpa2_sm_rx_eapol at ?? line ?
0x4021cd6f: sta_input at ?? line ?
0x40230caf: pp_tx_idle_timeout at ?? line ?
0x4023058b: ppPeocessRxPktHdr at ?? line ?
0x402035c3: loop_task at /opt/arduino-1.8.5/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_main.cpp line 57
Anybody some ideas, if I make something wrong?
The text was updated successfully, but these errors were encountered: