BLE scanner
Posted: Tue Jun 20, 2017 3:19 pm
Hi,
I have two esp32 modules.
My goal is to send and read data via BLE from one esp32 module to another esp32 module.
I'm trying to use GATT_SERVER and GATT_CLIENT from idf examples:
https://github.com/espressif/esp-idf/tr ... att_server
https://github.com/espressif/esp-idf/tr ... att_client
I have edited in CLIENT 72 row:
and set same in SERVER 51 row:
When I'm running both modules I see that they connected:
Server side log:
CLIENT side log:
I assume that connection is done properly.
How can I read data on client side?
I have two esp32 modules.
My goal is to send and read data via BLE from one esp32 module to another esp32 module.
I'm trying to use GATT_SERVER and GATT_CLIENT from idf examples:
https://github.com/espressif/esp-idf/tr ... att_server
https://github.com/espressif/esp-idf/tr ... att_client
I have edited in CLIENT 72 row:
Code: Select all
static const char device_name[] = "SERV_MODULE";
Code: Select all
#define TEST_DEVICE_NAME "SERV_MODULE"
Server side log:
Code: Select all
[0;32mI (552) SERVER_DEMO: REGISTER_APP_EVT, status 0, app_id 0
[0m
[0;32mI (552) SERVER_DEMO: REGISTER_APP_EVT, status 0, app_id 1
[0m
[0;32mI (552) SERVER_DEMO: CREATE_SERVICE_EVT, status 0, service_handle 40
[0m
[0;32mI (562) SERVER_DEMO: CREATE_SERVICE_EVT, status 0, service_handle 44
[0m
[0;32mI (572) SERVER_DEMO: SERVICE_START_EVT, status 0, service_handle 40
[0m
[0;32mI (572) SERVER_DEMO: ADD_CHAR_EVT, status 0, attr_handle 42, service_handle 40
[0m
[0;32mI (582) SERVER_DEMO: the gatts demo char length = 3
[0m
[0;32mI (592) SERVER_DEMO: prf_char[0] =11
[0m
[0;32mI (592) SERVER_DEMO: prf_char[1] =22
[0m
[0;32mI (602) SERVER_DEMO: prf_char[2] =33
[0m
[0;32mI (602) SERVER_DEMO: SERVICE_START_EVT, status 0, service_handle 44
[0m
[0;32mI (612) SERVER_DEMO: ADD_CHAR_EVT, status 0, attr_handle 46, service_handle 44
[0m
[0;32mI (622) SERVER_DEMO: ADD_DESCR_EVT, status 0, attr_handle 43, service_handle 40
[0m
[0;32mI (622) SERVER_DEMO: ADD_DESCR_EVT, status 0, attr_handle 47, service_handle 44
[0m
[0;32mI (14832) SERVER_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 30:ae:a4:01:34:ca:, is_conn 1
[0m
[0;32mI (14832) SERVER_DEMO: SERVICE_START_EVT, conn_id 0, remote 30:ae:a4:01:34:ca:, is_conn 1
[0m
[0;32mI (14902) SERVER_DEMO: update connetion params status = 15, min_int = 30, max_int = 50, conn_int = 0,latency = 0, timeout = 400[0m
[0;31mE (15402) BT: gatt_disc_cmpl_cback() - Register for service changed indication failure[0m
[0;32mI (15452) SERVER_DEMO: update connetion params status = 13, min_int = 6, max_int = 6, conn_int = 0,latency = 0, timeout = 2000[0m
[0;32mI (15452) SERVER_DEMO: update connetion params status = 0, min_int = 6, max_int = 6, conn_int = 0,latency = 0, timeout = 2000[0m
[0;32mI (15812) SERVER_DEMO: update connetion params status = 13, min_int = 28, max_int = 28, conn_int = 0,latency = 0, timeout = 2000[0m
[0;32mI (15812) SERVER_DEMO: update connetion params status = 0, min_int = 28, max_int = 28, conn_int = 0,latency = 0, timeout = 2000[0m
Code: Select all
[0;32mI (542) CLIENT_DEMO: register callback[0m
[0;32mI (552) CLIENT_DEMO: EVT 0, gattc if 3[0m
[0;32mI (552) CLIENT_DEMO: REG_EVT[0m
[0;32mI (552) CLIENT_DEMO: EVT 0, gattc if 4[0m
[0;32mI (552) CLIENT_DEMO: REG_EVT[0m
[0;32mI (572) CLIENT_DEMO: 24 0a c4 00 17 52 [0m
[0;32mI (572) CLIENT_DEMO: Searched Adv Data Len 30, Scan Response Len 0[0m
[0;32mI (572) CLIENT_DEMO: Searched Device Name Len 18[0m
[0;32mI (582) CLIENT_DEMO: SERV_MODULE[0m
[0;32mI (582) CLIENT_DEMO: HP[0m
[0;32mI (592) CLIENT_DEMO:
[0m
[0;32mI (592) CLIENT_DEMO: Searched device SERV_MODULE
[0m
[0;32mI (602) CLIENT_DEMO: Connect to the remote device.[0m
[0;32mI (612) CLIENT_DEMO: Stop scan successfully[0m
[0;32mI (672) CLIENT_DEMO: EVT 40, gattc if 3[0m
[0;32mI (672) CLIENT_DEMO: EVT 2, gattc if 3[0m
[0;32mI (672) CLIENT_DEMO: ESP_GATTC_OPEN_EVT conn_id 0, if 3, status 0, mtu 23[0m
[0;32mI (672) CLIENT_DEMO: REMOTE BDA:[0m
[0;32mI (682) CLIENT_DEMO: 24 0a c4 00 17 52 [0m
[0;32mI (682) CLIENT_DEMO: EVT 40, gattc if 4[0m
[0;32mI (692) CLIENT_DEMO: EVT 2, gattc if 4[0m
[0;32mI (692) CLIENT_DEMO: ESP_GATTC_OPEN_EVT conn_id 0, if 4, status 0, mtu 23[0m
[0;32mI (702) CLIENT_DEMO: REMOTE BDA:[0m
[0;32mI (702) CLIENT_DEMO: 24 0a c4 00 17 52 [0m
[0;31mE (1342) BT: gatt_disc_cmpl_cback() - Register for service changed indication failure[0m
[0;32mI (1552) CLIENT_DEMO: EVT 7, gattc if 3[0m
[0;32mI (1552) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1552) CLIENT_DEMO: UUID16: 1801[0m
[0;32mI (1552) CLIENT_DEMO: EVT 7, gattc if 3[0m
[0;32mI (1552) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1562) CLIENT_DEMO: UUID16: 1800[0m
[0;32mI (1562) CLIENT_DEMO: EVT 7, gattc if 3[0m
[0;32mI (1572) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1572) CLIENT_DEMO: UUID16: ff[0m
[0;32mI (1582) CLIENT_DEMO: EVT 7, gattc if 3[0m
[0;32mI (1582) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1592) CLIENT_DEMO: UUID16: ee[0m
[0;32mI (1592) CLIENT_DEMO: EVT 6, gattc if 3[0m
[0;32mI (1592) CLIENT_DEMO: SEARCH_CMPL: conn_id = 0, status 0[0m
[0;32mI (1602) CLIENT_DEMO: EVT 7, gattc if 4[0m
[0;32mI (1602) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1612) CLIENT_DEMO: UUID16: 1801[0m
[0;32mI (1612) CLIENT_DEMO: EVT 7, gattc if 4[0m
[0;32mI (1622) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1622) CLIENT_DEMO: UUID16: 1800[0m
[0;32mI (1632) CLIENT_DEMO: EVT 7, gattc if 4[0m
[0;32mI (1632) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1642) CLIENT_DEMO: UUID16: ff[0m
[0;32mI (1642) CLIENT_DEMO: EVT 7, gattc if 4[0m
[0;32mI (1642) CLIENT_DEMO: SEARCH RES: conn_id = 0[0m
[0;32mI (1652) CLIENT_DEMO: UUID16: ee[0m
[0;32mI (1652) CLIENT_DEMO: EVT 6, gattc if 4[0m
[0;32mI (1662) CLIENT_DEMO: SEARCH_CMPL: conn_id = 0, status 0[0m
[0;32mI (1662) CLIENT_DEMO: EVT 35, gattc if 3[0m
[0;32mI (1672) CLIENT_DEMO: EVT 35, gattc if 4[0m
How can I read data on client side?