ESP32-A2DP
ESP32-A2DP copied to clipboard
Connection problem with iOS 15 and no playback
When I disconnect my mac mini and want to add a connection from my iPhone 8 instead, a connection isn't possible at all...
I have to turn off Bluetooth on my mac mini or shut it down... Then I am able to make a connection from my iPhone but playing back is not possible as the device isn't listed under the airdrop menu.
Under bluetooth settings it offers me to select what device type it is...like heaphone, speaker and so on..... can this be set in the firmware?
Others not able to play back from an iOS device?
This is with the ESP32 -2.0.2 version as I use volume control from the source.
https://github.com/pschatzmann/ESP32-A2DP/wiki/Auto-Reconnect
If you plan to use it from different devices I would recommend to switch the automatic reconnect off or set the retry to a very low value
Well even if I remove the connection from the mac mini and switch it off...then restart the esp32 I can connect from my iPhone to the esp32....but just not play anything as the output device isn't listed....
Did you switch the auto reconnect off ?
Very confusing this auto reconnect....
So for macOS I need to turn it on and for iOS off.....though iOS and macOS would now behave the same...
On the ESP32 you would deactivate it with a2dp_sink.set_auto_reconnect(false, false, 0);
Yes this works for iOS...but then for macOS it won't reconnect automatically on startup, which is the preferred method for a PC when the esp32 was selected as audio output...
Can I detect what device type is connected to the esp32?
I have found the same issue with Android (autoconnect=false): if I try to turn off Bluetooth on smartphone without disconnect or unpair the device, turn on Bluetooth and retry to connect, Android warn "connection failed". This happens also in other condition, randomly. After disconnection by remote, I have also try to call "end" method followed by "start" method in order to clean memory or variables, but the device still not connect (until I do a hard reset). It is like as the ESP32 memory is not perfectly clean and Bluetooth core refuse or ignore connection. I am testing connection from various devices (Android, iPhone, Windows Laptop).
I am finding the same thing - I am trying to build a device that will be used by multiple users, in a music practice room. I am using ESP32 so I can create devices that are nameable for each room.
I have auto reconnect off, I am using an example sketch but I have changed the pins (for physical soldering the DAC to the pins directly) and added a callback to turn on/off the LED for connection status.
If I connect with iPhone, disconnect, then reconnect I either get silence, or the ESP32 hangs and the light stays on after the phone has disconnected. With a laptop, the ESP32 regularly hangs on disconnection, especially if I turn the bluetooth off directly rather than disconnecting properly.
Is there a watchdog that could be checked to restart the ESP32 in case of error? Manually resetting the ESP32 fixes it each time.
The only difference is I am using a2dp_sink.set_auto_reconnect(false); rather than (false, false, 0), the 2nd version above won't verify . In Arduino
Edit again: I have updated to the latest release June with the separate I2S output and ti seems more stable. As my ESP32 is only running this audio output I have also restarted the ESP on disconnect as is back in about 0.5s and it clears out so it's a fresh session each time
See also: https://github.com/pschatzmann/ESP32-A2DP/discussions/495