autoplant: attempt to fix crash, but we're just going around in circles

We get this crash:

path/to/autoplant/autoplant/autoplant.ino: In function 'void connect_wifi()':
autoplant:85:5: error: 'esp_wifi_sta_wpa2_ent_set_identity' was not declared in this scope
     esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)user, strlen(user));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
autoplant:86:5: error: 'esp_wifi_sta_wpa2_ent_set_username' was not declared in this scope
     esp_wifi_sta_wpa2_ent_set_username((uint8_t *)user, strlen(user));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
autoplant:87:5: error: 'esp_wifi_sta_wpa2_ent_set_password' was not declared in this scope
     esp_wifi_sta_wpa2_ent_set_password((uint8_t *)pass, strlen(pass));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
autoplant:88:2: error: 'esp_wpa2_config_t' was not declared in this scope
  esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
  ^~~~~~~~~~~~~~~~~
path/to/autoplant/autoplant/autoplant.ino:88:2: note: suggested alternative: 'esp_eth_config_t'
  esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
  ^~~~~~~~~~~~~~~~~
  esp_eth_config_t
autoplant:89:32: error: 'config' was not declared in this scope
  esp_wifi_sta_wpa2_ent_enable(&config);
                                ^~~~~~
path/to/autoplant/autoplant/autoplant.ino:89:32: note: suggested alternative: 'confstr'
  esp_wifi_sta_wpa2_ent_enable(&config);
                                ^~~~~~
                                confstr
autoplant:89:2: error: 'esp_wifi_sta_wpa2_ent_enable' was not declared in this scope
  esp_wifi_sta_wpa2_ent_enable(&config);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
path/to/autoplant/autoplant/autoplant.ino:89:2: note: suggested alternative: 'gpio_pin_wakeup_enable'
  esp_wifi_sta_wpa2_ent_enable(&config);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  gpio_pin_wakeup_enable
Multiple libraries were found for "WiFi.h"
 Used: /home/USERNAME/.arduino15/packages/esp32/hardware/esp32/2.0.2/libraries/WiFi
 Not used: /home/USERNAME/Downloads/arduino-1.8.16/libraries/WiFi
exit status 1
'esp_wifi_sta_wpa2_ent_set_identity' was not declared in this scope
This commit is contained in:
Starbeamrainbowlabs 2022-01-21 18:41:14 +00:00
parent c5fcf90119
commit d4db3ddc34
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -3,13 +3,14 @@
// #include <ArduinoJson.h>
#include <WiFi.h>
#ifdef WIFI_ENTERPRISE_ENABLED
// Ref https://github.com/martinius96/ESP32-WPA2-enterprise/blob/master/ESP32_WPA2enterprise.ino
#include "esp_wpa2.h"
#include "esp_wifi.h"
#endif
#include <WiFi.h>
#ifdef MQTT_NO_TLS
#include <WiFiClient.h>
@ -75,11 +76,17 @@ void connect_wifi() {
// Ref https://github.com/martinius96/ESP32-WPA2-enterprise/blob/master/ESP32_WPA2enterprise.ino
// For ESP32 ONLY! For esp8266, see the code with the esp8266-last tag, which is the last commit that supports the esp8266.
WiFi.disconnect(true);
WiFi.mode(WIFI_STA);
const char* user = WIFI_ENTERPRISE_USERNAME;
const char* pass = WIFI_ENTERPRISE_PASSWORD;
// 'esp_wifi_sta_wpa2_ent_set_identity' was not declared in this scope :-(
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)WIFI_ENTERPRISE_USERNAME, strlen(WIFI_ENTERPRISE_USERNAME));
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)WIFI_ENTERPRISE_USERNAME, strlen(WIFI_ENTERPRISE_USERNAME));
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)WIFI_ENTERPRISE_PASSWORD, strlen(WIFI_ENTERPRISE_PASSWORD));
esp_wifi_sta_wpa2_ent_enable();
esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)user, strlen(user));
esp_wifi_sta_wpa2_ent_set_username((uint8_t *)user, strlen(user));
esp_wifi_sta_wpa2_ent_set_password((uint8_t *)pass, strlen(pass));
esp_wpa2_config_t config = WPA2_CONFIG_INIT_DEFAULT();
esp_wifi_sta_wpa2_ent_enable(&config);
WiFi.begin(WIFI_SSID);
#endif