esp-iot-solution
esp-iot-solution copied to clipboard
issue with example ble_anp code ! (AEGHB-1028)
Answers checklist.
- [x] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- [x] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- [x] I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
i was trying to run example code of ble_enp but it has few issues :
-
it starts as a gatt client and try to discover for nearby devices instead of being advertised to other devices so other devices can connect to it manually like mobile phone.
-
if i try to use "CONFIG_BLE_CONN_MGR_ROLE_BOTH=y" then it starts advertising itself but it gives errors about some characteristics. also when i try to give command which is given as example output in readme.md file it gives error "Invalid option".
board im using : esp32 devkitc
log messages for better understanding :
PS C:\Users\mayur\esp\workspace\ble_anp> $env:IDF_PATH = 'C:\Users\mayur\esp\v5.4\esp-idf'; PS C:\Users\mayur\esp\workspace\ble_anp> & 'C:\Users\mayur.espressif\python_env\idf5.4_py3.11_env\Scripts\python.exe' 'C:\Users\mayur\esp\v5.4\esp-idf\tools\idf_monitor.py' -p COM5 -b 115200 --toolchain-prefix xtensa-esp32-elf- --make '''C:\Users\mayur.espressif\python_env\idf5.4_py3.11_env\Scripts\python.exe'' ''C:\Users\mayur\esp\v5.4\esp-idf\tools\idf.py''' --target esp32 'c:\Users\mayur\esp\workspace\ble_anp\build\ble_anp.elf' --- Warning: GDB cannot open serial ports accessed as COMx --- Using \.\COM5 instead... --- esp-idf-monitor 1.5.0 on \.\COM5 115200 --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ����������������������������������������������������������������0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:6276 load:0x40078000,len:15716 load:0x40080400,len:4 --- 0x40080400: _init at ??:?
ho 8 tail 4 room 4
load:0x40080404,len:3860
entry 0x4008063c
I (31) boot: ESP-IDF v5.4 2nd stage bootloader
I (31) boot: compile time Mar 24 2025 15:19:43
I (31) boot: Multicore bootloader
I (32) boot: chip revision: v3.1
I (35) boot.esp32: SPI Speed : 40MHz
I (39) boot.esp32: SPI Mode : DIO
I (42) boot.esp32: SPI Flash Size : 4MB
I (46) boot: Enabling RNG early entropy source...
I (50) boot: Partition Table:
I (53) boot: ## Label Usage Type ST Offset Length
I (59) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (66) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (72) boot: 2 factory factory app 00 00 00010000 00100000
I (79) boot: End of partition table
I (82) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=13b60h ( 80736) map
I (117) esp_image: segment 1: paddr=00023b88 vaddr=3ff80000 size=0001ch ( 28) load
I (118) esp_image: segment 2: paddr=00023bac vaddr=3ffbdb60 size=04cb8h ( 19640) load
I (128) esp_image: segment 3: paddr=0002886c vaddr=40080000 size=077ach ( 30636) load
I (141) esp_image: segment 4: paddr=00030020 vaddr=400d0020 size=62e5ch (405084) map
I (279) esp_image: segment 5: paddr=00092e84 vaddr=400877ac size=11304h ( 70404) load
I (319) boot: Loaded app from partition at offset 0x10000
I (319) boot: Disabling RNG early entropy source...
I (329) cpu_start: Multicore app
I (338) cpu_start: Pro cpu start user code
I (338) cpu_start: cpu freq: 160000000 Hz
I (338) app_init: Application information:
I (338) app_init: Project name: ble_anp
I (342) app_init: App version: 1
I (345) app_init: Compile time: Mar 24 2025 15:19:12
I (350) app_init: ELF file SHA256: 09611c82c...
I (355) app_init: ESP-IDF: v5.4
I (358) efuse_init: Min chip rev: v0.0
I (362) efuse_init: Max chip rev: v3.99
I (366) efuse_init: Chip rev: v3.1
I (370) heap_init: Initializing. RAM available for dynamic allocation:
I (376) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (381) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (386) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (392) heap_init: At 3FFC59B0 len 0001A650 (105 KiB): DRAM
I (397) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (402) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (408) heap_init: At 40098AB0 len 00007550 (29 KiB): IRAM
I (415) spi_flash: detected chip: generic
I (417) spi_flash: flash io: dio
I (421) coexist: coex firmware version: 49a8cdc
I (425) main_task: Started on CPU0
I (435) main_task: Calling app_main()
This is an example of profile component. Type 'help' to get the list of commands. Use UP/DOWN arrows to navigate through command history. Press TAB when typing command name to auto-complete. nress Enter or Ctrl+C will terminate the console environment. I (445) blecm_nimble: BLE Connection Management: v0.1.3
I (465) BTDM_INIT: BT controller compile version [20b459d] I (475) BTDM_INIT: Bluetooth MAC: 34:5f:45:a8:41:8e I (475) phy_init: phy_version 4840,02e0d70,Sep 2 2024,19:39:07 W (565) phy_init: saving new calibration data because of checksum failure, mode(0) I (835) blecm_nimble: BLE Host Task Started I (835) blecm_nimble: No characteristic(0x2a00) found I (835) blecm_nimble: No characteristic(0x2a01) found I (835) blecm_nimble: No characteristic(0x2a05) found I (855) blecm_nimble: No characteristic(0x2b3a) found I (855) blecm_nimble: No characteristic(0x2b29) found I (835) main_task: Returned from app_main() I (905) NimBLE: GAP procedure initiated: advertise; I (905) NimBLE: disc_mode=2 I (905) NimBLE: adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=256 adv_itvl_max=256 I (915) NimBLE:
I (925) NimBLE: GAP procedure initiated: discovery; I (925) NimBLE: own_addr_type=0 filter_policy=0 passive=1 limited=0 filter_duplicates=1 I (925) NimBLE: duration=forever I (935) NimBLE:
Your terminal application does not support escape sequences. Line editing and history features are disabled. On Windows, try using Putty instead. esp32> I (7545) NimBLE: GATT procedure initiated: discover all services
I (7555) app_main: ESP_BLE_CONN_EVENT_CONNECTED I (7605) NimBLE: GATT procedure initiated: discover all characteristics; I (7605) NimBLE: start_handle=1 end_handle=9
I (7865) NimBLE: GATT procedure initiated: discover all characteristics; I (7875) NimBLE: start_handle=20 end_handle=26
I (8045) NimBLE: GATT procedure initiated: discover all characteristics; I (8055) NimBLE: start_handle=40 end_handle=65535
I (8225) NimBLE: GATT procedure initiated: discover all descriptors; I (8225) NimBLE: chr_val_handle=42 end_handle=44
I (8405) NimBLE: GATT procedure initiated: discover all descriptors; I (8415) NimBLE: chr_val_handle=46 end_handle=65535
I (8495) blecm_nimble: Service discovery complete; rc=0, conn_handle=0 I (8505) app_main: ESP_BLE_CONN_EVENT_DISC_COMPLETE
esp32> anp -t 2 -c 3 -o 0 E (98785) blecm_nimble: Incorrect uuid 0x2a44 in sending E (98785) app_anp: Invalid option Command returned non-zero error code: 0x102 (ESP_ERR_INVALID_ARG)