Page 1 of 1

How to turn on/off the BLE and WiFI radios

Posted: Tue Oct 08, 2019 1:47 am
by Aussie Susan
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

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

Posted: Tue Oct 08, 2019 8:56 am
by kugelblitz
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)

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

Posted: Sat Oct 12, 2019 5:39 pm
by chegewara
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();

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

Posted: Fri Oct 18, 2019 2:08 am
by Aussie Susan
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