Page 1 of 1

ESP32-C3: ESPTOUCH_V2 配网失败

Posted: Thu Feb 24, 2022 2:04 pm
by MasterPhi
你好,

我一周前在Github上提交了这个问题的bug report, 附有详细的问题描述, 串口log和无线抓包, 一直没有收到回复.
https://github.com/espressif/esp-idf/issues/8431

问题表现为使用ESPTOUCH_V2时, 某些路由器无法配置成功, 出现如下错误:

Code: Select all

W (8419) smartconfig: found none, invald AP, tmp_crc: 38
改为ESPTOUCH则可以成功配网.

Re: ESP32-C3: ESPTOUCH_V2 配网失败

Posted: Sat Feb 26, 2022 6:59 pm
by MasterPhi
我看了下lib-esptouch-v2-android的源码, tmp_crc: 38的确是我AP BSSID的CRC.

而且使用以下代码esp32c3也的确能列出AP:

Code: Select all

    esp_wifi_scan_start(NULL, true);
    ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&ap_count, ap_info));
    ESP_LOGI(TAG, "Total APs scanned = %u", ap_count);
    for (int i = 0; (i < 32) && (i < ap_count); i++) {
        ESP_LOGI(TAG, "SSID \t\t%s", ap_info[i].ssid);
        ESP_LOGI(TAG, "BSSID \t\t%02x:%02x:%02x:%02x:%02x:%02x",
                    ap_info[i].bssid[0], ap_info[i].bssid[1], ap_info[i].bssid[2],
                    ap_info[i].bssid[3], ap_info[i].bssid[4], ap_info[i].bssid[5]);
        ESP_LOGI(TAG, "RSSI \t\t%d", ap_info[i].rssi);
        print_auth_mode(ap_info[i].authmode);
        if (ap_info[i].authmode != WIFI_AUTH_WEP) {
            print_cipher_type(ap_info[i].pairwise_cipher, ap_info[i].group_cipher);
        }
        ESP_LOGI(TAG, "Channel \t\t%d\n", ap_info[i].primary);
    }
输出:

Code: Select all

I (2644) smartconfig_example: Total APs scanned = 27
I (2644) smartconfig_example: SSID              Mengsk
I (2644) smartconfig_example: BSSID             00:25:9c:13:9e:88
I (2644) smartconfig_example: RSSI              -32
I (2654) smartconfig_example: Authmode          WIFI_AUTH_WPA2_PSK
I (2654) smartconfig_example: Pairwise Cipher   WIFI_CIPHER_TYPE_CCMP
I (2664) smartconfig_example: Group Cipher      WIFI_CIPHER_TYPE_CCMP
I (2674) smartconfig_example: Channel           1

I (2674) smartconfig_example: SSID              Mengsk-Guest
I (2684) smartconfig_example: BSSID             02:25:9c:13:9e:88
I (2684) smartconfig_example: RSSI              -33
I (2694) smartconfig_example: Authmode          WIFI_AUTH_WPA2_PSK
I (2694) smartconfig_example: Pairwise Cipher   WIFI_CIPHER_TYPE_CCMP
I (2704) smartconfig_example: Group Cipher      WIFI_CIPHER_TYPE_CCMP
I (2714) smartconfig_example: Channel           1