Page 1 of 1

Stuck in BT wifi provisioning

Posted: Tue Mar 07, 2023 2:18 pm
by Thierry91
I'am using IDF V5 with vs code and esp Wroom 32.
I try to implement wifi provisioning through BT and the android ESP BLE Prov application.
On the esp side I never get out of the wifi_prov_mgr_wait() function.
On the android app side, on the screen of the phone :
-Sending WI-FI credentials =>OK
-Applying WI-FI connection=>OK
-Checking provisioning status => spinner on the screen, spinning forever

Could someone please tell me what'I'am doing wrong / missing?
I put below the code and the terminal output.
Many thanks

esp_err_t wifiError;

esp_err_t wifiInit()
{
wifi_init_config_t wifiConfig = WIFI_INIT_CONFIG_DEFAULT();
if((wifiError=nvs_flash_init()))
return wifiError;
if((wifiError=esp_wifi_init(&wifiConfig)))
return wifiError;
if((wifiError=esp_wifi_set_mode(WIFI_MODE_STA)))
return wifiError;
esp_wifi_start();
return 0;
}

void wifiProv(void)
{
const char *service_name = "cb_boiler";
const char *service_key = "";

wifi_prov_security_t security = WIFI_PROV_SECURITY_1;
const char *pop = "8888";

wifi_prov_mgr_config_t config =
{
.scheme = wifi_prov_scheme_ble,
.scheme_event_handler = WIFI_PROV_SCHEME_BLE_EVENT_HANDLER_FREE_BTDM
};

ESP_ERROR_CHECK( wifi_prov_mgr_init(config) );

ESP_ERROR_CHECK(wifi_prov_mgr_start_provisioning(security, pop, service_name, service_key) );
wifi_prov_mgr_wait();
wifi_prov_mgr_deinit();
}
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6940
ho 0 tail 12 room 4
load:0x40078000,len:15500
load:0x40080400,len:3844
0x40080400: _init at ??:?

entry 0x4008064c
I (29) boot: ESP-IDF v5.0.1 2nd stage bootloader
I (29) boot: compile time 22:22:26
I (29) boot: chip revision: v3.0
I (32) boot.esp32: SPI Speed : 40MHz
I (37) boot.esp32: SPI Mode : DIO
I (41) boot.esp32: SPI Flash Size : 4MB
I (46) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (55) boot: ## Label Usage Type ST Offset Length
I (62) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (70) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (77) boot: 2 factory factory app 00 00 00010000 00177000
I (85) boot: End of partition table
I (89) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=3a7a8h (239528) map
I (184) esp_image: segment 1: paddr=0004a7d0 vaddr=3ffbdb60 size=0553ch ( 21820) load
I (193) esp_image: segment 2: paddr=0004fd14 vaddr=40080000 size=00304h ( 772) load
I (193) esp_image: segment 3: paddr=00050020 vaddr=400d0020 size=d4df8h (871928) map
I (515) esp_image: segment 4: paddr=00124e20 vaddr=40080304 size=1f044h (127044) load
I (583) boot: Loaded app from partition at offset 0x10000
I (583) boot: Disabling RNG early entropy source...
I (595) cpu_start: Pro cpu up.
I (595) cpu_start: Starting app cpu, entry point is 0x40081488
0x40081488: call_start_cpu1 at C:/Users/thier/esp/esp-idf/components/esp_system/port/cpu_start.c:142

I (0) cpu_start: App cpu up.
I (611) cpu_start: Pro cpu start user code
I (611) cpu_start: cpu freq: 160000000 Hz
I (612) cpu_start: Application information:
I (616) cpu_start: Project name: myTests2
I (621) cpu_start: App version: 1
I (626) cpu_start: Compile time: Mar 7 2023 11:09:36
I (632) cpu_start: ELF file SHA256: 60eaf2270d1522b2...
I (638) cpu_start: ESP-IDF: v5.0.1
I (643) cpu_start: Min chip rev: v0.0
I (647) cpu_start: Max chip rev: v3.99
I (652) cpu_start: Chip rev: v3.0
I (657) heap_init: Initializing. RAM available for dynamic allocation:
I (664) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (670) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (676) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (682) heap_init: At 3FFCB1A8 len 00014E58 (83 KiB): DRAM
I (689) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (695) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (701) heap_init: At 4009F348 len 00000CB8 (3 KiB): IRAM
I (709) spi_flash: detected chip: generic
I (712) spi_flash: flash io: dio
I (718) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (728) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (788) SSD1306: OLED configured successfully
I (918) wifi:wifi driver task: 3ffcdc78, prio:23, stack:6656, core=0
I (918) system_api: Base MAC address is not set
I (918) system_api: read default base MAC address from EFUSE
I (938) wifi:wifi firmware version: 17afb16
I (938) wifi:wifi certification version: v7.0
I (938) wifi:config NVS flash: enabled
I (938) wifi:config nano formating: disabled
I (938) wifi:Init data frame dynamic rx buffer num: 32
I (948) wifi:Init management frame dynamic rx buffer num: 32
I (948) wifi:Init management short buffer num: 32
I (958) wifi:Init dynamic tx buffer num: 32
I (958) wifi:Init static rx buffer size: 1600
I (958) wifi:Init static rx buffer num: 10
I (968) wifi:Init dynamic rx buffer num: 32
I (968) wifi_init: rx ba win: 6
I (978) wifi_init: tcpip mbox: 32
I (978) wifi_init: udp mbox: 6
I (978) wifi_init: tcp mbox: 6
I (988) wifi_init: tcp tx win: 5744
I (988) wifi_init: tcp rx win: 5744
I (998) wifi_init: tcp mss: 1440
I (998) wifi_init: WiFi IRAM OP enabled
I (998) wifi_init: WiFi RX IRAM OP enabled
I (1008) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (1118) wifi:mode : sta (70:b8:f6:5c:db:88)
I (1118) wifi:enable tsf
I (1948) wifi_prov_scheme_ble: BT memory released
I (1948) BTDM_INIT: BT controller compile version [60aae55]
I (2338) wifi_prov_mgr: Provisioning started with service name : cube_boiler
I (43508) wifi:new:<2,0>, old:<1,0>, ap:<255,255>, sta:<2,0>, prof:1
I (44288) wifi:state: init -> auth (b0)
I (44328) wifi:state: auth -> assoc (0)
I (44368) wifi:state: assoc -> run (10)
I (44508) wifi:connected with MaBoiteLibre2, aid = 7, channel 2, BW20, bssid = 50:64:2b:e6:15:9e
I (44508) wifi:security: WPA2-PSK, phy: bgn, rssi: -62
I (44528) wifi:pm start, type: 1

I (44548) wifi:AP's beacon interval = 102400 us, DTIM period = 1