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

Quickest path to BLE data exchange...

Hi,

Given the too many examples in the nRF5 SDK that are provided to implement BLE and the unclear documentation on how to best proceed, what would you say is the quickest path to begin development of a bidirectional data transmission in a BLE embedded device? I am seeking to transmit small chunks of proprietary data (maybe 100 bytes/sec) from an embedded device and have it received by another embedded device in close proximity then send the data from the second embedded device on to an iPhone also very close by. I need bidirectional data from iPhone to second device to first device as well, so a two way data stream. Make sense?

I am using v16 (latest I believe) of the nRF5 SDK on an nRF52832.

Thanks,

Kevin

Parents
  • Hi Kevin

    I would say the ble_app_uart example is the best place to start if you are looking for a simple two directional proprietary BLE example. 

    It sets up a simple service (NUS) with one characteristic for TX and one for RX, allowing you to send strings of variable length from the client to the server and vice versa. 

    The ble_app_uart example also integrates nicely with our Android and iOS phone apps, allowing you to test the phone connectivity without having to develop the app yourself. 

    You can read more about the example here

    Best regards
    Torbjørn

  • Thanks Torbjørn. Can you tell me the utility and difference between the BLE Peripheral/UART/Serial Port Emulation over BLE that you recommend and BLE Central/Nordic UART Service Client? 

  • You absolutely ROCK Torbjørn. Tusen takk! That little sample will likely save me countless hours of unwinding the, IMHO, convoluted codebase Nordic provides for these amazing BLE parts.

    If I ever make it to Norway, I owe you a lunch. Slight smile

    Take care,

    Kevin

  • This might just be dumb user error on my part but when I try to connect to nRF Toolbox's UART, app_nus_server.c crashes on line 292 with a Busy Error: 

     app: ERROR 17 [NRF_ERROR_BUSY] at line 292, PC is 0x0003014D in '...rt-relay-master/app_nus_server.c' 

    It seems to be trying to change some aspect of the PHY. Perhaps some incompatibility with the iOS app itself? Thoughts?

    I am running this on a Taiyo Yuden nRD52832 board using S132 on SES but I don't think that would matter.

  • Hi Kevin

    Which iOS version and phone are you using?

    Did you have a ble_app_uart device connected to the relay when the error occured?

    I just tested the nRF Toolbox app on an iPhone 7 running iOS 12.4, and didn't see this issue. 

    Do you have an nRF52DK or nRF52840DK to test with for comparison?

    Best regards
    Torbjørn

  • Hi T. 

    I’m running the latest iOS on an iPhone XS Max - v13.3. There was no 3rd device connected. I just launched the BLE example from SES running it on my Taiyo Yuden board then ran nRF Toolbox on the phone. When I connect from the UART tool to the BLE board, it connects then pops up with the error. Unfortunately I don’t have any other dev boards other than ones from Taiyo. The exact message sequence is:

     app_timer: RTC: initialized.
     app: BLE UART central example started.
     app: Connecting to target C2A4069DD176
     app: Peripheral connected
     app: ATT MTU exchange completed.
     app: Ble NUS max data length set to 0xB6(182)
     app: ERROR 17 [NRF_ERROR_BUSY] at line 292, PC is 0x0003014D in '...rt-relay-master/app_nus_server.c' 

    Any thoughts as to what this error is trying to indicate?

    Also, unrelated: when I run the UART project on two different Taiyo boards, shouldn't they auto connect? Right now they don’t auto connect when running the sample on 2 boards.

    Thanks, Kevin

Reply Children
  • Hi Kevin

    Sorry for the slow response, I have been doing some travel lately. 

    I tried this again after updating my iPhone 7 to iOS 13.3.1, and I still can't spot the issue. I will ask around and see if we have an iPhone XS Max in the office to test with. 

    Have you tried the standard ble_app_uart example on your boards to see if it works OK?

    Do you have any means of capturing a sniffer trace when the problem occurs?
    Then it would be easier to investigate what is happening. 

    Kevin Kachikian said:
    Also, unrelated: when I run the UART project on two different Taiyo boards, shouldn't they auto connect? Right now they don’t auto connect when running the sample on 2 boards.

    Hi, do you mean two boards running my example?

    The idea is to use the relay example on one board, and the ble_app_uart example on the other. Then the relay board should automatically connect to the ble_app_uart board. 

    Best regards
    Torbjørn

  • Hi Torbjørn. Sorry for MY delayed reply. I am also traveling this week. I'll get back to you with full answers to your questions in a few days. Thanks for the clarification on my second question. I will use the relay example and test that when I return. Thanks again for your help!

    Kevin

  • Hi Kevin

    No problem, just let me know when you have more info to share Slight smile

    Best regards
    Torbjørn

Related