-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Trying to connect to WPA-PEAP without success #3442
Comments
You are trying to use wpa2 enterprise, which I believe isn't yet fully
operational in the espressif SDK. Until there is a definitive fix from
them, the core won't be able to formally support it.
There have been some success stories with workarounds and hacks, though,
but also some fails with those same tricks.
If you want to try them, just search the issue tracker for wpa2 enterprise.
…On Jul 20, 2017 1:17 PM, "rjorod" ***@***.***> wrote:
Basic Infos Hardware
Hardware: ?ESP-12E
Core Version: Using git commit 7f6daa2
<7f6daa2>
Description
Trying to connect to WPA-PEAP without success
Settings in IDE
Module: NodeMcu 1.0 (ESP-12E)
Flash Size: 4MB/
CPU Frequency: 80Mhz
Upload Using: SERIAL
Sketch
extern "C" {
#include "user_interface.h"
#include "wpa2_enterprise.h"
}
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
// SSID to connect tostatic const char* ssid = "SSID";// Username for authentificationstatic const char* username = "username";// Password for authentificationstatic const char* password = "password";const int ledPin = 0;// --------------------------------------------------------------void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
Serial.print("Tryingonnect to ");
Serial.println(ssid);
wifi_station_disconnect();
struct station_config wifi_config;
memset(&wifi_config, 0, sizeof(wifi_config));
strcpy((char*)wifi_config.ssid, ssid);
strcpy((char*)wifi_config.password, password);
wifi_station_set_config(&wifi_config);
wifi_station_set_wpa2_enterprise_auth(1);
wifi_station_set_enterprise_username((uint8*)username, strlen(username));
wifi_station_set_enterprise_password((uint8*)password, strlen(password));
wifi_station_connect();
Serial.print("Status: ");
Serial.println(wifi_station_get_connect_status());
// Wait for connection AND IP address from DHCP
while (WiFi.status() != WL_CONNECTED) {
delay(2000);
Serial.println(WiFi.localIP());
}
} // setup
// ---------------------------void loop() {
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3442>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQC6Bt2lTqwoO0DY0aeQ4n8mYe6N_Oecks5sP4uagaJpZM4OeacB>
.
|
There is a bug in the ESP8266 firmware. We are waiting for ExpressIf to fix it. |
I was able to get this working using the 2.4.0 esp8266 Arduino environment and using this code:
Note in particular the addition of clearing the certificates and setting the identity. |
@duncandrennan Have you tried it with 2.4.1? Playing with eduroam in my university, as well as another wpa2 network with user and password, I have been trying all sorts of things, including what you mentioned, and it never seems to get an IP, keeps on disconnect, scandone, wifi evt:1, etc and loops I can try going back to 2.4.0 but just wanted to check if it indeed was the version. |
@kapyaar I had this working at a customer's premises with their WPA enterprise setup. I then tried to replicate the setup in our lab and have the ESP8266 crashing for all the different ways I can set up the RADUIS server (I'm testing with TekRADUIS on Windows). I think (suspect) there is something with the certificates that it doesn't like in my lab setup. It looks like the server is using EAP-MS-CHAP-V2 and it is exchanging some certificates. Possibly specifying the certificates correctly on the ESP8266 would solve the problem (I'm just not sure exactly what needs to be specified). I'm waiting for feedback on the customers exact network setup, but I think it may be EAP-PAP, which wouldn't send a certificate for authentication. I did try with 2.4.1 but had the same issue in our lab setup. |
@duncandrennan thanks very much for the info. I have ordered a router that has eap support, and I plan to test with ironwifi Radius as a service provider. Atleast this way, I could hopefully see logs on the router where as all my tests so far were blind shots into the dark as I have no access to the router side. |
@kapyaar I did a check on the heap memory before connecting (for this exact reason), and it was about 32k.
One thing I was confused about was the reset cause that it displays after the crash - it shows reset cause 2 which is a pin reset, which is definitely not the case. One other thing: the RADUIS server logs appeared to show the the authentication was successful. |
@duncandrennan ok, so that's not the issue then. My Debug looked like below. I will update once I get the EAP router . SDK:2.2.1(cfd48f3)/Core:2.4.1/lwIP:2.0.3(STABLE-2_0_3_RELEASE/glue:arduino-2.4.1) |
@kapyaar Could you please send me the code which outputs the extra wifi debugging info from the ESP8266? I haven't looked at the events and I would like to see where the ESP8266 gets to before it crashes. |
@duncandrennan #4698 I got the router, and tried it. I posted my findings in this thread too. It looks like there is definitely something with the core that is not doing its job, as when I look at the radius server logs, there is some info missing when ESP is connecting. |
hello guys! nothing new on this issue? i have been trying all sort of magic and mojo i found on the web, but the feather HUZZAH ESP8266 seem to not connect to the WiFi network here (EAP-PEAP)... o have this logs on the serial port...
Did someone have an advice? i'm stuck on this since two days, trying to figure out what's wrong and reading the non os SDK2 API reference ... Any help will be reeeally appreciated, thanks! |
@edyradice Not much inputs coming from the forum as far as I can tell. Have been beating my head to the wall far too long on this. One thing you can do is to see if you can access the radius server logs and find out what is the reason for the reject |
It's probably never going to work until they fix this: https://bbs.espressif.com/viewtopic.php?f=66&t=5962&p=15165 (edit: fixed link to point to the right bug) |
so frustrating... it's probably some sdk issue, i have been following all their informations and examples but nothing works.... BAH! anyway, thanks for the advices and replies @kapyaar and @victorclaessen !! that was my first post in here! |
@edyradice May be those of us interested parties can hold a candle vigil infront of espressif HQ :P |
@edyradice: Every voice we can add to the plea for ExpressIf to finally fix WPA2-Enterprise is very welcome. Thanks for your post. |
@victorclaessen i've been reading that the ESP32 module is working hassle free (https://github.com/JeroenBeemster/ESP32-WPA2-enterprise/blob/master/ESP32_WPA2enterprise.ino) .. maybe this is the reason they're not working to solve issue on the ESP12 module (ESP8266)? sounds like this to me... :( |
Hello together, |
Works with 2.5.0-beta2 for me, but not 2.4.1, at last I can get my IoT devices onto their own VLAN. Thanks everyone! Simplified sketch;
|
Create PIO sample project based on https://github.com/jtuttas/ESP8266-WPA2-Enterprise and @jmccoy555 comment. You can find it here https://github.com/beta-tank/ESP8266-WPA2-Enterprise-PEAP-demo |
@beta-tank @jmccoy555 what kind of wpa2 enterprise network did you test with? I am trying same code with a tplink router and ironwifi radius server. but cannot connect. |
@kapyaar UniFi and freeradius; works with both users entered in the user file and authenticating against Active Directory. |
@kapyaar all I know about the tested network, that it is using Active Directory for user authentication. |
Just to be clear; it still doesn't work on eduroam, because we can't control the authentication mechanism and expressif won't fix their bug. |
We will have to switch SDK eventually |
This works for me with the "wpa2_enterprise.h" file in the same forlder of teh sketch
|
Hello, everyone! I'm fairly new to the whole microcontroller hobbyist scene. And am trying to use PEAP on a movement senzor connected to a NodeMCU v3 with ESP8266 (ESP-12E) that sends email notifications to IFTTT. @zhampu, could you please tell me the exact setup that you have? I'm using your exact sketch and the two h files in the same folder as the sketch. Plus the other h files that the "user_interface.h" refers to with "include". Yet my device keeps reseting in a loop. You can see what I get in the serial monitor below. 12:47:38.484 -> Waiting for connection and IP Address from DHCP |
Just something for you to try. Can you update your code between wpa2 start and end to.
And see if it makes any difference? This is only aimed at the crash issue. Wpa2 success is an entirely different nightmare :) |
Thanks! Unfortunately it doesn't seem to work. Still not connecting. Keeps
waiting for IP. But no more crashes.
Meanwhile, I've gone back to my own sketch, where I integrated the WPA2
code.
Could it be that I have an older version of the firmware on my NodeMcu?
Should I post my entire sketch here?
On 16 Mar 2019 17:22, "kapyaar" <[email protected]> wrote:
Just something for you to try. Can you update your code between wpa2 start
and end to.
// WPA2 Connection starts here
// Setting ESP into STATION mode only (no AP mode or dual mode)
// wifi_set_opmode(STATION_MODE);
WiFi.mode(WIFI_STA);
struct station_config wifi_config;
memset(&wifi_config, 0, sizeof(wifi_config));
strcpy((char*)wifi_config.ssid, ssid);
wifi_station_set_config(&wifi_config);
wifi_station_clear_cert_key();
wifi_station_clear_enterprise_ca_cert();
wifi_station_set_wpa2_enterprise_auth(1);
wifi_station_set_enterprise_identity((uint8*)username, strlen(username));
wifi_station_set_enterprise_username((uint8*)username, strlen(username));
wifi_station_set_enterprise_password((uint8*)password, strlen(password));
wifi_station_connect();
// WPA2 Connection ends here
And see if it makes any difference? This is only aimed at the crash issue.
Wpa2 success is an entirely different nightmare :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3442 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AuXfKr8BASmod8Ui4P_2rSd_fg_h3Ddvks5vXQw0gaJpZM4OeacB>
.
|
Like I said, the above change was only meant to stop the crash. Connection could be a myriad of things, starting with teh fact that wpa2 enterprise library is not an all inclusive one in the sense that it only works what espressif has chosen. Here is my 2 cents. #4853 (comment) You can refer to that full discussion for more info :) |
Hi, I also have trouble using PEAP authentication.
Serial output:
In attachment some wireshark capture |
I am using a ESP8266 NodeMCU ESP -12E Module.
Any pointers would be helpful. |
This link doesnt work for me |
Copy and paste visualized text
|
It's on purpose otherwise a link to here would have appeared there. And I don't want to stress them out, given the time and the number of times we've asked that to them. The link in there states that it was planned for release 3.2, which just happened to come out. If there are some comments or 👍 there to show them I'm not the only one waiting for this - and I know it's true - they may put more efforts on what was initially planned for v3.2. If they do so, it would be a good reason to try to move from nearly EOL nonos-sdk to this supported firmware. |
Can you add in anywhere in because (and I'm not saying it will work)
|
Hi @d-a-v
|
Thanks alot for testing this. How is configured your AP ? @nayanashettyft Can you give |
Security Mode: WAP2-Enterprise/PEAP BTW using an ESP32 based board I managed to connect to the same network (code is a bit different):
|
I am able to connect and receive IP address on my college enterprise-PEAP wifi network and but it goes into boot loop. |
Basic Infos
Hardware
Hardware: ESP-12E
Core Version: Using git commit 7f6daa2
Description
Trying to connect to WPA-PEAP without success
Settings in IDE
Module: NodeMcu 1.0 (ESP-12E)
Flash Size: 4MB
CPU Frequency: 80Mhz
Upload Using: SERIAL
Sketch
The text was updated successfully, but these errors were encountered: