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

  • Hi Kevin

    Please find my example here:
    https://github.com/NordicPlayground/nrf52-ble-app-uart-relay

    Give it a go and see how it works. 

    I tried to pull the peripheral/server and central/client parts of the examples into separate files to avoid making the main file too cluttered, and implemented a simple relaying mechanism to pass data from one link to the other. 

    This is controlled from main.c and can be changed if you like. 

    Best regards
    Torbjørn

  • 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

Related