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

Connection to Android isn't stable

I'm having an issue with maintaining a stable connection with the master control panel on an android device. Using the PCA10000 I am able to get a stable connection with a computer and transmit data, but when I move to an android device it isn't stable.

I started with the example project "nrf51-ble-app-lbs-throughput-test-5.1.0" and instead of continuously transmitting on a button event, I added a timer which triggers every 30ms to transmit 9 bytes acquired from an I2C sensor. It continues to do this until the button is pressed again.

On the android device I can connect to it, but as soon as I press the button to start sending data the connection is lost and the error returned from the transmit function, ble_lbs_data_send(), is 0x3401.

I am using the nRF51822 development kit with the SoftDevice s110, Keilv5 evaluation version. I have also stopped the sensors from measuring and am transmitting dummy data, which doesn't change the error at all.

Thanks, Jeremy

Parents
  • I have already updated the TWI driver to be softdevice compatible and I can transmit to a computer just fine. I'm not seeing hard faults.

    Based on the 0x3401 error thread, I modified the error checking after the ble_lbs_data_send() command to:

    err_code = ble_lbs_data_send(&m_lbs, data);
    if (err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING 
            && err_code != NRF_SUCCESS 
            && err_code != BLE_ERROR_INVALID_CONN_HANDLE 
            && err_code != NRF_ERROR_INVALID_STATE 
            && err_code != BLE_ERROR_NO_TX_BUFFERS)
    {
        APP_ERROR_CHECK(err_code);
    }
    

    and now I can transmit data, but after the connection is established with the Android device it disconnects every 16.5 seconds, like clockwork. Any ideas?

    Thanks, Jeremy

Reply
  • I have already updated the TWI driver to be softdevice compatible and I can transmit to a computer just fine. I'm not seeing hard faults.

    Based on the 0x3401 error thread, I modified the error checking after the ble_lbs_data_send() command to:

    err_code = ble_lbs_data_send(&m_lbs, data);
    if (err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING 
            && err_code != NRF_SUCCESS 
            && err_code != BLE_ERROR_INVALID_CONN_HANDLE 
            && err_code != NRF_ERROR_INVALID_STATE 
            && err_code != BLE_ERROR_NO_TX_BUFFERS)
    {
        APP_ERROR_CHECK(err_code);
    }
    

    and now I can transmit data, but after the connection is established with the Android device it disconnects every 16.5 seconds, like clockwork. Any ideas?

    Thanks, Jeremy

Children
Related