Skip to content

ESP32 example BT_DISCOVERY has error ESP_ERR_INVALID_ARG #890

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

Open
rexzz opened this issue Aug 15, 2019 · 7 comments
Open

ESP32 example BT_DISCOVERY has error ESP_ERR_INVALID_ARG #890

rexzz opened this issue Aug 15, 2019 · 7 comments

Comments

@rexzz
Copy link

rexzz commented Aug 15, 2019

  1. trying to run copy of esp-idf\examples\bluetooth\bt_discovery.

NOW WORKING AFTER I manually edited SDK. BUT this is a note if others trying this out or if someone wants to update "README" for bt_discovery.(Maybe mention editing SDK). AND IF SOMEONE wants to look at my SDK changes and tell me if something is wrong, I'd appreciate.

  1. trying to run copy of esp-idf\examples\bluetooth\bt_discovery. Using idf.py. menuconfig and build seem to run.

  2. I get error "app_main enable controller failed: ESP_ERR_INVALID_ARG"

  3. BT choices in menuconfig in two pictures

  4. "Menuconfig" presents slighty different choices than those in the bt_discovery\README.rst.
    (nowhere can I see where to not choose "release DRAM from classic BT Controller" as README suggests)

  5. so I look at esp-dif\examples\bluetooth\bt_discover\sdkconfig.defaults
    and found which was different than what menuconfig had generated.
    CONFIG_BT_ENABLED=y
    CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= ns
    CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y
    CONFIG_BTDM_CONTROLLER_MODE_BTDM=
    CONFIG_CLASSIC_BT_ENABLED=y
    CONFIG_A2DP_ENABLE=n
    CONFIG_GATTS_ENABLE=n
    CONFIG_GATTC_ENABLE=n
    CONFIG_BLE_SMP_ENABLE=n

  6. So I changed SDK for my copy. Most of the relvant bits are below.

CONFIG_BT_ENABLED=y

CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY is not set

CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y

CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set

CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN=2
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN=0
CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=2
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0=y

CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1 is not set

CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0
CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y

CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set

CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y
CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG=y

CONFIG_BTDM_MODEM_SLEEP_MODE_EVED is not set

CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL=y
CONFIG_BLUEDROID_ENABLED=y
CONFIG_BLUEDROID_PINNED_TO_CORE_0=y

CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set

CONFIG_BLUEDROID_PINNED_TO_CORE=0
CONFIG_BTC_TASK_STACK_SIZE=8000

CONFIG_BLUEDROID_MEM_DEBUG is not set

CONFIG_CLASSIC_BT_ENABLED=y

CONFIG_A2DP_ENABLE is not set

CONFIG_BT_SPP_ENABLED=y

btcontroller
Bluedroid
esp_err

@chegewara
Copy link
Collaborator

@rexzz You want to use classic BT, but this library is to work with BLE. So what is your problem?

@chegewara
Copy link
Collaborator

I think that in esp-idf version you are using some menuconfig values changed its names. Most likely this one:
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/BLEDevice.cpp#L350
CLASSIC_BT_ENABLED is now CONFIG_CLASSIC_BT_ENABLED

@rexzz
Copy link
Author

rexzz commented Aug 21, 2019

thanks chegewara. You are right. I realize the library is 95% BLE. Still that fragment for was for classic BT and I got it to work (after tweaking a few things).

@ghost
Copy link

ghost commented May 5, 2020

@rexzz it will be helpful if you show us what things you tweak to make it work!.

@rexzz
Copy link
Author

rexzz commented May 24, 2020

hi @hassance3. sorry not to respond earlier. give me a couple weeks to find what I did last year. it's definitely NOT pretty.

@rexzz
Copy link
Author

rexzz commented Jun 21, 2020

hey @hassance3 - I'm still not sure what I was up to last year. (I found something but I couldn't get it to work). Meanwhile take a look at https://github.com/AntorFr/ClassicBTScan . I was following him last year. I notice he updated recently. I haven't tried as I've gone in 'a different direction'

@ghost
Copy link

ghost commented Jun 22, 2020

@rexzz Thank you, it's work, my building script copy the wrong sdkconfig, so after cloning new IDF, using command line to build it's work, for Classic and BLE.

Thank you.

me-no-dev pushed a commit to espressif/arduino-esp32 that referenced this issue Jul 29, 2021
CLASSIC_BT_ENABLED never worked as was incorrectly named, e.g. see
nkolban/esp32-snippets#890 (comment)
Now corrected to the update-to-date name CONFIG_BT_CLASSIC_ENABLED.
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

2 participants