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

Running ble_app_uart on nrf52832 DK using the nrf52840 Bluetooth Dongle instead of a USB cable

I have an nrf52832 DK, which when on, constantly obtains and sends accelerometer data from an IMU to whatever BT device it is connected to. I also have an nrf52840 Bluetooth dongle.

I want to run the ble_app_uart app on my PC and get the data from the nrf52832 DK (using the bluetooth dongle to connect PC to DK instead of a USB connection)

I have researched extensively and have found examples on :-

  1. How to connect the nrf52832 DK to my PC using a USB cable, and then run ble_app_uart. 
  2. How to configure only the BT dongle (code blinky example to turn dongles light on or off)

However, none of these two examples are useful to me because

  1. One of my restrictions is that I cant use a USB cable to program my nrf52832 DK, so all examples that use a USB cable are automatically voided.
  2.  I need to use the BT Dongle as just a means to connect to my nrf52832 DK, thus all examples that use the dongle to program on it are also voided.
Parents Reply Children
  • Thanks for the quick reply. Yes I have tried the NUS client Sigurd uploaded. I have just updated the ticket where sigurd posted the client link

    https://devzone.nordicsemi.com/f/nordic-q-a/74491/trouble-connecting-nrf52840-dongle-on-windows-to-nrf52810-error-service-discovery-failed-error-code-0x10a

    You can check out my latest comment to find the problem I am encountering. 

  • It looks like you have not updated the UUIDs to match those that are used on the GATT server you are connecting to. The script I made expects the server to have the following UUIDs:

    "The 128-bit vendor-specific UUID of the Nordic UART Service is 6E400001-B5A3-F393-E0A9-E50E24DCCA9E (16-bit offset: 0x0001).

    This service exposes two characteristics: one for transmitting and one for receiving (as seen from the peer).

    • RX Characteristic (UUID: 6E400002-B5A3-F393-E0A9-E50E24DCCA9E)
      The peer can send data to the device by writing to the RX Characteristic of the service. ATT Write Request or ATT Write Command can be used. The received data is sent on the UART interface.
    • TX Characteristic (UUID: 6E400003-B5A3-F393-E0A9-E50E24DCCA9E)
      If the peer has enabled notifications for the TX Characteristic, the application can send data to the peer as notifications. The application will transmit all data received over UART as notifications. (link)"

  • I had tried doing this before, to no avail. However I will try it again. According to this explanation, going from the UUIDs in the image I have attached, I have set the following UUIDs

    #define BLE_UUID_NUS_SERVICE           0x11F9               /**< The UUID of the Nordic UART Service. */
    #define BLE_UUID_NUS_RX_CHARACTERISTIC 0x11FA               /**< The UUID of the RX Characteristic. */
    #define BLE_UUID_NUS_TX_CHARACTERISTIC 0x11FB               /**< The UUID of the TX Characteristic. */

    Yet, I am getting the same error. 

    One doubt that I do have is - do we not have to change any of these constants - 

    1. NUS_BASE_UUID
    2. BLE_UUID_CCCD
    3. BLE_UUID_CHARACTERISTIC
    4. BLE_CCCD_NOTIFY

    And in nRFConnect I had to write a string using TX characteristic, (the string was 0x300400844203FD), here I am doing it like this and was wondering if it was okay - 

    (void) ble_nus_c_string_send("0x300400844203FD", sizeof("0x300400844203FD"));

    Thank you.

  • #define BLE_UUID_NUS_SERVICE           0x11F9               /**< The UUID of the Nordic UART Service. */
    #define BLE_UUID_NUS_RX_CHARACTERISTIC 0x11FA               /**< The UUID of the RX Characteristic. */
    #define BLE_UUID_NUS_TX_CHARACTERISTIC 0x11FB               /**< The UUID of the TX Characteristic. */

    The UUIDs above are correct, but you also need to update NUS_BASE_UUID so it corresponds with your base UUID:

    // Based UUID: 12b5xxxx-ed67-4276-8e6d-7072eb0edfa9 
    #define NUS_BASE_UUID    {{0xa9, 0xdf, 0x0e, 0xeb, 0x72, 0x70, 0x6d, 0x8e, 0x76, 0x42, 0x67, 0xed, 0x00, 0x00, 0xb5, 0x12}} /**< Used vendor specific UUID. */

  • Thanks a lot for letting me that, after two weeks I am finally able to discover the services! 

    The last thing that remains is continuously obtaining the accelerometer values from the nRF52832 and printing them. Right now, I think I am able to discover both the RX and the TX services, however, when I press "Enter" to enable notifications on UART TX Characteristics, the console just says that it received an unhandled event. You can see the problem in the attached screenshot. 

    I suspect this might be because of the line  containing ble_nus_c_string_send as I mentioned before.

    (void) ble_nus_c_string_send("0x300400844203FD", sizeof("0x300400844203FD"));

    Thank you.

Related