wifi: incorrect scan type:1073420668

rillhu
Posts: 10
Joined: Wed Apr 19, 2017 5:35 am

wifi: incorrect scan type:1073420668

Postby rillhu » Fri Apr 21, 2017 5:49 am

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);

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 179 guests