esp32 wifi如何手动配置ssid跟密码,我有两个uint8_t数组用来存放输入的ssid跟密码,怎么进行联网配置。我试了一下一直不成功
uint8_t ssid[20]={0x47,0x32,0x2E,0x4E,0x69,0x6B,0x6F};
uint8_t pass[20]={0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x30,0x31,0x33,0x32};
memcpy(esp_wifi_ssid,ssid,20);
memcpy(esp_wifi_pass,pass,20);
wifi_config_t wifi_config = {
.sta = {
.ssid = {esp_wifi_ssid},
.password = {esp_wifi_pass},
/* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (pasword len => 8).
* If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value
* to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to
* WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards.
*/
.threshold.authmode = ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD,
.sae_pwe_h2e = ESP_WIFI_SAE_MODE,
.sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER,
},