ESP8266 Developer Zone The Official ESP8266 Forum 2017-01-07T18:04:14+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2904 2017-01-07T18:04:14+08:00 2017-01-07T18:04:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2904&p=11053#p11053 <![CDATA[Re: Cannot connect to WPA2 Enterprise]]>
See https://github.com/joostd/esp8266-eduro ... /wpa2e-v20 for example code.

What is lacking in SDK v2.0 currently is:
  • a way to set the outer identity
  • a way to verify the subject name in the RADIUS server's certificate

Also, keeping the eduroam private key or user password secret is a challenge when your esp8266 module gets lost or stolen.

Statistics: Posted by joostd — Sat Jan 07, 2017 6:04 pm


]]>
2016-12-10T18:29:07+08:00 2016-12-10T18:29:07+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2904&p=10855#p10855 <![CDATA[Re: Cannot connect to WPA2 Enterprise]]> Using sdk v2.0.0 with PEAP or EAP-TTLS still seems to have issues:

- the outer identity sent by the esp8266 is "anonymous@espressif.com" (Access-Request packet with TLV User-Name = "anonymous@espressif.com") and there doesn't seem to be a documented way to change this.

- even when accepting requests within the @espressif.com realm authentication fails, eg. when using MS-CHAPv2 for inner authentication.

From my log:

Code:

[mschap] Creating challenge hash with username: john
[mschap] Told to do MS-CHAPv2 for john with NT-Password
[mschap] FAILED: MS-CHAP2-Response is incorrect


The esp8266 selects MS-CHAPv2 for user authentication when using PEAP or EAP-TTLS, but there seems to be a problem with the response it sends. Using other clients works fine for both PEAP and EAP-TTLS.

--
Joost

Statistics: Posted by joostd — Sat Dec 10, 2016 6:29 pm


]]>
2016-10-22T03:24:04+08:00 2016-10-22T03:24:04+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2904&p=10226#p10226 <![CDATA[Cannot connect to WPA2 Enterprise]]> I'm writing a code to connect my ESP8266-07 to Eduroam (WPA2-Enterprise MSCHAPv2).
I followed the SDK2.0 WPA2 flow on documentation but I can't get IP.

This is my user_main.c:

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "os_type.h"
#include "user_config.h"
#include "user_interface.h"
#include "wpa2_enterprise.h"
#include "inttypes.h"
#include "mem.h"
#define user_procTaskQueueLen    1

static u8 ent_username[] = "*******";
static u8 ent_password[] = "*******";

static void loop(os_event_t *events);
os_event_t    user_procTaskQueue[user_procTaskQueueLen];
static volatile os_timer_t some_timer;

bool checkConnection = true;

void ICACHE_FLASH_ATTR
user_init(){
   uart_div_modify(0, UART_CLK_FREQ / 115200);

   wifi_station_disconnect();
   wifi_set_opmode(STATION_MODE);

   char ssid[32] = "eduroam";
   char password[64] = {0x00};
   struct station_config stationConf;
   stationConf.bssid_set = 0;  //need not check MAC address of AP
   os_memcpy(&stationConf.ssid, ssid, 32);
   os_memcpy(&stationConf.password, password, 64);

   if(!wifi_station_set_config(&stationConf)){
      os_printf("\r\nset config fail\r\n");
   }

   // switch to WPA2 Enterprise
   wifi_station_set_wpa2_enterprise_auth(1);

   if(wifi_station_set_enterprise_username (ent_username, sizeof(ent_username))){
      os_printf("\r\nusername set fail\r\n");
   }
   if(wifi_station_set_enterprise_password (ent_password, sizeof(ent_password))){
      os_printf("\r\npassword set fail\r\n");
   }

   system_os_task(loop, USER_TASK_PRIO_0, user_procTaskQueue, user_procTaskQueueLen);
   system_os_post(USER_TASK_PRIO_0, 0, 0 );
   
}

//Main code function
static void ICACHE_FLASH_ATTR
loop(os_event_t *events)
{
    struct ip_info ipconfig;
    wifi_get_ip_info(STATION_IF, &ipconfig);
    if (wifi_station_get_connect_status() == STATION_GOT_IP && ipconfig.ip.addr != 0) {
        os_printf("IP found\n\r");
    } else {
        os_printf("No IP found\n\r");
    }

    if(checkConnection)
       if(wifi_station_connect())
          checkConnection = false;

    os_delay_us(10000);
    system_os_post(USER_TASK_PRIO_0, 0, 0 );
}


I'm using esp-open-sdk with the latest Espressif SDK (August 2016).

Thanks in advance!

Statistics: Posted by Gorgo — Sat Oct 22, 2016 3:24 am


]]>