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

ble heart rate monitor device connects but no data

Hello,

Apologies as I'm very new to C and I may be missing something obvious. I have an actual ble Heart Rate device which I wish to connect to my pca10028 (nrf51422_xxAC.

I am using the example code from the following path.

C:\nordic\examples\ble_central\ble_apps_hrs_c\pca10028\s130\arm5_no_packs\ble_apps_hrs_c_s130_pca10028uvprojx

I've added the necessary files to get SEGGER_RTT_printf to send data to J-Link so I know where the program has execute. It appears the device connects to hrt successfully as it stops advertising.

This line in code fires suggesting it's found the device:

   if(extracted_uuid == TARGET_UUID)
                    {	SEGGER_RTT_printf(0,"uuids match %d",TARGET_UUID);

and this line executes to suggest it had bonded

  // Initiate bonding.
            err_code = dm_security_setup_req(&m_dm_device_handle);
            APP_ERROR_CHECK(err_code);
						
            m_peer_count++;

            if (m_peer_count < MAX_PEER_COUNT)
            {
                scan_start();
            }
            APPL_LOG("[APPL]: << DM_EVT_CONNECTION\r\n");
						SEGGER_RTT_printf(0,"bonded %d", err_code);

But the Heart Rate Collector Handler or Battery Level Collector Handler never fire. So the last output I get on j-link is "bonded0"

Any help would be greatly appreciated.

UPDATE: I've replaced all logging information with SEGGER_RTT and this is the output. Disconnection happens after a minute or so

 0> Heart rate collector example
 0> sd_ble_enable: RAM START at 0x20001EB0
 0> [DM]: >> dm_init.
 0> [DM]: Storage handle 0x0003F800.
 0> [DM]: >> dm_register.
 0> [DM]: Application Instance allocated.
 0> [DM]: Created whitelist, number of IRK = 0x00, number of addr = 0x00
 0> 	[APPL]: 180D
 0> [DM]:[00]: Connection Instance Allocated.
 0> [APPL]: >> DM_EVT_CONNECTION
 0> [DM]: >> dm_security_setup_req
 0> [DM]: Allocated device instance 0x00
 0> [DM]: Initiating authentication request
 0> [APPL]: << DM_EVT_CONNECTION
 0> [DM]: >> BLE_GAP_EVT_AUTH_STATUS, status 00000085
 0> [APPL]: >> DM_EVT_SECURITY_SETUP_COMPLETE
 0> [APPL]: << DM_EVT_SECURITY_SETUP_COMPLETE
 0> [DM]: Disconnect Reason 0x0013
 0> [APPL]: >> DM_EVT_DISCONNECTION
 0> [DM]: >> dm_whitelist_create
 0> [DM]: Created whitelist, number of IRK = 0x00, number of addr = 0x00
 0> [APPL]: << DM_EVT_DISCONNECTION
 0> [DM]:[00]: Freed connection instance.
Parents
  • Hi PaulR, I'm a user of similar software using an mBed sample code (BLE_HeartRate) left for users on the mBed website...up until yesterday I could connect and if the connection stayed up for more than a second, the device started running thru the sample code loop that repeated:

        hrmCounter++;
    
            if (hrmCounter == 175) { //  100 <= HRM bps <=175
    
                hrmCounter = 100;
    

    line 97-100, hrmCounter was initialized on line 30 as 100.

    It would repeat so you'd get a series of these reading seen on the smart phone generating a saw-tooth like output.

    It took me about a week to get use to the smart phone required sequence of screen touches and I eventually changed the advertise rate from 1000 (1 second) to 100 so when the phone searched, it would find HRM1 faster.

    Hope this helps

Reply
  • Hi PaulR, I'm a user of similar software using an mBed sample code (BLE_HeartRate) left for users on the mBed website...up until yesterday I could connect and if the connection stayed up for more than a second, the device started running thru the sample code loop that repeated:

        hrmCounter++;
    
            if (hrmCounter == 175) { //  100 <= HRM bps <=175
    
                hrmCounter = 100;
    

    line 97-100, hrmCounter was initialized on line 30 as 100.

    It would repeat so you'd get a series of these reading seen on the smart phone generating a saw-tooth like output.

    It took me about a week to get use to the smart phone required sequence of screen touches and I eventually changed the advertise rate from 1000 (1 second) to 100 so when the phone searched, it would find HRM1 faster.

    Hope this helps

Children
Related