ESP32 Hands Free Protocol in Arduino SDK

Years ago I used Bluetooth for a serial connection to save NEMA data from GPS unit. It was a very simple project. I have a new project now needing Bluetooth headset connection and seems much more involved.

I’m currently prototyping my design in an ESP32 Thing Plus. I am reading a sensor and technician will have his hands tied up so plan is to read sensor as a tone through a headset so technician knows when he’s hit the setpoint in his process.

Few questions:

Question 1: Is there a good book with overview of Bluetooth protocols? I’d like to know how the various protocols are setup and run so I know what I need to code (or is being coded in libraries to troubleshoot).

Question 2: I would LOVE to use it as a A2DP source to sink up with a headset. I found gethub example linked below. However, I cannot figure out how to get the source to connect to a specific headset. I change the name but presume it’s ultimately the alias the hardware is looking for (no idea how to get name/alias of headset).

https://github.com/pschatzmann/ESP32-A2DP

Question 3: is there a good Hands Free Protocol example for the ESP32 for Arduino SDK? Ultimately, HFP is more than good enough for what I need to do and maybe it’s easier to develop?x

  1. https://learn.sparkfun.com/tutorials/bl … 1615791300 - also check out https://randomnerdtutorials.com/esp32-b … duino-ide/

  2. Usually you need to find the bluetooth address, sometimes available form the MFR, some it is being broadcast and you can detect it (when in pairing mode or similar)…we don’t really have any further advice

  3. Not that we’re currently aware of, maybe someone else will stop by that knows more

Awesome! Thanks, I’ll go through those tutorials.

I reviewed the tutorials. Compiled ESP32 BLE examples in Arduino environment and got them working. However, still confused on Hands Free Protocol and Advanced Audio Distribution Profile on ESP32 / Thing Plus. I don’t see examples for classic Bluetooth.

I think ESP32 is capable of both HFP & A2DP. I found library linked below that merges the ESP32 libraries into Arduino libraries to do A2DP. I can compile it and load it to my device but I cannot figure out how to pair it to a headset. I need a simple Bluetooth classic pairing example… Where the ESP32 is the one selecting the device to pair to.

https://github.com/pschatzmann/ESP32-A2DP

I thought about ditching the Arduino IDE and moving completely over to Expressif development environment & libraries but couldn’t get eclipse to work (separate post).

I tried calling customer support and said to post here. I am giving up on the ESP32 / Thing Plus. After reading those tutorials it looks like a RN-52 already has the HFP implemented in the chip, as well as a built in DSP for audio. However, I see that your RN-52 breakout board is discontinued. Do you have another module that has a HFP and or A2DP profile implemented on chip w/ DSP?

There’s no good examples online from what I can find to run HFP or A2DP in Arduino environment. I can get example code for A2DP with Arduino libraries to compile on the ESP32 but cannot get the ESP32 to pair with my Headset. The example code has a function call from Expressif library that device name instead of address. However, I cannot get it to connect / bond with the device name.

Long story short, I think would be much easier to use a chip like that RN-42 that has the HFP it implemented in hardware. Do you have anything that implements HFP in hardware or has specific tutorials to pair a headset with the chipset?