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

Sending data over Nordic UART service

Hello there,

First of all, thank you Nordic for such a great platform to develop on and all the great example code to get a BLE newbie up and running. Also, a deep thanks to the developer community here that has been very helpful in answering questions and pointing me in the right directions.

I am developing a custom application on a custom board with the nRF51822. The board is essentially a battery powered sensor that sends readings to a mobile phone. The readings are about 6000 bytes, so RAM can get tight, but there is room. I need to transfer this data and the battery status to the phone over BLE. The standard battery service seems the obvious choice to send the battery data, and for the sensor data, the Nordic UART service seemed like a reasonable choice.

I have now incorporated three BLE services with the s110 softdevice into my custom application:

  1. Battery service (ble_bas)
  2. Nordic UART service (ble_nus)
  3. Device Information service (dis)

Setting up the services and advertising is functioning. I am using an iPhone with the LightBlue and the nRF UART apps to test connectivity between the iPhone and my board. I am also using the LightBlue app on my MacBook Pro to test connectivity between my laptop and my board.

So, now to the problem...Both laptop and iPhone can connect to the board and read the battery data from the battery service running on the board. From my laptop, even the Nordic UART service is working from the LightBlue app, and I can send text strings back and forth between the laptop and the board.

However, the Nordic UART service does not seem to be working from the iPhone using both the nRF UART and LightBlue apps. The services are recognized, but sending strings back and forth is not working. The board is periodically sending a "Hello World", and I occasionally see some characters on the Nordic UART app on the iPhone, but not the whole string. Also, when I send data back to the board, it does not seem to reach my code, specifically the nus_data_handler that is set up to handle incoming data over BLE.

Any ideas how to debug this? Sorry to be so longwinded, but I wanted to be as detailed as possible.

Thanks!

-ujwal

Related