-
Has anyone ever tried to implement BLE beacon and BT classic in single sketch and running both simultaneously in dual mode? Framework: Arduino Application example:I have a positioning proximity beacon. I want ESP32 to check if someone is within certain distance (lets say 1 meter), ESP32 plays an audio on the Bluetooth speaker. I am using A2DP/Audio tools by @pschatzmann and using player-sdfat-a2dp example as a reference. I have tried to implement this application and got following error when connected to bluetooth speaker:
Things I tried:Identified the problem that esp_bt_controller_enable can't be called twice using different configs and both libraries call it when they start By doing this, I was able to connect to Bluetooth speaker but could not play any audio. For testing and debugging purposes, I went with BluetoothSerial library and begin BT in slave mode. The logs below showcase ESP32 finds the BLE beacon and see if it is within 1 meter range. If yes it stops scanning, then it begin BT in slave mode. On pairing ESP32 with my phone, I sent a string "hello" to ESP32. On receiving, ESP32 should resume the scan again But what I see it that BLE host gets reset and after that I get GAP init failed error.
Any ideas? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For this I would just use the bluedroid library as provided by the core. By using nimble you will be introducing a lot of complexity for little gain. |
Beta Was this translation helpful? Give feedback.
For this I would just use the bluedroid library as provided by the core. By using nimble you will be introducing a lot of complexity for little gain.