espressif / esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
Other
675 stars 158 forks source link

ESP32-C3 esp_ble_gattc_write_char, The connection not created #302

Closed monkey-qiu closed 9 months ago

monkey-qiu commented 9 months ago

ESP32-C3 IDF5.1 蓝牙5.0主从一体模式,ESP 设备作为client连接一个server,然后ESP设备的server被app主机连接,当app和server的连接断开是,会上报ESP_GATTS_DISCONNECT_EVT 和 ESP_GATTC_DISCONNECT_EVT两个事件,然后ESP设备作为client向server发送数据时报未建立连接  I (112345) GATTC_COEX: Gattc_Read_Time = 112346ms, client_s end_cnt = 16, client_recv_cnt = 0,client_sendlose_cnt = 0 W (116605) BT_APPL: gattc_conn_cb: if=4 st=0 id=260 rsn=0x13 W (116605) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x13 I (116605) GATTC_GATTS_COEX: ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x13 I (116615) GATTC_GATTS_COEX: ESP_GATTC_DISCONNECT_EVT, reason = 19  I (116615) GATTC_GATTS_COEX: ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, status = 0 I (117345) GATTC_COEX: start write = 117345ms  W (117345) BT_LOG: esp_ble_gattc_write_char, The connection not created. I (117345) GATTC_COEX: Gattc_Read_Time = 117347ms, client_send_cnt = 16, client_recv_cnt = 0,client_sendlose_cnt = 1 I (122355) GATTC_COEX: start write = 122355ms  W (122355) BT_LOG: esp_ble_gattc_write_char, The connection not created. I (122355) GATTC_COEX: Gattc_Read_Time = 122357ms, client_send_cnt = 16, client_recv_cnt = 0,client_sendlose_cnt = 2

mantriyogesh commented 9 months ago
  1. Full logs please.

ESP : full log from flashing. Host: dmesg from boot, commands fired with their output, btmon log If you have Bluetooth sniffer capture, will be fast to locate the issue.

  1. What is the host: MCU or Linux? version?
monkey-qiu commented 9 months ago
  1. Full logs please.

ESP : full log from flashing. Host: dmesg from boot, commands fired with their output, btmon log If you have Bluetooth sniffer capture, will be fast to locate the issue.

  1. What is the host: MCU or Linux? version?

E (6525) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: 963cad4 task_wdt: - IDLE (CPU 0) E (6525) task_wdt: Tasks currently running: E (6525) task_wdt: CPU 0: throughput_clie E (6525) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x4200913c RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000074 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
ESP-ROM:esp32c3-api1-20210207 Build:Feb 7 2021 rst:0x1 (POWERON),boot:0xf (SPI_FAST_FLASH_BO OT) SPIWP:0xee mode:DIO, clock div:1 load:0x3fcd5820,len:0x170c load:0x403cc710,len:0x968 load:0x403ce710,len:0x2f68 entry 0x403cc710 I (30) boot: ESP-IDF v5.1.1-dirty 2nd stage bootloader I (30) boot: compile time Nov 23 2023 09:12:32 I (30) boot: chip revision: v0.3 I (34) boot.esp32c3: SPI Speed : 80MHz I (39) boot.esp32c3: SPI Mode : DIO I (43) boot.esp32c3: SPI Flash Size : 2MB I (48) boot: Enabling RNG early entropy source... I (53) boot: Partition Table: I (57) boot: ## Label Usage Type ST Offset Length I (64) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (72) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (79) boot: 2 factory factory app 00 00 00010000 00100000 I (87) boot: End of partition table I (91) esp_image: segment 0: paddr=00010020 vaddr=3c0a0020 size=23110h (143632) map I (122) esp_image: segment 1: paddr=00033138 vaddr=3fc90800 size=02124h ( 8484) load I (124) esp_image: segment 2: paddr=00035264 vaddr=40380000 size=0adb4h ( 44468) load I (136) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=91ea8h (597672) map I (232) esp_image: segment 4: paddr=000d1ed0 vaddr=4038adb4 size=05a18h ( 23064) load I (242) boot: Loaded app from partition at offset 0x10000 I (242) boot: Disabling RNG early entropy source... I (253) cpu_start: Unicore app I (253) cpu_start: Pro cpu up. I (262) cpu_start: Pro cpu start user code I (262) cpu_start: cpu freq: 160000000 Hz I (262) cpu_start: Application information: I (265) cpu_start: Project name: gattc_gatts_coex I (271) cpu_start: App version: v5.1.1-dirty I (276) cpu_start: Compile time: Dec 15 2023 14:56:04 I (282) cpu_start: ELF file SHA256: 4570852ab15bfa94... I (288) cpu_start: ESP-IDF: v5.1.1-dirty I (294) cpu_start: Min chip rev: v0.3 I (298) cpu_start: Max chip rev: v0.99  I (303) cpu_start: Chip rev: v0.3 I (308) heap_init: Initializing. RAM available for dynamic allocation: I (315) heap_init: At 3FC97060 len 000456B0 (277 KiB): DRAM I (321) heap_init: At 3FCDC710 len 00002950 (10 KiB): STACK/DRAM I (328) heap_init: At 50000010 len 00001FD8 (7 KiB): RTCRAM I (335) spi_flash: detected chip: generic I (339) spi_flash: flash io: dio W (343) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header. I (356) sleep: Configure to isolate all GPIO pins in sleep state I (363) sleep: Enable automatic switching of GPIO sleep configuration I (370) coexist: coex firmware version: 80b0d89 I (375) coexist: coexist rom version 9387209 I (380) app_start: Starting scheduler on CPU0 I (385) main_task: Started on CPU0 I (385) main_task: Calling app_main() I (395) BLE_INIT: BT controller compile version [963cad4] I (395) phy_init: phy_version 970,1856f88,May 10 2023,17:44:12 I (465) BLE_INIT: Bluetooth MAC: 58:cf:79:18:a3:d6  I (475) GATTC_GATTS_COEX: ESP_GATTS_REG_EVT I (485) GATTC_GATTS_COEX: The number handle = 8 I (485) GATTC_GATTS_COEX: SERVICE_START_EVT, status 0, service_handle 40  I (485) GATTC_GATTS_COEX: ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT status 0 I (495) GATTC_GATTS_COEX: ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT status 0 I (505) GATTC_GATTS_COEX: ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, status = 0 I (515) GATTC_GATTS_COEX: REG_EVT

 I (515) GATTC_GATTS_COEX: Scan start success I (515) GATTC_GATTS_COEX: legacy adv, adv type 0x10 data len 31 I (525) main_task: Returned from app_main() I (525) GATTC_GATTS_COEX: legacy adv, adv type 0x10 data len 31 I (535) GATTC_GATTS_COEX: extend adv, adv type 0x1 data len 103 I (565) GATTC_GATTS_COEX: extend adv, adv type 0x1 data len 89 I (565) adv addr: 84 f7 03 bb 14 da  I (565) adv name: P150-08813375C98 I (565) adv name: D I (575) GATTC_GATTS_COEX: Stop extend scan and create aux open, primary_phy 1 secondary phy 2  I (585) GATTC_GATTS_COEX: legacy adv, adv type 0x10 data len 31 I (585) GATTC_GATTS_COEX: legacy adv, adv type 0x10 data len 31 I (595) GATTC_GATTS_COEX: Stop extend scan successfully W (3595) BT_HCI: hcif disc complete: hdl 0x3, rsn 0x3e W (6395) BT_HCI: hcif disc complete: hdl 0x3, rsn 0x3e E (6515) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: [0;31 mE (6515) task_wdt: - IDLE (CPU 0) E (6515) task_wdt: Tasks currently running: E (6515) task_wdt: CPU 0: throughput_clie E (6515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x4200913c RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
I (7995) GATTC_GATTS_COEX: ESP_GATTS_CONNECT_EVT [0 ;32mI (7995) GATTC_GATTS_COEX: ESP_GATTC_CONNECT_EVT conn_id 0, if 4  I (7995) GATTC_GATTS_COEX: REMOTE BDA: I (8005) GATTC_GATTS_COEX: 84 f7 03 bb 14 da  I (8005) GATTC_GATTS_COEX: open success  E (11515) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: [0;3 1mE (11515) task_wdt: - IDLE (CPU 0) E (11515) task_wdt: Tasks currently running: E (11515) task_wdt: CPU 0: throughput_clie E (11515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x42009134 RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
E (16515) task_wdt: Task watchdog got triggered. The foll owing tasks/users did not reset the watchdog in time: E (16515) task_wdt: - IDLE (CPU 0) E (16515) task_wdt: Tasks currently running: E (16515) task_wdt: CPU 0: throughput_clie E (16515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x42009134 RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
E (21515) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: [0;3 1mE (21515) task_wdt: - IDLE (CPU 0) E (21515) task_wdt: Tasks currently running: E (21515) task_wdt: CPU 0: throughput_clie E (21515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x42009134 RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
E (26515) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: [0;3 1mE (26515) task_wdt: - IDLE (CPU 0) E (26515) task_wdt: Tasks currently running: E (26515) task_wdt: CPU 0: throughput_clie E (26515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x42009134 RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
E (31515) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: [0;3 1mE (31515) task_wdt: - IDLE (CPU 0) E (31515) task_wdt: Tasks currently running: E (31515) task_wdt: CPU 0: throughput_clie E (31515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x4200913c RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
E (36515) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: [0;3 1mE (36515) task_wdt: - IDLE (CPU 0) E (36515) task_wdt: Tasks currently running: E (36515) task_wdt: CPU 0: throughput_clie E (36515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x42009138 RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x3fc94000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
I (39995) GATTC_GATTS_COEX: discover service complete conn_id 0  I (39995) GATTC_GATTS_COEX: SEARCH RES: con n_id = 0 is primary service 1  I (40005) GATTC_GATTS_COEX: start handle 71 end handle 65535 current handle value 71  I (40005) GATTC_GATTS_COEX: service found  I (40015) GATTC_GATTS_COEX: UUID16: ee  I (40015) GATTC_GATTS_COEX: Get service information from remote device  I (40025) GATTC_GATTS_COEX: ESP_GATTC_SEARCH_CMPL_EVT  I (40035) GATTC_GATTS_COEX: ESP_GATTC_REG_FOR_NOTIFY_EVT  I (40795) GATTC_GATTS_COEX: ESP_GATTC_CFG_MTU_EVT, Status 0, MTU 500, conn_id 0  E (41515) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time: [0;3 1mE (41515) task_wdt: - IDLE (CPU 0) E (41515) task_wdt: Tasks currently running: E (41515) task_wdt: CPU 0: throughput_clie E (41515) task_wdt: Print CPU 0 (current core) registers Core 0 register dump: MEPC : 0x42009138 RA : 0x42008f28 SP : 0x3fcaa170 GP : 0x3fc91000
TP : 0x3fc879c4 T0 : 0x00000000 T1 : 0x00000000 T2 : 0x00000000
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x00000001 A1 : 0x00000001
A2 : 0x00000072 A3 : 0x00000004 A4 : 0x00000001 A5 : 0x3fc94000
A6 : 0x00000000 A7 : 0x00000000 S2 : 0x00000000 S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00000000 T4 : 0x00000000 T5 : 0x00000000 T6 : 0x00000000
MSTATUS : 0x00000000 MTVEC : 0x00000000 MCAUSE : 0x42008f12 MTVAL : 0x00000000
MHARTID : 0x00000000
I (42795) GATTC_GATTS_COEX: write descr success  I (42795) GATTC_COEX: start write = 42803ms  [0;32 mI (42795) GATTC_COEX: Gattc_Read_Time = 42804ms, client_send_cnt = 1, client_recv_cnt = 0,client_sendlose_cnt = 0 I (43595) GATTC_COEX: end write = 43602ms   I (43595) GATTC_GATTS_COEX: write char success  I (43595) GATTC_COEX: end write = 43603ms  I (43605) GATTC_GATTS_COEX: write char success  I (44395) GATTC_GATTS_COEX: ESP_GATTC_NOTIFY_EVT, receive notify value: I (44395) GATTC_GATTS_COEX: 61 78 00 00 10 00 00 00 01 00 01 00 00 09 23 00  I (44405) GATTC_GATTS_COEX: 74 65 73 74 65 73 70 33 32 00 01 02 03 04 05 06  I (44405) GATTC_GATTS_COEX: 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16  I (44415) GATTC_GATTS_COEX: 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22  I (47805) GATTC_COEX: start write = 47805ms  [0;3 2mI (47805) GATTC_COEX: end write = 47807ms  I (47805) GATTC_GATTS_COEX: write char success  I (47805) GATTC_COEX: Gattc_Read_Time = 47810ms, client_send_cnt = 2, client_recv_cnt = 0,client_sendlose_cnt = 0 I (48395) GATTC_GATTS_COEX: ESP_GATTC_NOTIFY_EVT, receive notify value: I (48395) GATTC_GATTS_COEX: 61 78 00 00 10 00 00 00 01 00 01 43 00 09 23 00  I (48405) GATTC_GATTS_COEX: 74 65 73 74 65 73 70 33 32 00 01 02 03 04 05 06  I (48405) GATTC_GATTS_COEX: 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16  I (48415) GATTC_GATTS_COEX: 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22  I (52815) GATTC_COEX: start write = 52815ms  [0;3 2mI (52815) GATTC_COEX: end write = 52817ms  I (52815) GATTC_GATTS_COEX: write char success  I (52815) GATTC_COEX: Gattc_Read_Time = 52820ms, client_send_cnt = 3, client_recv_cnt = 0,client_sendlose_cnt = 0 I (53595) GATTC_GATTS_COEX: ESP_GATTC_NOTIFY_EVT, receive notify value: I (53595) GATTC_GATTS_COEX: 61 78 00 00 10 00 00 00 01 00 01 43 00 09 23 00  I (53605) GATTC_GATTS_COEX: 74 65 73 74 65 73 70 33 32 00 01 02 03 04 05 06  I (53605) GATTC_GATTS_COEX: 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16  I (53615) GATTC_GATTS_COEX: 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22  I (55315) GATTC_GATTS_COEX: ESP_GAP_BLE_ADV_TERMINATED_EVT, status = 0 I (55315) GATTC_GATTS_COEX: ADV succes sfully ended with a connection being created I (55365) GATTC_GATTS_COEX: ESP_GATTS_CONNECT_EVT I (55365) GATTC_GATTS_COEX: ESP_GATTC_CONNECT_EVT conn_id 1, if 4  I (55365) GATTC_GATTS_COEX: REMOTE BDA: I (55375) GATTC_GATTS_COEX: 74 1d ae 4c 7c ed  I (57825) GATTC_COEX: start write = 57825ms  [0;3 2mI (57825) GATTC_COEX: Gattc_Read_Time = 57826ms, client_send_cnt = 4, client_recv_cnt = 0,client_sendlose_cnt = 0 I (62825) GATTC_COEX: start write = 62825ms  [0;3 2mI (62825) GATTC_COEX: Gattc_Read_Time = 62825ms, client_send_cnt = 5, client_recv_cnt = 0,client_sendlose_cnt = 0 I (67825) GATTC_COEX: start write = 67825ms  [0;3 2mI (67825) GATTC_COEX: Gattc_Read_Time = 67825ms, client_send_cnt = 6, client_recv_cnt = 0,client_sendlose_cnt = 0 I (72825) GATTC_COEX: start write = 72825ms  [0;3 2mI (72825) GATTC_COEX: Gattc_Read_Time = 72825ms, client_send_cnt = 7, client_recv_cnt = 0,client_sendlose_cnt = 0 I (77825) GATTC_COEX: start write = 77825ms  [0;3 2mI (77825) GATTC_COEX: Gattc_Read_Time = 77825ms, client_send_cnt = 8, client_recv_cnt = 0,client_sendlose_cnt = 0 I (82825) GATTC_COEX: start write = 82825ms  [0;3 2mI (82825) GATTC_COEX: Gattc_Read_Time = 82825ms, client_send_cnt = 9, client_recv_cnt = 0,client_sendlose_cnt = 0 I (87825) GATTC_COEX: start write = 87825ms  [0;3 2mI (87825) GATTC_COEX: Gattc_Read_Time = 87825ms, client_send_cnt = 10, client_recv_cnt = 0,client_sendlose_cnt = 0 W (87945) BT_APPL: gattc_conn_cb: if=4 st=0 id=260 rsn=0x13 W (87945) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x13 I (87945) GATTC_GATTS_COEX: ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x13 I (87955) GATTC_GATTS_COEX: ESP_GATTC_DISCONNECT_EVT, reason = 19  I (87965) GATTC_GATTS_COEX: ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, status = 0 I (92825) GATTC_COEX: start write = 92825ms  [0;3 3mW (92825) BT_LOG: esp_ble_gattc_write_char, The connection not created. I (92825) GATTC_COEX: Gattc_Read_Time = 92827ms, client_send_cnt = 10, client_recv_cnt = 0,client_sendlose_cnt = 1 I (97835) GATTC_COEX: start write = 97835ms  [0;3 3mW (97835) BT_LOG: esp_ble_gattc_write_char, The connection not created. I (97835) GATTC_COEX: Gattc_Read_Time = 97837ms, client_send_cnt = 10, client_recv_cnt = 0,client_sendlose_cnt = 2

我这边环境如下: 1、一个APP作为client,一个MCU带有 ESP32-C3芯片作为server,一个 ESP32-C3-DevKitC-02v1.1作为蓝牙主从一体(ble50_gattc_gattx_coex)模式 2、上面日志是ESP32-C3-DevKitC的日志 3、首先ESP32-C3-DevKitC的client连接MCU的ESP32-C3蓝牙的server并持续发送数据,server接收数据并答复 4、APP作为client连接ESP32-C3-DevKitC的server 5、当APP和ESP32-C3-DevKitC的server的连接断开时,ESP32-C3-DevKitC向ESP32-C3的server发送数据提示esp_ble_gattc_write_char, The connection not created 6、从错误看,主从一体的某个连接断开,导致其他连接也无法发送数据

mantriyogesh commented 9 months ago

This doesn't look like ESP-Hosted issue, as you are experiencing the problem in ESP-IDF API.

I suspect you have issue with ESP-IDF example and also able to see the issue is already created/open on https://github.com/espressif/esp-idf/issues/12803

If nothing is to be done from ESP-Hosted perspective, we can close this issue?

monkey-qiu commented 9 months ago

This doesn't look like ESP-Hosted issue, as you are experiencing the problem in ESP-IDF API.

I suspect you have issue with ESP-IDF example and also able to see the issue is already created/open on espressif/esp-idf#12803

If nothing is to be done from ESP-Hosted perspective, we can close this issue?

那我应该用那个版本的IDF,我的idf版本是5.1

mantriyogesh commented 9 months ago

Are you using ESP-Hosted?

Can you please explain, in block diagram, how you are using ESP-Hosted?

monkey-qiu commented 9 months ago

Are you using ESP-Hosted?

Can you please explain, in block diagram, how you are using ESP-Hosted?

windows 版本,离线模式安装的IDF,Visual Studio Code进行编译 下载地址:https://dl.espressif.cn/dl/esp-idf/

mantriyogesh commented 9 months ago

Which firmware do you flash?

Which directory or folder you run idf.py flash monitor?

monkey-qiu commented 9 months ago

Which firmware do you flash?

Which directory or folder you run idf.py flash monitor?

目录:\Espressif\frameworks\esp-idf-v5.1.1\examples\bluetooth\bluedroid\ble_50\ble50_gattc_gattx_coex demo是乐鑫同事给的一个,因为官方没有蓝牙5.0主从一体的demo,有需要的话我可以把demo发给你进行验证哦

mantriyogesh commented 9 months ago

Yes. Okay.

ESP-Hosted supports master and slave. If you wish to try ESP as slave and ESP as master, we are already developing ESP-Hosted based solution, but it is in development yet. https://github.com/espressif/esp-hosted/tree/feature/esp_as_mcu_host

Here for now, Wi-Fi is only yet supported. Bluetooth is expected to support in a month or so.

But the issue you had raised is ESP-IDF (code) specific, which is already open. So for now, we cannot do much on this.

monkey-qiu commented 9 months ago

Yes. Okay.

ESP-Hosted supports master and slave. If you wish to try ESP as slave and ESP as master, we are already developing ESP-Hosted based solution, but it is in development yet. https://github.com/espressif/esp-hosted/tree/feature/esp_as_mcu_host

Here for now, Wi-Fi is only yet supported. Bluetooth is expected to support in a month or so.

But the issue you had raised is ESP-IDF (code) specific, which is already open. So for now, we cannot do much on this.

好的,谢谢你