{"action":"created","issue":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/921","repository_url":"https://api.github.com/repos/espressif/arduino-esp32","labels_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/921/labels{/name}","comments_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/921/comments","events_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/921/events","html_url":"https://github.com/espressif/arduino-esp32/issues/921","id":281353303,"number":921,"title":"\"Guru Meditation Error\" connecting to WPA2-Enterprise network","user":{"login":"SijmenSchoon","id":345785,"avatar_url":"https://avatars3.githubusercontent.com/u/345785?v=4","gravatar_id":"","url":"https://api.github.com/users/SijmenSchoon","html_url":"https://github.com/SijmenSchoon","followers_url":"https://api.github.com/users/SijmenSchoon/followers","following_url":"https://api.github.com/users/SijmenSchoon/following{/other_user}","gists_url":"https://api.github.com/users/SijmenSchoon/gists{/gist_id}","starred_url":"https://api.github.com/users/SijmenSchoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SijmenSchoon/subscriptions","organizations_url":"https://api.github.com/users/SijmenSchoon/orgs","repos_url":"https://api.github.com/users/SijmenSchoon/repos","events_url":"https://api.github.com/users/SijmenSchoon/events{/privacy}","received_events_url":"https://api.github.com/users/SijmenSchoon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-12T11:40:55Z","updated_at":"2018-02-27T21:09:36Z","closed_at":null,"author_association":"NONE","body":"### Hardware:\r\nBoard:\t\t\t\t\t\tNodeMCU-32S\r\nCore Installation/update date:\t79e5d4c\r\nIDE name:\t\t\t\t\tArduino IDE\r\nFlash Frequency:\t\t\t\t80 MHz\r\nUpload Speed:\t\t\t\t921600\r\n\r\n\r\n### Description:\r\nWhen trying to connect to eduroam (a WPA2-Enterprise network), the ESP32 crashes with a Guru Meditation Error while (presumably) checking the certificate:\r\n\r\n```\r\nGuru Meditation Error: Core  1 panic'ed (LoadProhibited)\r\n. Exception was unhandled.\r\nRegister dump:\r\nPC      : 0x4015624d  PS      : 0x00060930  A0      : 0x80156fb4  A1      : 0x3ffdc600  \r\nA2      : 0x3ffe3fb4  A3      : 0x00000001  A4      : 0x3ffe1ddc  A5      : 0x3ffe1ddb  \r\nA6      : 0x00000002  A7      : 0x00000005  A8      : 0x8015624b  A9      : 0x3ffdc5e0  \r\nA10     : 0x00000000  A11     : 0x00000008  A12     : 0x3ffe3fb4  A13     : 0x00000000  \r\nA14     : 0x00414320  A15     : 0x00000010  SAR     : 0x00000018  EXCCAUSE: 0x0000001c  \r\nEXCVADDR: 0x00000001  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000000  \r\n\r\nBacktrace: 0x4015624d:0x3ffdc600 0x40156fb1:0x3ffdc620 0x4015252a:0x3ffdc640 0x400e5132:0x3ffdc670 0x400e531b:0x3ffdc720 0x400e207e:0x3ffdc7f0 0x400e2481:0x3ffdc830 0x400e16dd:0x3ffdc8b0 0x400e1140:0x3ffdc900 0x400e1199:0x3ffdc940 0x400df809:0x3ffdc960 0x400e0bd8:0x3ffdc9a0 0x400dd4e9:0x3ffdca00 0x400dd879:0x3ffdca40\r\n\r\nRebooting...\r\nets Jun  8 2016 00:22:57\r\n```\r\n\r\nDecoding the backtrace:\r\n```\r\n0x4015624d: mp_read_unsigned_bin at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/wpa_supplicant/src/crypto/libtommath.h line 990\r\n0x40156fb1: bignum_set_unsigned_bin at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/wpa_supplicant/src/crypto/bignum.c line 114\r\n0x4015252a: crypto_mod_exp at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/wpa_supplicant/src/crypto/crypto_internal-modexp.c line 40\r\n0x400e5132: x509_certificate_check_signature at ?? line ?\r\n0x400e531b: x509_certificate_chain_validate at ?? line ?\r\n0x400e207e: tlsv1_client_set_cred at ?? line ?\r\n0x400e2481: tlsv1_client_process_handshake at ?? line ?\r\n0x400e16dd: tlsv1_client_handshake at ?? line ?\r\n0x400e1140: tls_connection_handshake2 at ?? line ?\r\n0x400e1199: tls_connection_handshake at ?? line ?\r\n0x400df809: eap_peer_tls_process_helper at ?? line ?\r\n0x400e0bd8: eap_peer_tls_register at ?? line ?\r\n0x400dd4e9: eap_sm_process_request at ?? line ?\r\n0x400dd879: wpa2Task at ?? line ?\r\n```\r\n\r\nCommenting out the `esp_wifi_sta_wpa2_ent_set_ca_cert` call does not change the error.\r\n\r\nThe espressif/esp-idf branch has however done a commit a while ago with \"wifi fixes\". Maybe that commit fixes the problem?\r\n\r\n### Sketch:\r\nRelevant code:\r\n\r\n```cpp\r\n#define ESP_ERROR_RETURN(tag, x) { \\\r\n        if ((x) != ESP_OK) {       \\\r\n            Serial.println(tag);   \\\r\n            return false;          \\\r\n        }                          \\\r\n    }\r\n\r\nbool WiFiTool::_internal_connect(const String ssid, const String username,\r\n                                 const String password)\r\n{\r\n    char *mut_username = new char[username.length() + 1];\r\n    strcpy(mut_username, username.c_str());\r\n\r\n    char *mut_password = new char[password.length() + 1];\r\n    strcpy(mut_password, password.c_str());\r\n\r\n    Serial.print(\"USERNAME: \");\r\n    Serial.println(mut_username);\r\n    Serial.print(\"PASSWORD: \");\r\n    Serial.println(mut_password);\r\n\r\n    // Set the WPA2 enterprise CA certificate\r\n    ESP_ERROR_RETURN(\"set_ca_cert\", esp_wifi_sta_wpa2_ent_set_ca_cert(\r\n        (uint8_t *)Certificates::digicert, strlen(Certificates::digicert)));\r\n\r\n    // Set identity, username and password\r\n    ESP_ERROR_RETURN(\"set_identity\", esp_wifi_sta_wpa2_ent_set_identity(\r\n        (uint8_t *)mut_username, strlen(mut_username)))\r\n\r\n    ESP_ERROR_RETURN(\"set_username\", esp_wifi_sta_wpa2_ent_set_username(\r\n        (uint8_t *)mut_username, strlen(mut_username)));\r\n\r\n    ESP_ERROR_RETURN(\"set_password\", esp_wifi_sta_wpa2_ent_set_password(\r\n        (uint8_t *)mut_password, strlen(mut_password)));\r\n\r\n    // Connect to the network\r\n    esp_wpa2_config_t wpa2_config = WPA2_CONFIG_INIT_DEFAULT();\r\n    ESP_ERROR_RETURN(\"enable\", esp_wifi_sta_wpa2_ent_enable(&wpa2_config));\r\n\r\n    WiFi.begin(ssid.c_str());\r\n    return true;\r\n}\r\n\r\n```\r\n\r\n### Debug Messages:\r\nThat option does not seem to be there.\r\n"},"comment":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/comments/369026842","html_url":"https://github.com/espressif/arduino-esp32/issues/921#issuecomment-369026842","issue_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/921","id":369026842,"user":{"login":"allertman","id":36901148,"avatar_url":"https://avatars0.githubusercontent.com/u/36901148?v=4","gravatar_id":"","url":"https://api.github.com/users/allertman","html_url":"https://github.com/allertman","followers_url":"https://api.github.com/users/allertman/followers","following_url":"https://api.github.com/users/allertman/following{/other_user}","gists_url":"https://api.github.com/users/allertman/gists{/gist_id}","starred_url":"https://api.github.com/users/allertman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allertman/subscriptions","organizations_url":"https://api.github.com/users/allertman/orgs","repos_url":"https://api.github.com/users/allertman/repos","events_url":"https://api.github.com/users/allertman/events{/privacy}","received_events_url":"https://api.github.com/users/allertman/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T21:09:35Z","updated_at":"2018-02-27T21:09:35Z","author_association":"NONE","body":"After I upgraded to the latest Arduino IDE (1.8.5) and ESP32 core (1.22.0-80-g6c4433a-5.2.0) yesterday (26 Feb 2018), I experienced the same issues as described by Sijmen. Does anyone have a solution?"}}
{"actor":{"display_login":"allertman"}}