When I use smartconfig for ESP32, I always get the wifi error:
[0;32mI (3670) smartconfig: SC version: V2.6.3[0m
W (3670) wifi: incorrect scan type: 1073420668
E (5356) wifi: err1,exceed max timer value
My code is listed as below:
void smartconfig_done(smartconfig_status_t status, void *pdata)
{
switch (status) {
case SC_STATUS_WAIT:
printf("SC_STATUS_WAIT\n");
break;
case SC_STATUS_FIND_CHANNEL:
printf("SC_STATUS_FIND_CHANNEL\n");
break;
case SC_STATUS_GETTING_SSID_PSWD:
printf("SC_STATUS_GETTING_SSID_PSWD\n");
smartconfig_type_t *type = pdata;
if (*type == SC_TYPE_ESPTOUCH) {
printf("SC_TYPE:SC_TYPE_ESPTOUCH\n");
} else {
printf("SC_TYPE:SC_TYPE_AIRKISS\n");
}
break;
case SC_STATUS_LINK:
printf("SC_STATUS_LINK\n");
wifi_config_t wifi_config;
wifi_config.sta = *((wifi_sta_config_t *)pdata);
esp_wifi_set_config(WIFI_IF_STA, &wifi_config);
esp_wifi_disconnect();
esp_wifi_connect();
break;
case SC_STATUS_LINK_OVER:
printf("SC_STATUS_LINK_OVER\n");
if (pdata != NULL) {
uint8_t phone_ip[4] = { 0 };
memcpy(phone_ip, (uint8_t *) pdata, 4);
printf("Phone ip: %d.%d.%d.%d\n", phone_ip[0],
phone_ip[1], phone_ip[2], phone_ip[3]);
}
esp_smartconfig_stop();
break;
}
}
void smartconfig_init(void)
{
tcpip_adapter_init();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
esp_wifi_init(&cfg);
//SC_TYPE_ESPTOUCH,SC_TYPE_AIRKISS,SC_TYPE_ESPTOUCH_AIRKISS
esp_smartconfig_set_type(SC_TYPE_AIRKISS);
esp_wifi_set_mode(WIFI_MODE_STA);
esp_wifi_start();
}
void smartconfig_task(void *pvParameters)
{
//printf("airkiss ver: %s\n", airkiss_version());
esp_smartconfig_start(smartconfig_done);
//vTaskDelete(NULL);
while (1) {
vTaskDelay(6000 / portTICK_PERIOD_MS);
}
}
smartconfig_init();
//SmartConfig task
vTaskDelay(2000 / portTICK_RATE_MS);
xTaskCreate(&smartconfig_task, "smartconfig_task", 1024*8, NULL, 9, NULL);
wifi: incorrect scan type:1073420668
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Baidu [Spider] and 192 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.