This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Dongle in server mode with connect needs 100-400 ms to answer Read or Write response

Using a Peripheral set in Central mode and write then read data back in the Dongle nRF5240 set in Server Mode.

Once connected and exchange MTU (extended) I write and then read my data. The read response or the write response are very long up to 400 ms for the read response.

Sending 1 byte or 240 bytes does not make any differences.

Why is this delay for?

My Interval connection is set to the minimum 7.5 ms.

Are this timing correct? Can I made then shorter?

Thank for helping.

Jean-Marc

Parents
  • Hello Jean-Marc,

    I am a little confused. Can you clear up for me whether the dongle is a central or peripheral, and what is the other device? A cellphone or another chip?

    Do you use notification or indication? And which device is writing(central or peripheral), and which device is reading(peripheral or central)?

    Best regards,

    Edvin

  • Thank you...

    The Nordic dongle is used as peripheral/server, I setup my server parameters and used another device as central to read/write it.

    The central is a CC2640R2 and I deal without any problems with both units. The only problem is the time for a response after the writerequest or the readrequest, it is about 100-400ms and I have no idea what the dongle is doing to answer with such delay.

    Is this part of the BLE that the server needs a turnaround time to answer?

    Both device are close each other.

    jean-marc

  • Check out out getting started guide.

    I really recommend you to use the nRF52840 DK if you intend to do some development with the nRF52840 chip, as the dongle doesn't have a programming chip, so it is not possible to debug.

    Also, if you intend to transfer a lot of data, you should look into notifications. It is quite common in all of our examples.

    Best regards,

    Edvin

  • Thank you everybody for your answers. You made me pinpoint the interval connection. But as I wrote I already set this to my central.

    Anyway I still do not know why this happen but I interfaced with another server on Linux and used the "btmon" (I do not know how to setup the sniffer with my dongle).

    I noticed on btmon that the connection interval  reported was not what I had setup on my code, neither from my central neither from my slave.

    So I send the command for a "LE Remote Connection Parameter Request" and finally this updated the connection interval as set by my code.

    No idea why BLE is acting like this.

    Also used now notify as suggested but cannot set it to the dongle to notify :-(

  • Hello,

    If you are new to BLE, I suggest that you look into one of our examples to begin with. And if you only have the dongle, this example can be a good place to start.

    You can use the nRF Connect for Mobile to trigger notifications on the service, and play around with it.

    But I can't stress enough that for development purposes, a DK is a lot easier to work with, as it provides debug possibilities, which the dongle does not have. The dongle is intended as a development companion, which you can use with nRF Connect, to connect to the device that you are actually developing on.

  • Thank you Edwin for your answer.

    I am not really new to BLE but rather for the use of Nordic.

    Do you mean that I can run the linked example with the dongle nRF52840? 

  • Yes, you can run it on the dongle. See how to set up the "UART" (usb) viewer as linked in the example. Remember to use both "Terminal settings" and "UART and USB settings".

    BR,

    Edvin

Reply Children
  • No problem for a terminal setup, but for the dongle, the nRFgo does not detect the dongle. How can I flash the hex file?

  • That is because the dongle doesn't have a programming chip, like nRFgo is actually looking for. When you connect a DK, it will actually look for and discover the programming chip.

    To program the dongle, you must either use nRF Programmer v. 1.0.0-experimental.6 (see screenshot below), which is part of the new nRF Connect, which you can find here.

    Alternatively, you can use Nordic Command Line Tools (nrfjprog) to perform the DFU.

    So since the dongle doesn't have a programming chip, you must use the preprogrammed bootloader to change the application on the dongle. Please see this guide:

    http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52%2Fdita%2Fnrf52%2Fdevelopment%2Fnrf52840_dongle%2Fprogramming.html

    Best regards,

    Edvin

  • Again I got lost on the different link.

    1) nRF Connect has the experimental 5 as default. Found a new version available experimental 6. -> OK.

    But now what hex file should I load? "the ble_app_uart_pca10056_s140.hex" is for pca10056 board.

    My dongle is pca10059. I loaded the pca10056 but the dongle is not functioning.

    2) Do not understand what is the DFU Trigger, if it is useful for my problem.

    3) For the nRF5x-Command-Line_Tool-Win32, I will probably have the same problem for the hex file to upload.

    I appreciate the time you spend to help me... :-)

    BTW I just received my DK now and will probably drop the dongle.

    Jean-Marc

  • Good morning, Jean-Marc!

    1) 5 worked fine as well, but nRF Connect got an update recently, so I thought I should refer to the latest version. It is just important that you use the experimental 5/6, as this is the only version that can program the softdevice and the application.

    Can you specify what you mean with "dongle is not functioning"? Are you able to program it? (Do you get any errors in nRF Programmer?)

    It may be that the application is running, but you will not get the UART information, because the dongle is not connected with the pins used for UART. 

    This will be easier to understand now that you can compare it with the DK.

    If you program the same hex file (It is the one you found in the SDK\examples\ble_peripheral\ble_app_uart\hex folder, right?), and you open Putty or Termite (UART terminals) you should see some text like "UART example started". Remember that when you compile the project yourself, you also need to program the softdevice, located in SDK\components\softdevice\s140\hex. If you use Segger Embedded Studio, you don't need to think about this, as it programs the softdevice for you.

    For your dongle, please try the example file: SDK\examples\peripheral\usbd_ble_uart\pca10056\

    You need to compile this project, as it doesn't have precompiled hex-files.

    The reason that it is different for the dongle is that the USB part of the dongle is the part that you plug into your computer, and it is not the same as the USB on the short side of the DK, it is the same as the USB on the long side. Basically, you can't use the USB pins on the dongle to transfer UART data. This is probably why you think that the .hex file doesn't work.

  • 1) No the experimental 5 does NOT work on my dongle. It cannot find the USB device. That is why I search and found the experimental 6. Which is indicated on a small "i" to click. This is ridiculous... Who wants to click on a such small indicator... :-(

    2) Yes I Add .hex file usbd_ble_uart\pca10056, then do "write". Then I loose the contact of the dongle. It says "Connect to a DevKit to see the contents of its non-volatile memory here". ???

    3) Since I loose the contact of the dongle I cannot open Putty or any terminal to it I do not have any com port.

    Anyway doing OK with the nRF DK.

    But do not see much interest for the dongle. Also Connect is not as nice as was Master Control Panel which does not work anymore. Neither on my nRF51 dongle nor the new dongle.

    Thank you for your help...

Related