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

Cycling Speed and Cadence sensor central configuration using nRF52832

i am working on the Cycling Speed and Cadence sensor central configuration using nRF52832 DK in Segger Embedded Studio. I used the RSCS central example of nrf_sdk_v15.0 and have made changes according to my requirement for single sensor and it is working fine i.e i am able to get the correct data. Then i wanted to connect nearly 8 such CSCS beacons so i made small changes in my code accordingly using Multilink central example as reference. I have adjusted the RAM and memory allocation also.  My main doubt is once i run the program it gets connected to a single device and it starts reading the data. How am supposed to make it connect and read the next sensors simultaneously ? I need to store the 8 data in an array after connecting all the beacons. I have attached the RTT log for your reference. What am i supposed to do now ? How can i read all the data parallely ? 

Parents
  • Hello,

    Have you tried to connect to several devices at once? It says that it is scanning for more devices after that you connected with the first one. As long as it enables notification on all of the sensors that it connects to, it should get an event whenever the devices pushes some new data to the device.

     

    What happens if you try to connect another peripheral to your central?

     

    Best regards,

    Edvin

Reply
  • Hello,

    Have you tried to connect to several devices at once? It says that it is scanning for more devices after that you connected with the first one. As long as it enables notification on all of the sensors that it connects to, it should get an event whenever the devices pushes some new data to the device.

     

    What happens if you try to connect another peripheral to your central?

     

    Best regards,

    Edvin

Children
  • Hi Sir,

    Thanks for your reply. 

    Right now i tried for 2 sensors only. I tried to read 2 advertisement reports and have put two cscs handlers for collecting 2 sensor's data. Please check the attached RTT logs of my application. I am getting this output only. I tried connecting with different peripheral names. 

    I dont know why the discovery is part is repeating 8 time when i tried connecting with a single sensor. It not giving any outputs too when i tried. 

    Kindly help me sir,

    Thanks and Regards

    Santosh Krishnan R 

  • Hello,

    Exactly why the discovery part is showing 8 times, I am not quite sure either. I have seen it before in the multilink example, so I think there is a small bug there. However,  I have not seen it causing any problems before. We can look into it eventually. But the "Fatal error" is something that we can't ignore for now.

    Can you please try to define "DEBUG" in your preprocessor defines? 

    A "Fatal error" typically comes from an APP_ERROR_CHECK(err_code); with an err_code != NRF_SUCCESS (=0).

    If you define "DEBUG" in your preprocessor defines, it should print some more info in the log, on where in the code the APP_ERROR_CHECK(err_code); that triggered the fatal error is, and what err_code it received. This way we can see what function that returned err_code != NRF_SUCCESS.

     

    Please let me know if you find out what function call it was, and what the err_code that is returned is.

     

    Best regards,

    Edvin

  • Hi Sir,

    I tried as you said to debug and i am getting the following issues. When i tried to connect my 1st sensor its gets connected and the repetition of discovery occurs and after i wake the second sensor it gives the following error in line 780 which is " APP_ERROR_CHECK(ret) " in the whitelist_load function and hex code: 0x0002E00B and stops. When i restart the debugging its scan for and once name matches it stops again by giving the following error in line 787 which is "APP_ERROR_CHECK(ret)" in the whitelist_load function. I have attached the RTT logs and error code for your reference. I have put the peripheral names in an array and have called in the adv_report. 

    Kindly help. 

    Thanks and Regards,

    Santosh Krishnan R 

  • Hello,

    if pm_whitelist_set() returns 5, it means NRF_ERROR_NOT_FOUND. Please see pm_whitelist_set() on infocenter.

     

    Can you please try to step through the function. If you set a breakpoint on line 619 after that the first peripheral has connected, and before the second connects. Is this the function that returns != 0?

    If so, can you step into this function to see where it returns?

    Is it after peer_data_find() or fds_record_open()? If you find out which one it is, try to step further in, and figure out which softdevice call, sd_...() that returns != NRF_SUCCESS.

     

    Best regards,

    Edvin

  • Hi Edvin, 

    Thanks for your reply. I will try to debug the issue and will let you know if i find any difficulty or doubt.

    With Regards,

    Santosh Krishnan 

Related