Hello,
I am working on a project in which I want to do some operations over BLE with a gatt client (smart phone). At some point in operation, the ESP can be sent a command to switch to Wi-Fi so it connects to an AP. While it's connected to the AP, the BLE functionality would be disabled. So I am wondering, what is a good method to do this? I do not want to use Blufi, Arduino, nor Kolban c++ since I want to learn how to do it using esp-idf. At this point in the project I have the BLE functionality set up, but when I try to switch to Wi-Fi, I send the command which disables the bt controller and up to that point everything works. But as soon as I add any mention of the Wi-Fi initialization, literally anywhere in the code editor (I was trying to add that right after I disable the bt controller) the esp can be flashed but I check the monitor and it's going crazy rebooting over and over.
If I want to use Wi-Fi, would I have to completely deinitialize, disable, nuke, ect. the bluetooth??
My code is pretty much the gatt server + gatt security server + service table examples all mashed together
I was trying to add wifi station example, except that it was triggered by "connect to AP" command (which is coming in through BLE characteristic write)
Any help is appreciated!
ESP take turns between BLE and Wi-Fi? esp-idf
-
- Posts: 19
- Joined: Mon Jun 10, 2019 4:01 pm
-
- Posts: 29
- Joined: Wed Aug 09, 2017 6:16 am
Re: ESP take turns between BLE and Wi-Fi? esp-idf
Hi :
ESP32 supports Bluetooth and WIFI coexistence. You can init Bluetooth and WIFI at the same time. When WIFI connected to the AP, you can disconnect BLE. if you do not use BLE anymore, you can release Bluetooth:
esp_bluedroid_disable();
esp_bluedroid_deinit();
esp_bt_controller_disable();
esp_bt_controller_deinit();
ESP32 supports Bluetooth and WIFI coexistence. You can init Bluetooth and WIFI at the same time. When WIFI connected to the AP, you can disconnect BLE. if you do not use BLE anymore, you can release Bluetooth:
esp_bluedroid_disable();
esp_bluedroid_deinit();
esp_bt_controller_disable();
esp_bt_controller_deinit();
Re: ESP take turns between BLE and Wi-Fi? esp-idf
Yes. You are correct as we have also used same methods to disable Bluetooth into our project.Weijian-Espressif wrote: ↑Thu Jun 20, 2019 2:42 amHi :
ESP32 supports Bluetooth and WIFI coexistence. You can init Bluetooth and WIFI at the same time. When WIFI connected to the AP, you can disconnect BLE. if you do not use BLE anymore, you can release Bluetooth:
esp_bluedroid_disable();
esp_bluedroid_deinit();
esp_bt_controller_disable();
esp_bt_controller_deinit();
Would you please let me know that will it create any issue if we use BLE and WiFi together either into AP or STA or AP+STA mode? because i believe that WiFi and Bluetooth are working on single radio so that will it create any issue while working together?
Hope question is different but just want to know that if you have any idea regarding that.
Regards,
Ritesh Prajapati
Ritesh Prajapati
-
- Posts: 29
- Joined: Wed Aug 09, 2017 6:16 am
Re: ESP take turns between BLE and Wi-Fi? esp-idf
Hi :
WiFi and Bluetooth are working on single radio, So the performance of Bluetooth and wifi will be affected. If you are no longer using Bluetooth, please release Bluetooth.
WiFi and Bluetooth are working on single radio, So the performance of Bluetooth and wifi will be affected. If you are no longer using Bluetooth, please release Bluetooth.
Re: ESP take turns between BLE and Wi-Fi? esp-idf
Yeah. That is right now we are doing into one of our project for that.Weijian-Espressif wrote: ↑Thu Jun 20, 2019 4:00 amHi :
WiFi and Bluetooth are working on single radio, So the performance of Bluetooth and wifi will be affected. If you are no longer using Bluetooth, please release Bluetooth.
Thanks for your suggestion for same.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: Google [Bot] and 63 guests