Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BluetoothSerial shows up as audio device on macOS, immediately disconnects #1304

Closed
gohai opened this issue Apr 10, 2018 · 11 comments
Closed

Comments

@gohai
Copy link
Contributor

gohai commented Apr 10, 2018

Hardware:

Board: Adafruit ESP32 Feather
Core Installation/update date: April 10 2018
IDE name: Arduino 1.8.5
Flash Frequency: 80MHz
Upload Speed: 921600

Description:

Running the SerialToSerialBT example shows up as an "audio" device on macOS 10.13.4. The device disconnects on its own soon after pairing. Thus, it cannot be used currently. (See screenshot for details.)

screen shot 2018-04-10 at 9 46 42 am

@tueddy
Copy link
Contributor

tueddy commented Apr 10, 2018

Same here on MacOS 10.13.4
Also no success on iOS 11.3, tested with system-bluetooth and some BT serial apps like Bluefruit, BluTerm, LightBlue and JBWave.

Sorry but the BTSerial demo is simply not functional?

@copercini
Copy link
Contributor

@beegee-tokyo
Copy link
Contributor

ESP32 bluetooth is showing as speakers on Android as well, but Bluetooth Serial is working fine as shown in my little tutorial. Cannot not test on MAC or iOS though.

@gohai
Copy link
Contributor Author

gohai commented Apr 12, 2018

@copercini This define appears to set the default via p_bta_dm_cfg, but shouldn't it be possible to re-configure this e.g. through BTM_SecAddDevice or BTM_SetDeviceClass?

@gohai
Copy link
Contributor Author

gohai commented Apr 12, 2018

I looked at the output of macOS' Console application while I attempted to connect to the device: the process bluetoothaudiod attempts a couple of times to creates an audio device, realizes that No protocols known for device or services are nil, and finally gives up, at which point bluetoothd removes the device. So this confirms the suspicion that the device class plays a role here.

@gohai
Copy link
Contributor Author

gohai commented Jun 16, 2018

@me-no-dev The necessary functionality appears to have been added in espressif/esp-idf@789edc0. Would it be possible to update IDF to at least this commit?

@lbernstone
Copy link
Contributor

You can update the code yourself if you want to test. #1142

@gohai
Copy link
Contributor Author

gohai commented Jun 17, 2018

@lbernstone Thank you for the pointer. I just tried this, following your instructions - would you mind helping me a bit further?

First, I found the idf-update branch in this repository. Unfortunately it looks like its IDF is a few versions behind espressif/esp-idf@789edc0 still.

Next I tried compiling blink with the following combinations:

How do I go from here? Which of the above would you use? Should copying libesp32.a (and the specific header file that I need) be enough? Would you suggest I then use this on top of the arduino-esp32 master or idf-update branch?

Thanks in advance.

@copercini
Copy link
Contributor

Same issue solved: https://www.esp32.com/viewtopic.php?f=13&t=6099

Now the only problem is with the outdated IDF version of this core

@gohai
Copy link
Contributor Author

gohai commented Jun 19, 2018

Here is a recompiled IDF with the default COD set to the changed values, if anyone else needs this as a workaround till this repo updates IDF again: https://github.com/gohai/arduino-esp32/commit/2c772325ffe94173f1674583c6e9cafb07826df0

@copercini
Copy link
Contributor

Fixed in 901a341

Thanks @gohai !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants