How to deinitalize the nimble stack before starting wifi provisioning.

listout
Posts: 31
Joined: Wed Mar 16, 2022 10:54 am

How to deinitalize the nimble stack before starting wifi provisioning.

Postby listout » 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

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

suryasid09
Posts: 3
Joined: Fri Oct 27, 2023 7:54 am

Re: How to deinitalize the nimble stack before starting wifi provisioning.

Postby suryasid09 » Fri Oct 27, 2023 8:25 am

Hi,

I am struggling with the same issue for sometime now. I tried bunch of different methods but nothing seems to work. Anyone able to figure out, would greatly appreciate.

irahul
Posts: 46
Joined: Fri Jun 18, 2021 10:07 am

Re: How to deinitalize the nimble stack before starting wifi provisioning.

Postby irahul » Mon Oct 30, 2023 8:26 am

If the stack is de-initialised, then no BLE functionality will work ( As you are closing down stack )

You can check the CONFIG_ESP_PROTOCOMM_KEEP_BLE_ON_AFTER_BLE_STOP option , which keeps the stack running after provisioning is done. That way, after provisioning, you can modify the application to use the needed BLE feature/ functionality

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 100 guests