{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/2595","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/2595/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/2595/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/2595/events","html_url":"https://github.com/esp8266/Arduino/issues/2595","id":182254281,"number":2595,"title":"WPA2 Enterprise authorization fail","user":{"login":"Gidrix","id":11461523,"avatar_url":"https://avatars.githubusercontent.com/u/11461523?v=3","gravatar_id":"","url":"https://api.github.com/users/Gidrix","html_url":"https://github.com/Gidrix","followers_url":"https://api.github.com/users/Gidrix/followers","following_url":"https://api.github.com/users/Gidrix/following{/other_user}","gists_url":"https://api.github.com/users/Gidrix/gists{/gist_id}","starred_url":"https://api.github.com/users/Gidrix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gidrix/subscriptions","organizations_url":"https://api.github.com/users/Gidrix/orgs","repos_url":"https://api.github.com/users/Gidrix/repos","events_url":"https://api.github.com/users/Gidrix/events{/privacy}","received_events_url":"https://api.github.com/users/Gidrix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-10-11T12:46:20Z","updated_at":"2016-12-22T15:54:44Z","closed_at":null,"body":"### Basic Infos\n#### Hardware\n\nHardware:           ESP-12\nCore Version:       using git branch update_sdk_2.0.0\n### Description\n\nI have AP with configured PEAP WPA2 Enterprise, it only asks log/pass, certificates not required. Authorization work properly, I can connect with my android phone.\nWhen esp tries to connect to AP, in AP log esp status is only \"associated\", which means esp actually connected to AP. BUT esp never get an ip (status will be \"authorized\"). Basically wpa2 enterprise part of code dont do anything.\nSame code in NONOS SDK  2.0.0 works fine, but I already have pretty big project on arduino, so it would be hard to transfer to sdk.\n### Settings in IDE\n\nModule:             Generic ESP8266 Module\nFlash Size:         4MB\nCPU Frequency:      80Mhz\nFlash Mode:         qio\nFlash Frequency:    40Mhz\nUpload Using:        SERIAL\nReset Method:       ck\n### Sketch\n\n``` cpp\n\n#include <Arduino.h>\n#include <ESP8266WiFi.h>\n#ifdef ESP8266\nextern \"C\" {\n#include \"user_interface.h\"\n#include \"wpa2_enterprise.h\"\n}\n#endif\n\nstatic u8 ent_username[] = \"test\";\nstatic u8 ent_password[] = \"test\";\n\nvoid setup(){\n  char a[100];\n  ip_info info;\n  wifi_get_ip_info(0, &info);\n\n  Serial.begin(115200);\n\n  wifi_station_disconnect();\n  wifi_set_opmode(STATION_MODE);\n\n  char ssid[32] = \"my_enterprise_ap\";\n  char password[64] = {0x00};\n  struct station_config stationConf;\n  stationConf.bssid_set = 0;  //need not check MAC address of AP\n  memcpy(&stationConf.ssid, ssid, 32);\n  memcpy(&stationConf.password, password, 64);\n\n  if(!wifi_station_set_config(&stationConf)){\n    Serial.print(\"\\r\\nset config fail\\r\\n\");\n  }\n\n  // switch to WPA2 Enterprise \n  wifi_station_set_wpa2_enterprise_auth(1); \n\n  if(wifi_station_set_enterprise_username (ent_username, sizeof(ent_username))){\n    Serial.print(\"\\r\\nusername set fail\\r\\n\");\n  }\n  if(wifi_station_set_enterprise_password (ent_password, sizeof(ent_password))){\n    Serial.print(\"\\r\\npassword set fail\\r\\n\");\n  }\n\n  if(!wifi_station_connect()){\n    Serial.print(\"\\r\\nconnect fail\\r\\n\");\n  }\n\n  Serial.print(\"\\r\\ntrying to connect...\");\n\n  while(info.ip.addr == 0){\n    ESP.wdtFeed();\n    Serial.print(\".\");\n    delay(1000);\n    wifi_get_ip_info(0, &info);\n  }\n\n  sprintf(a, \"%\"PRIu32,info.ip.addr);\n  Serial.print(\"\\r\\nip addr: \");\n  Serial.print(a);\n  Serial.print(\"\\r\\n\");\n}\n\n\nvoid loop()\n{ \n}\n```\n"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/268828663","html_url":"https://github.com/esp8266/Arduino/issues/2595#issuecomment-268828663","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/2595","id":268828663,"user":{"login":"dfries","id":2767875,"avatar_url":"https://avatars.githubusercontent.com/u/2767875?v=3","gravatar_id":"","url":"https://api.github.com/users/dfries","html_url":"https://github.com/dfries","followers_url":"https://api.github.com/users/dfries/followers","following_url":"https://api.github.com/users/dfries/following{/other_user}","gists_url":"https://api.github.com/users/dfries/gists{/gist_id}","starred_url":"https://api.github.com/users/dfries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfries/subscriptions","organizations_url":"https://api.github.com/users/dfries/orgs","repos_url":"https://api.github.com/users/dfries/repos","events_url":"https://api.github.com/users/dfries/events{/privacy}","received_events_url":"https://api.github.com/users/dfries/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T15:54:44Z","updated_at":"2016-12-22T15:54:44Z","body":"I'm using esp-open-sdk rather than the Arduino base.  I added some of the enterprise functions to the basic_example and linked with wpa2, but I'm getting what sounds like an out of memory error \"Method private structure allocated failure\" even with this minimal program that claims 45KB free. This is with ESP8266_NONOS_SDK_V2.0.0_16_08_10, any ideas? I have the same error if I try a PEM client certificate and private key.\r\n\r\nAdded functions:\r\n```\r\nwifi_set_opmode(STATION_MODE);\r\nwifi_station_set_wpa2_enterprise_auth(true);\r\nwifi_station_set_reconnect_policy(false);\r\nwifi_station_set_enterprise_username((u8*)EAP_USER, os_strlen(EAP_USER));\r\nwifi_station_set_enterprise_password((u8*)EAP_PASSWORD, os_strlen(EAP_PASSWORD));\r\nwifi_station_connect();\r\n```\r\n\r\noutput:\r\n\r\n> heap 46040 wifi status 1\r\n> state: 2 -> 0 (0)\r\n> scandone\r\n> state: 0 -> 2 (b0)\r\n> state: 2 -> 3 (0)\r\n> state: 3 -> 5 (10)\r\n> add 0\r\n> aid 1\r\n> cnt\r\n> Method private structure allocated failure\r\n> state: 5 -> 2 (17c0)\r\n> rm 0\r\n\r\nFull program here.\r\nhttps://github.com/dfries/source-code-examples/blob/wpa2-eap/basic_example/user/user_main.c"}}
{"actor":{"display_login":"dfries"}}