GATT connection timeout in DA1469x_Custom_ble_service_sample_code

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
20 posts / 0 new
Last post
prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
GATT connection timeout in DA1469x_Custom_ble_service_sample_code

Hello Dialog,

I am able to run the Custom_ble_service example. But, when I am trying to read or write data through the nrf connect app, I am getting the GATT connection time out error with in some milliseconds of time which makes me to reset the USB board again to make the connection. Could you suugest me where can I adjust the time?

另外,如果我想测试这个应用程序with two USB DA14695 boards, How can I modify the properties of the characteristics in the ble_peripheral and the ble_central examples to read and write between them through UART?

Thanks in advance.

Regards,

Prasanna

Device:
PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
Hi Prasanna,

Hi Prasanna,

Can you please indicate which characteristic are you trying to read/write? Would it be possible to share a sniffer log so that I can understand what is happening over the air?

>>How can I modify the properties of the characteristics in the ble_peripheral and the ble_central examples to read and write between them through UART?

Can you please clarify this statement? So, do you need to read data from the UART and send them over BLE to a peer device?

Thanks, PM_Dialog

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hello Dialog,

Hello Dialog,

Please find the log file attached below.

I am testing the sample example "DA1469x_custom_ble_service_sample_code" example.

1. You can see form the log file there is a continuous connection error several times and I could hardly connect only when I reset the USB. I have highlighted in the log file the errors and also when I could send the data. Almost at the end of the file you can see, I can send "hello" message to the peripheral which is printed in the UART. But, then immediately you can see the connection is lost. COuld you suggest me how can and in which parts of the code, I can adjust the delay?

2. Is there any specific intervel where the peripheral makes a connection with the requested central device so that the connection is lost when the time out happens?

3. The services and the characteristics that are discovered are displayed as "Unknown" in the central device. In which parts of the code I can change the names of services and characteristics?

4. There are two unknown services created in this specific example. The second service has three characteristics which are only readable. But, in the code, the parameter for reading is disabled in the second and the third characteristics. Even though we can see from the screen shot I shared that we can read the data. How is it possible? You can see the CHAR_READ_PROP_DIS in the second and third characteristic function calls of the second unknown service in "ble_peripheral_task.c" file of the above mentioned example program.

5. Now, with this example, I can read, write data to the peripheral from the smart phone. But, I wanted to read and write data between two DA1469x USB boards. To achieve this, I need some suggestions what are the two best example demos from the sdk I can use to modify the permissions?

Thanks in advance.

Regards,

Prasanna

Attachment:
MHv_Dialog
Offline
Last seen:2 months 2 days ago
Staff
加入:2013-12-06 15:10
Hi Prasanna,

Hi Prasanna,

Please use the Android app BLE Scanner instead (it is the one used in the readme file). It works well using this app.

  1. Could be your phone, could be the nRF app. I am testing it without issues using BLE Scanner and Lightblue as well as the Chrome browser on my PC (typechrome://bluetooth-internals/#devicesin the address field of a Chrome or new Edge Browser)
  2. Peripheral devices do not initiate connections. This is the task of a central device. A peripheral will often start advertising when the connection is dropped, but that is a design choice. Centrals can try to reconnect, but again that is a design choice. The sample code in question will start advertising if a connection is dropped
  3. The services and characteristics are unknown to the app because they are custom services and characteristics. How would the generic app know about them? you can define a user descriptor, a text string, to make it easier for a human to discover the database. Applications will typically be implemented to recognize the custom 128bit UUID
  4. There is likely an issue here. I'll dig further into that and let you know
  5. You will need the central example, this custom service example and likely the UART example.

/MHv

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hi MHv_Dialog,

Hi MHv_Dialog,

Where can I find the UART example in the SDK. Also when I am testing the ble_central and the custom service example, the central device is unablr to discover the services created in the custom service example. I am unable to figure it out why this happens? Can you test this once and let me know whether you are able to discover the services.

Thanks in advance.

Regards,

Prasanna

MHv_Dialog
Offline
Last seen:2 months 2 days ago
Staff
加入:2013-12-06 15:10
The UART example can be found

UART的例子可以发现在支持网站:DA1469x UART adapter example

I tested all of the central applications in my previous response, and none of them have any issues - did you try any of those?

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hello MHv_Dialog,

Hello MHv_Dialog,

I am testing the DA1469x_custom_service_example and the BLE_central example. The central is unable to discover the services defined in the custom_service_example. The services are being discovered only when tested with ble_peripheral example. Even the custom_service has ble_peripheral task where it declares some services, I am not getting why the ble_central cannot discover the services with the custom_service example.

Regards,

Prasanna

PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
Hi Prasanna,

Hi Prasanna,

Sorry for jumping in and happy new year. We have escalated this internally and we are working on this. We’ll get back to you.

Thanks, PM_Dialog

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hello PM_dialog,

Hello PM_dialog,

I figured it out why I cannot discover the services. Since, the device unable to discover the peripheral and I changed the address in ble_conig.h. But, every time the peripheral advertises with some random address, how can I avoid giving the address manually by checking with the smart phone app.

Happy New Year to you too :)

Thanks in advance.

PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
Hi Prasanna,

Hi Prasanna,

Could you let us know how you figured this out?

Please also clarify your follow-up question.

Thanks, PM_Dialog

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hello PM_Dialog,

Hello PM_Dialog,

I have changed manually the address "defaultBLE_STATIC_ADDRESS" in ble_config.h of the ble_central example to discover the BLE-peripheral, connect and dicover its attributes.

Regardimg my question,

For changing the above mentioned address manually in the BLE-central demo, I have to check for the random address the peripheral is generating through a smart phone application whenever the central cannot detect a peripheral. So, instead of this is there any way that a central can detect the peripheral with a random address?

Thanks, Prasanna

PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
Hi Prasanna,

Hi Prasanna,

To change the BD Address, it is recommended to add the following macro definition in the custom_config_qspi.h file instead of modifying the SDK files. For example :

#define defaultBLE_STATIC_ADDRESS { 0x11, 0x22, 0x33, 0xCA, 0xEA, 0x80 }

The peripheral, is a mobile phone? Usually the mobile phone are using random BD address, so they are changing every time. There is not way to detect the newly generated random address of the peripheral. You could configure another DA1469x as a GAP Peripheral using a static BD address.

Thanks, PM_Dialog

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hello Dialog,

Hello Dialog,

I am bit confused. Could you clarify me what is the value of the address "#define defaultBLE_STATIC_ADDRESS" defined in the ble_central/ble-config.h file. is it the central address or the peripherals address which it has to connect to?

I am using two dialog usb sticks as the ble_peripheral and the ble_central. I have seen twice the address of the peripheral has changed which I figured out by checking with the ble scanner app. One is the address c5:80:c1:42:3e:8f and the second time I found it has changed to 06:06:06:01:01:01. This is why I am confused how this happens?

PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
H Prasanna,

H Prasanna,

We are working on this tutorial and will release an updated version hopefully by the end of this week. I’ll let you know once the new version is available for download.

Thanks, PM_Dialog

PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
Hi Prasanna,

Hi Prasanna,

The Custom BLE Services Example SW example is now updated. Please check it out :DA1469x Custom bluetooth service.

Thanks, PM_Dialog

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hello PM_Dialog,

Hello PM_Dialog,

So, you are saying that the updated version of this specific example is not ready yet?

Regards,

Prasanna

PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
Hi Prasanna,

Hi Prasanna,

Apologies - it was a typo. I meant "is now updated". I've just corrected it.

Thanks, PM_Dialog

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hi PM_Dialog,

Hi PM_Dialog,

Thanks for the response. Can you provide me the download link for the source code?

Regards,

Prasanna

PM_Dialog
Offline
Last seen:41 min 26 sec ago
Staff
加入:2018-02-08 11:03
Hi Prasanna,

Hi Prasanna,

Please check this link :DA1469x Custom bluetooth service

In Section 1. Example description, you will find a download link.

Thanks, PM_Dialog

prasanna
Offline
Last seen:2 months 1 week ago
加入:2020-09-29 11:56
Hello PM_Dialog,

Hello PM_Dialog,

Thanks for the response.

Regards,

Prasanna