我正在尝试使用ESP-IDF框架创建ESP32应用程序,我想通过http服务器进行wifi STA配置。设备会在启动时检查Flash中是否已设置配置。如果是这样,它将尝试连接到访问点,否则它将运行访问点和http服务器本身,然后用户需要连接wifi并在浏览器中转到192.168.4.1,才能选择ssid并输入密码。
提交表单后,我尝试连接选定的wifi接入点,但收到201错误代码(未找到ap)
访问点扫描:
const pathString = "links.video_link";
const getVideoURL = obj => pathString
.split('.')
.reduce((a, prop) => a[prop], obj);
配置保存功能:
esp_err_t index_get_handler(httpd_req_t *req)
{
wifi_scan_config_t scanConf = {
.ssid = NULL,
.bssid = NULL,
.channel = 0,
.show_hidden = 1
};
ESP_ERROR_CHECK(esp_wifi_scan_start(&scanConf, 0));
uint16_t apCount;
if( xQueueReceive( wifi_stations_count, &( apCount ), ( TickType_t ) 1000 ) == pdFALSE)
{