gatt server examples

HITMAnsOFT
Posts: 10
Joined: Fri May 05, 2017 6:53 pm

gatt server examples

Postby HITMAnsOFT » Sat May 06, 2017 3:51 pm

Hi,

Has anyone tried running any of the gatt server examples lately(gatt_security_server, gatt_server, gatt_server_service_table)? The advertisement works as expected, but the service discovery fails and the device disconnects. I've tried different Android apps(b-ble, , none of them shows the available services.

I've tried both the master and v2.0 release branches, same behaviour.

Can anyone please help me debug the problem?

Update: this problem occurs only with my Android 6.0.1 device. Another phone (4.4.4) connects successfully. However I need it to work with the former. The problem is not with the phone, as I have a Nordic board that works with them both.

Here is the serial log on Debug verbosity for gatt_server example:

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:4412
ho 0 tail 12 room 4
load:0x40078000,len:11092
load:0x40080000,len:252
entry 0x40080034
I (48) boot: ESP-IDF v2.0-rc1-761-g65acd99c 2nd stage bootloader
I (48) boot: compile time 19:47:23
I (49) boot: Enabling RNG early entropy source...
I (66) boot: SPI Speed      : 80MHz
I (79) boot: SPI Mode       : DIO
I (91) boot: SPI Flash Size : 4MB
I (104) boot: Partition Table:
I (115) boot: ## Label            Usage          Type ST Offset   Length
I (138) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (161) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (184) boot:  2 factory          factory app      00 00 00010000 00100000
I (208) boot: End of partition table
I (221) boot: Disabling RNG early entropy source...
I (238) boot: Loading app partition at offset 00010000
I (1142) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512) 
I (1142) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x28728 (165672) map
I (1159) boot: segment 2: paddr=0x00048738 vaddr=0x3ffc0000 size=0x02400 (  9216) load
I (1187) boot: segment 3: paddr=0x0004ab40 vaddr=0x40080000 size=0x00400 (  1024) load
I (1212) boot: segment 4: paddr=0x0004af48 vaddr=0x40080400 size=0x13290 ( 78480) load
I (1261) boot: segment 5: paddr=0x0005e1e0 vaddr=0x400c0000 size=0x00000 (     0) load
I (1265) boot: segment 6: paddr=0x0005e1e8 vaddr=0x00000000 size=0x01e20 (  7712) 
I (1290) boot: segment 7: paddr=0x00060010 vaddr=0x400d0018 size=0x62218 (401944) map
I (1316) cpu_start: Pro cpu up.
I (1328) cpu_start: Starting app cpu, entry point is 0x40080f18
I (0) cpu_start: App cpu up.
I (1361) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (1383) heap_alloc_caps: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (1403) heap_alloc_caps: At 3FFCD1C8 len 00012E38 (75 KiB): DRAM
I (1424) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1446) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1467) heap_alloc_caps: At 40093690 len 0000C970 (50 KiB): IRAM
I (1488) cpu_start: Pro cpu start user code
D (1525) clk: RTC_SLOW_CLK calibration value: 3377626
D (1555) intr_alloc: Connected src 56 to int 2 (cpu 0)
D (1557) intr_alloc: Connected src 16 to int 3 (cpu 0)
D (1558) intr_alloc: Connected src 24 to int 12 (cpu 0)
I (1595) cpu_start: Starting scheduler on PRO CPU.
BTDM CON282LLER VERSION: Connec
dbsrc start
nt 2 .data from 4
                 I (3f2) cp0, len 000tarting schedule0x0 from 3PUb8000 to 3ffbff70, len 00007f70
BTDM ROM VERSION 0101                                                                                                                                                                        
BD_ADDR: 24:0A:C4:03:E7:DA                                                                                                                                                                   
NVDS MAGIC FAILED                                                                                                                                                                            
RF Init OK with coex                                                                                                                                                                         
D (522) phy_init: loading PHY init data from application binary                                                                                                                              
D (522) nvs: nvs_flash_init_custom start=9 count=6
D (542) nvs: nvs_open phy 0
D (542) nvs: nvs_get cal_version 4
D (542) nvs: nvs_get_str_or_blob cal_mac
D (542) nvs: nvs_get_str_or_blob cal_data
D (552) nvs: nvs_close 1
I (572) phy: phy_version: 350, Mar 22 2017, 15:02:06, 0, 0
Enable Classic BT
Enable Low Energy
D (572) nvs: nvs_open bt_config.conf 1
D (572) nvs: nvs_get_str_or_blob bt_cfg_key
D (582) nvs: nvs_close 2
D (582) nvs: nvs_open bt_config.conf 1
D (582) nvs: nvs_set_blob bt_cfg_key 216
D (592) nvs: nvs_close 3
E (592) BT: Startup BTU

E (592) BT: L2CA_RegisterFixedChannel()  CID: 0x0004, 0x3ffd7ad0
E (602) BT: GATTS_CreateService:  handle of service handle1
E (612) BT: L2CA_RegisterFixedChannel()  CID: 0x0006, 0x3ffd7ab0
E (612) BT: osi_mem_dbg_clean full future_free 98 !!

E (622) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (622) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (632) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (642) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (642) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (652) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (652) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (662) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (672) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (672) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (682) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (682) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (692) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (702) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (702) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (712) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (712) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (722) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (722) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (732) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (742) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (742) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (752) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (752) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (762) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (772) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (772) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (782) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (782) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (792) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (792) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (802) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (812) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (812) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (822) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (832) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (832) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (842) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (842) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (852) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (852) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (862) BT: #####################################num_lm_ble_bufs = 10
E (872) BT: bta_dm_co_ble_load_local_keys: func not ported

E (872) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (892) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (892) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (892) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (902) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (902) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (912) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (922) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (922) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (932) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (932) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (942) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (942) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (952) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

I (962) GATTS_DEMO: REGISTER_APP_EVT, status 0, app_id 0

I (962) GATTS_DEMO: REGISTER_APP_EVT, status 0, app_id 1

E (972) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (972) BT: Partial data write into ADV
I (982) GATTS_DEMO: CREATE_SERVICE_EVT, status 0,  service_handle 40

I (992) GATTS_DEMO: CREATE_SERVICE_EVT, status 0,  service_handle 44

E (992) BT: ####################adv_type = 0
I (1002) GATTS_DEMO: Stop adv successfully

I (1002) GATTS_DEMO: SERVICE_START_EVT, status 0, service_handle 40

I (1012) GATTS_DEMO: ADD_CHAR_EVT, status 0,  attr_handle 42, service_handle 40

I (1022) GATTS_DEMO: the gatts demo char length = 3

I (1022) GATTS_DEMO: prf_char[0] =11

I (1032) GATTS_DEMO: prf_char[1] =22

I (1032) GATTS_DEMO: prf_char[2] =33

I (1042) GATTS_DEMO: SERVICE_START_EVT, status 0, service_handle 44

I (1042) GATTS_DEMO: ADD_CHAR_EVT, status 0,  attr_handle 46, service_handle 44

I (1052) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 43, service_handle 40

I (1062) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 47, service_handle 44

E (1072) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (1082) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (1082) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (1092) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

D (3962) nvs: nvs_open bt_config.conf 1
D (3962) nvs: nvs_set_blob bt_cfg_key 216
D (3962) nvs: nvs_close 4
E (15392) BT: BLE HCI(id=62) event = 0x0a)
E (15392) BT: status = 0, handle = 0, role = 1, bda_type = 1
E (15392) BT: btm_ble_resolve_random_addr_on_conn_cmpl unable to match and resolve random address
E (15402) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

I (15402) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 5a:52:c0:16:44:78:, is_conn 1

I (15412) GATTS_DEMO: SERVICE_START_EVT, conn_id 0, remote 5a:52:c0:16:44:78:, is_conn 1

D (18422) nvs: nvs_open bt_config.conf 1
D (18422) nvs: nvs_set_blob bt_cfg_key 216
D (18422) nvs: nvs_close 5
E (35482) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (35482) BT: gatt_disc_cmpl_cback() - Register for service changed indication failure
E (35482) BT: btm_sec_disconnected clearing pending flag handle:0 reason:8

E (35492) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (35492) BT: ####################adv_type = 0
E (35502) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (35502) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

I (35512) GATTS_DEMO: Stop adv successfully

D (38492) nvs: nvs_open bt_config.conf 1
D (38492) nvs: nvs_set_blob bt_cfg_key 216
D (38492) nvs: nvs_close 6
E (50092) BT: BLE HCI(id=62) event = 0x0a)
E (50092) BT: status = 0, handle = 0, role = 1, bda_type = 1
E (50092) BT: btm_ble_resolve_random_addr_on_conn_cmpl unable to match and resolve random address
E (50102) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

I (50102) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 5a:52:c0:16:44:78:, is_conn 1

I (50112) GATTS_DEMO: SERVICE_START_EVT, conn_id 0, remote 5a:52:c0:16:44:78:, is_conn 1

D (53122) nvs: nvs_open bt_config.conf 1
D (53122) nvs: nvs_set_blob bt_cfg_key 216
D (53122) nvs: nvs_close 7
E (70272) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (70272) BT: gatt_disc_cmpl_cback() - Register for service changed indication failure
E (70272) BT: btm_sec_disconnected clearing pending flag handle:0 reason:8

E (70282) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (70282) BT: ####################adv_type = 0
E (70292) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

E (70292) BT: osi_mem_dbg_clean full GKI_freebuf 229 !!

I (70302) GATTS_DEMO: Stop adv successfully

D (73282) nvs: nvs_open bt_config.conf 1
D (73282) nvs: nvs_set_blob bt_cfg_key 216
D (73282) nvs: nvs_close 8
Regards,
Arthur

Who is online

Users browsing this forum: No registered users and 92 guests