WIFI/BLE Simultaneously

User avatar
redradist
Posts: 18
Joined: Sat Apr 11, 2020 8:33 am

Re: WIFI/BLE Simultaneously

Postby redradist » Sun Oct 11, 2020 7:37 pm

In esp-idf v4.2beta1 Bluetooth and WiFi works simultaneously, but by some reason discovery services does not work from phone ... it is strange

bloobird0
Posts: 2
Joined: Fri Oct 30, 2020 3:35 pm

Re: WIFI/BLE Simultaneously

Postby bloobird0 » Fri Oct 30, 2020 3:41 pm

ESP_Tianhao wrote:
Tue Aug 21, 2018 9:04 am
In software control mode, there's 3 option to modify the coexist preference(Balance, prefer to WiFi and prefer to Bluetooth).
Hello @ESP_Tianhao this post was the most usefull I found until now. Thanks for it. Could you please tell me how to choose Balance, prefer WiFi or prefer Bluetooth? In Menuconfig I found where to activate the SW control coexistence but I'm unable to find how to select the SW control option to any of the 3 possibilities you mentionned. I use the current master branch of IDF.

Wernfried
Posts: 1
Joined: Sat Nov 07, 2020 6:58 pm

Re: WIFI/BLE Simultaneously

Postby Wernfried » Sat Nov 07, 2020 7:23 pm

I have read a lot here regarding the parallel usage of WiFi and BLE.

Since some got it working I decided to give it also a try.
My application has two tasks, one for WiFi and other stuff and one for BLE. I could get both working together. BLE scans every 5s for advertisenets and detects the ones I'm sending from my phone. WiFi does scan the SSIDs and connects to AP. Next step was to send MQTT messages via WiFI, when some advertisements are detected. This also worked.

But then I decided to add a WebServer to allow some configurations via WiFi. And here startet the problems. When I comment the code for BLE the WebServer works well. As soon I only do BLEDevice::Init(""), the request from a browser to the WebServer hangs. using the browser debugger I see the request is not fully answered. The response is a somehow long one, it has HTML, CSS ans JS all inline, but zipped. I've played a bit and if I shorten the response (only a simple "Hello Page" or even a bit more) it works. Everytime I make the reponse a bit larger, it hangs.

It seems for MQTT the packages sent are short enough to work.

Since I only have the BLEDevice::Init() statement running (the scanning is commented out temporary) I do not see a possibility to init BLE without turning on the radio. I could live with a solution to disable BLE scanning while the WebServer is responding.

Does someone have an idea how to acheave this?

One more, for my WebServer I'm using "ESPAsyncWebServer". Would it be better to use the synchronous WebServer, since in that case I have to call to handle request by my own in the loop?

Who is online

Users browsing this forum: No registered users and 45 guests