How to deinitalize the nimble stack before starting wifi provisioning.
Posted: Wed Mar 16, 2022 11:03 am
I want to perform wifi provisioning while using nimble spp. According to this issue https://github.com/espressif/esp-idf/issues/8502 I'll need to de-initialize the nimble stack. But how do I do so? I was looking at the nimble epressif doc and found this code
How ever now I cannot connect to the ESP32 while from the provisioning app nor can the app find it. I scan the QR code and after 3-4 seconds I get an PROV_XYZA device not found.
Code: Select all
ESP_LOGI(TAG, "Deinitializing BLE host");
ret_i = nimble_port_stop();
if (ret_i == 0) {
nimble_port_deinit();
ret_i = esp_nimble_hci_and_controller_deinit();
if (ret_i != ESP_OK) {
ESP_LOGE(
TAG,
"esp_nimble_hci_and_controller_deinit() failed with error: %d",
ret_i);
}
}