Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

[nrf5 16.0.0] BLE UART central uart example troubles

Specifically, the example is examples/ble_central/ble_app_uart_c

I want to first verify my understanding of this example. In this example, should I be able to type in my terminal to send characters back and forth over bluetooth? This is my understanding of this example:

Device 1 <--> UART <--> Bluetooth <--> UART <--> Device 2

If that is the case, I'm struggling to get the example to do anything other than print "BLE UART central example started." in my terminal, and I can't really debug using gdb to see what's wrong because of some soft device stuff making gdb get stuck.

If I type some characters and press enter, I get the following error from RTT:

ble_nus_c: Connection handle invalid.

Is there something else I'm supposed to configure?

Update: I see how per https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Fuart_example.html that I should be using central on one device and peripheral on another. Done that and now I can send from my peripheral to my central device. I cannot talk from my central device to my peripheral device though. whenever I try this, I get the following errors from RTT:

 app: Connecting to target 3E0D9D17F3CC

app: Disconnected.

app: Disconnected. conn_handle: 0x0, reason: 0x3E

app: Connecting to target 3E0D9D17F3CC

app: Disconnected.

app: Disconnected. conn_handle: 0x0, reason: 0x3E

app: Connecting to target 3E0D9D17F3CC

app: Disconnected.

app: Disconnected. conn_handle: 0x0, reason: 0x3E

app: Connecting to target 3E0D9D17F3CC

app: Disconnected.

app: Disconnected. conn_handle: 0x0, reason: 0x3E

app: Connecting to target 3E0D9D17F3CC

app: ATT MTU exchange completed.

app: Ble NUS max data length set to 0xF4(244)

app: Discovery complete.

app: Connected to device with Nordic UART Service.

Parents
  • Hello,

    I want to first verify my understanding of this example. In this example, should I be able to type in my terminal to send characters back and forth over bluetooth? This is my understanding of this example:

    Device 1 <--> UART <--> Bluetooth <--> UART <--> Device 2

    Your understanding of the example is correct, so long as you have one device programmed with the ble_app_uart_c(entral application) and one with the ble_app_uart (peripheral application).
    The central will look for devices that advertise the Nordic_UART name, before initiating a connection.

    I cannot talk from my central device to my peripheral device though. whenever I try this, I get the following errors from RTT:

    Which serial terminal are you using on your central side / how are you inputting the UART data to the central device?

    app: Connecting to target 3E0D9D17F3CC

    app: ATT MTU exchange completed.

    app: Ble NUS max data length set to 0xF4(244)

    app: Discovery complete.

    app: Connected to device with Nordic UART Service.

    After the last messages in the log, where the discovery successfully completes, are you then able to send from your central device to your peripheral device?

    What does your peripheral's log look like when you are doing this?

    Best regards,
    Karl

    Thanks for your response. I eventually did get this example to run correctly after realizing the central to peripheral thing. The errors I received after that were for an example I found on github for time syncing.

  • penguinwashere said:
    Thanks for your response.

    No problem at all, I am happy to help! :) 

    penguinwashere said:
    I eventually did get this example to run correctly after realizing the central to peripheral thing.

    I am glad to hear that the examples are working as expected now, great!

    Please do not hesitate to open another ticket if you should encounter any other issues or questions in the future.

    Good luck with your development!

    Best regards,
    Karl

Reply
  • penguinwashere said:
    Thanks for your response.

    No problem at all, I am happy to help! :) 

    penguinwashere said:
    I eventually did get this example to run correctly after realizing the central to peripheral thing.

    I am glad to hear that the examples are working as expected now, great!

    Please do not hesitate to open another ticket if you should encounter any other issues or questions in the future.

    Good luck with your development!

    Best regards,
    Karl

Children
No Data
Related