Reset the channel sounding parameters after a disconnection

Hi, I am trying to sound two reflectors from a single initiator, and since the CS works on a one-to-one ACL system, I wanted to know how I can reset the CS-related stuff in the code. I did try this without reboot, the data becomes stagnant after a reconnection or when I connect 2 reflectors (not sound, but just connect)  

The sample provided by Nordic does a soft reboot, so it works flawlessly. I am trying to take a different path of not connecting to both of my nodes at once and do a soft reboot every time I wanna switch the sounding, but I wanted to know if a manual reset was possible for the CS params and buffer, so that I can continue with sounding another device without doing a soft reboot.

Parents
  • Hello,

    This should be possible. You mention that you want one initiator and two reflectors. This will probably work, but if you are planning to have many reflectors, you may want to switch it around. You see, the main CPU usage is in the initiator, and the reflector is not doing any heavy lifting. This means that if you plan to have many stationary devices and one moving device, it may make sense to have the stationary devices being the initiators, all doing channel sounding towards the same reflector. This means that the moving device (reflector) can last longer on a smaller battery.

    without reboot, the data becomes stagnant after a reconnection

    What does it mean? do you get any channel sounding data from the second connection, or none at all?

    Best regards,

    Edvin

  • I have found my answer and also a mistake.

    bt_le_cs_procedure_enable() was returning an error because the connection would already be stale after the disconnection. Hence, I tried to run it just by resetting the buffers, but I soon faced this issue of 

    W: Could not locate mandatory
    On-demand ranging data characteristic E: RAS RREQ alloc init failed (err -22)
    Then I started looking into my device discovery and found a problem there. I use NUS and RAS as well, so I chained their discoveries. And I was not resetting some states to do this properly.
     
    Now I need to work on the multiple connections part. This whole RAS and NUS were running on the multilink_central code, so do you have any suggestions on the multiple connections and the sounding part?
  • The reason why I ask for counter reset on the reflector is that I always have this ranging counter mismatch or empty step data when I start measurement to the device 0 (which gets connected first). I have some logs below.

    I even use 2 Config_IDs to differentiate between these devices

    There are supposed to be at least 19 samples of distance measurement data, since I read and print distance results once every 500ms and switch between devices once every 10 seconds. But, I see this error either from the ranging_data_cb() or from the bt_ras_rreq_rd_subevent_data_parse()

     

    I: Disabling the CS procedure
    I: counters reset, local:-1, dropped:-1
    W: Procedure 584 aborted, reason - 0x1
    I: CS procedures disabled.
    I: Enabling the CS procedure
    I: Sounding to device 0
    I: CS procedures enabled:
    - config ID: 0
    - antenna configuration index: 0
    - TX power: 0 dbm
    - subevent length: 28198 us
    - subevents per event: 1
    - subevent interval: 0
    - event interval: 2
    - procedure interval: 5
    - procedure count: 0
    - maximum procedure length: 1000
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 691, local: 690)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 692, local: 691)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 693, local: 692)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 694, local: 693)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 695, local: 694)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 696, local: 695)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 697, local: 696)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 698, local: 697)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 699, local: 698)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 700, local: 699)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 701, local: 700)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 702, local: 701)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 703, local: 702)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 704, local: 703)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 705, local: 704)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 706, local: 705)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 707, local: 706)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 708, local: 707)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 709, local: 708)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 710, local: 709)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 711, local: 710)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 712, local: 711)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 713, local: 712)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 714, local: 713)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 715, local: 714)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 716, local: 715)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 717, local: 716)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 718, local: 717)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 719, local: 718)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 720, local: 719)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 721, local: 720)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 722, local: 721)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 723, local: 722)
    Data from Reflector 2
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 724, local: 723)
    Data from Reflector 1
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 725, local: 724)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 726, local: 725)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 727, local: 726)
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 728, local: 727)
    I: Disabling the CS procedure
    I: counters reset, local:-1, dropped:-1
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 729, local: 4294967295)
    I: CS procedures disabled.
    I: Enabling the CS procedure
    I: Sounding to device 1
    I: CS procedures enabled:
    - config ID: 1
    - antenna configuration index: 0
    - TX power: 0 dbm
    - subevent length: 28198 us
    - subevents per event: 1
    - subevent interval: 0
    - event interval: 2
    - procedure interval: 5
    - procedure count: 0
    - maximum procedure length: 1000
    I: Dropped subevent results. Waiting for ranging data from peer.
    I: Ranging data dropped as peer ranging counter doesn't match local ranging data counter. (peer: 585, local: 728)
    I: 1.756596,3.513278,2.610804,2.604011
    I: 1.756596,3.427624,2.751654,2.049362
    I: 2.049362,3.427624,2.837012,2.049362
    I: 2.049362,3.427624,2.837012,2.049362
    I: 2.049362,3.427624,2.854575,2.049362
    I: 2.049362,3.427624,2.854575,2.049362
    I: 2.049362,3.451425,3.105397,2.049362
    I: 2.049362,3.534048,3.157910,2.049362
    I: 2.049362,3.534048,3.105397,2.049362
    I: 2.049362,3.534048,3.157910,2.049362
    I: 2.049362,3.546767,3.382754,2.049362
    I: 2.049362,3.424742,3.265795,2.049362
    I: 2.049362,3.424742,3.265795,2.049362
    I: 2.049362,3.424742,2.969308,2.049362
    Data from Reflector 2
    Data from Reflector 1
    I: 2.049362,3.360484,2.927473,2.049362
    I: 2.049362,3.360484,2.792185,2.342129
    I: 2.195745,3.360484,2.820416,2.342129
    I: Disabling the CS procedure
    I: counters reset, local:-1, dropped:-1
    W: Procedure 623 aborted, reason - 0x1
    I: CS procedures disabled.
    I: Enabling the CS procedure
    I: Sounding to device 0
    I: CS procedures enabled:
    - config ID: 0
    - antenna configuration index: 0
    - TX power: 0 dbm
    - subevent length: 28198 us
    - subevents per event: 1
    - subevent interval: 0
    - event interval: 2
    - procedure interval: 5
    - procedure count: 0
    - maximum procedure length: 1000
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    Data from Reflector 2
    E: empty step data
    Data from Reflector 1
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    E: empty step data
    I: Disabling the CS procedure
    I: counters reset, local:-1, dropped:-1
    E: empty step data
    I: CS procedures disabled.
    I: Enabling the CS procedure
    I: Sounding to device 1
    I: CS procedures enabled:
    - config ID: 1
    - antenna configuration index: 0
    - TX power: 0 dbm
    - subevent length: 28198 us
    - subevents per event: 1
    - subevent interval: 0
    - event interval: 2
    - procedure interval: 5
    - procedure count: 0
    - maximum procedure length: 1000
    I: 2.049362,3.392859,2.921039,2.049362
    I: 2.049362,3.392859,3.176355,2.049362

  • Hello,

    Sorry for my previous reply. It was a bit off. It was originally intended for another ticket, and I thought it could be the same issue, as they were also trying to range between multiple reflectors/initiators (but alternating, by disconnecting from them).

    I tried to build your applications, but I couldn't. I got a build error. Can you please let me know what NCS version you are using, and what build command you are using. If you are using nRF Connect for VS Code, you can copy the build command by right clicking the build folder and select "Copy build command" in VS Code. 

    And is my understanding correct:

    If I build your applications, flash the central_uart... to one nRF54L15 DK, and the reflector to two other nRF54L15 DKs, I should be able to see the issue that you are seeing?

    Best regards,

    Edvin

  • Hi, Its okay, 

    I have updated the code base now. I will share that with you.
    The build command I am using is 


    west build --build-dir cs/central_uart --pristine --board nrf54l15dk/nrf54l15/cpuapp --sysbuild -- -DCONF_FILE="prj.conf" -DDEBUG_THREAD_INFO=On -DCONFIG_DEBUG_THREAD_INFO=y -Dcentral_uart_DEBUG_THREAD_INFO=On

    Yes, if you run the reflector and initiator with my code, you should be able to recreate the issue.

    Thanks,

    Vinayaka KS

  • Hi Edvin, were you able to recreate the issue?

    Regards,

    Vinayaka 

Reply Children
No Data
Related