How to turn on/off the BLE and WiFI radios

Aussie Susan
Posts: 45
Joined: Thu Aug 22, 2019 3:48 am

How to turn on/off the BLE and WiFI radios

Postby Aussie Susan » Tue Oct 08, 2019 1:47 am

I want to use both BLE and WiFi. Ideally I'd like to use both simultaneously but others have reported issues with this.
In my circumstance I have no problem with switching between BLE and WiFi.
In the various topics I've read about this there is often the comment to turn the radio on and off for the particular stack. However, when I read the documentation, I'm not sure which are the specific API calls that do this.
I'd like to keep as much of the various stack set-ups as possible and simply turn the radio on and off as required.
Therefore: can someone please tell me the specific API calls that I need to make for each operation?
Susan

kugelblitz
Posts: 6
Joined: Tue Feb 26, 2019 6:36 am

Re: How to turn on/off the BLE and WiFI radios

Postby kugelblitz » Tue Oct 08, 2019 8:56 am

I am also looking for this. I have tried various combinations of bluedroid_enable, bluedroid_disable, bt_controller_enable, and bt_controller_disable but once it is disabled I can't figure out how to reenable functionality. I have also tried to initialize everything using the init functions and then enable/set callbacks later but this also causes problems (at least in my case for SPP)

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: How to turn on/off the BLE and WiFI radios

Postby chegewara » Sat Oct 12, 2019 5:39 pm

This is BLE deinit procedure:

Code: Select all

    esp_bluedroid_disable();
    esp_bluedroid_deinit();
    esp_bt_controller_disable();
    esp_bt_controller_deinit();
    
As long as BLE memory is not released you can init BLE again.

To stop wifi you can use:

Code: Select all

esp_wifi_stop();

Aussie Susan
Posts: 45
Joined: Thu Aug 22, 2019 3:48 am

Re: How to turn on/off the BLE and WiFI radios

Postby Aussie Susan » Fri Oct 18, 2019 2:08 am

Sorry for the delay in replying - the cause of that delay is also the reason I have not tried this and possibly wont for a little while yet.
Just wanted to say thanks for the information and I'll use it as soon as I can.
Susan

Who is online

Users browsing this forum: MicroController and 84 guests