BLE gatts server example

omoh12
Posts: 4
Joined: Mon Jan 09, 2017 11:33 am

BLE gatts server example

Postby omoh12 » Mon Jan 09, 2017 11:45 am

Hi,

I am using the eps32 module WiPy2.0 (https://www.pycom.io/solutions/py-boards/wipy2/) with the gatts server example. the serial output is printing the following outputs:

...
RF Init OK with coex
E (5090) BT: app_main init bluetooth

E (5090) BT: Startup BTU

E (5110) BT: bta_dm_co_ble_load_local_keys: func not ported

E (5110) BT: status=0

E (5120) BT: REGISTER_APP_EVT, status 0, gatt_if 4, app_id 255

E (5120) BT: btc_to_bta_adv_data - In 16-UUID_data
E (5120) BT: btc_to_bta_adv_data - In 32-UUID_data
E (5120) BT: Partial data write into ADV
E (5130) BT: GAP_EVT, event 0

E (5130) BT: CREATE_SERVICE_EVT, status 0, gatt_if 4, service_handle 40

E (5140) BT: BTA_DmSetBleAdvParamsAll: 32, 64

E (5150) BT: adv_type = 0, addr_type_own = 0, chnl_map = 7, adv_fil_pol = 0

E (5150) BT: SERVICE_START_EVT, status 0, gatt_if 4, service_handle 40

E (5160) BT: ADD_CHAR_EVT, status 0, gatt_if 4, attr_handle 42, service_handle 40

E (5170) BT: ADD_DESCR_EVT, status 0, gatt_if 4, attr_handle 43, service_handle 40



Can anyone tell me what the problem is? Why there are all those errors?

I can (sometimes) see the BLE device, but I am not able to connect to it and set some notifications... :(

michaelwgnr
Posts: 26
Joined: Wed Dec 21, 2016 3:41 pm

Re: BLE gatts server example

Postby michaelwgnr » Mon Jan 09, 2017 12:31 pm

1. Errors on console
The output you see on the serial interface are mostly not errors, but just of an informational nature. Unfortunately, all the serial output from the bluetooth stack is mapped to ESP_LOGE and not to the more correct corresponding ESP_LOGD or ESP_LOGI macros.

2. Device not visible
After you successfully connected and disconnected from the device again, the device is not advertising anymore. Upon receiving ESP_GATTS_DISCONNECT_EVT you'd have to call esp_ble_gap_start_advertising again.

3. Device not connectable
The connection problem is another issue, though...

What are you using to connect to the device? Are you using an Android 5.0 device or newer? Because I could only get the example to work using iOS or Android 4.4. I tested with Android 6 and Android 7 devices and could not connect to the server.

Unfortunately I did not hear anything about this issue from Espressif, so far. :(

See my thread Bluetooth LE: Unable to connect Andorid >= 5.0 to ESP32 GATT server for reference.

omoh12
Posts: 4
Joined: Mon Jan 09, 2017 11:33 am

Re: BLE gatts server example

Postby omoh12 » Mon Jan 09, 2017 3:53 pm

2. Device not visible
Unfortunately the device is almost never visible! I already read about the connection problem with Android ... But if I can't see the device I'm also not able to connect :(

tanvipatel
Posts: 14
Joined: Mon Jan 09, 2017 12:13 pm

Re: BLE gatts server example

Postby tanvipatel » Mon Jan 23, 2017 11:13 am

omoh12 wrote:
2. Device not visible
Unfortunately the device is almost never visible! I already read about the connection problem with Android ... But if I can't see the device I'm also not able to connect :(
Use BLE Scan app or nrf connect app you will find ESP-GATTS-DEMO then try to connect your device connect with it but cannot paired ..
Thank You :)

Who is online

Users browsing this forum: Barkonet, StanInexeon and 136 guests