This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RSSI with softdevice s110 v7 while scanning

Hi all, I am using s110 v7 for scanning and advertising, it works well. Now, I would like to measure RSSI while scanning (already scanned device but not connected) . Can I do this and how can I do. Many thanks, Phat

Parents
  • The sd_ble_gap_rssi_start() is only available when you have a BLE connection established and since you only do the beacon scan it will never be connected and you will never get the rssi event. But the scanning is done with the timeslot API for the softdevice. So in the app_beacon_scanner_start() you can add the code for checking the RSSI manually from the RSSISAMPLE register directly.

    EDIT UPDATE: Added sample code that samples the RSSI value after address match during the scanning. Used Softdevice 7.0.0 and SDK 6.0.0. ble_app_multiactivity_beacon-rssi_while_scanning.zip

Reply
  • The sd_ble_gap_rssi_start() is only available when you have a BLE connection established and since you only do the beacon scan it will never be connected and you will never get the rssi event. But the scanning is done with the timeslot API for the softdevice. So in the app_beacon_scanner_start() you can add the code for checking the RSSI manually from the RSSISAMPLE register directly.

    EDIT UPDATE: Added sample code that samples the RSSI value after address match during the scanning. Used Softdevice 7.0.0 and SDK 6.0.0. ble_app_multiactivity_beacon-rssi_while_scanning.zip

Children
  • Many thanks for your supporting, I will attach it to my project and check.

  • Hi Asbjorn,

    I have tried your sample code and it works. Thanks!

    The only problem I have is that I always get values that average to a range between -81 and -77 dBm. I take 300 rssi samples and then I average them and regardless of the distance between the transmitter and the receiver the values always average to a range between -81 and -77 dBm.

    In main.c, in the beacon_evt_handler when I pass the if condition, that means that the event regards the beacon that I am interested in, I store the rssi_sample_value in an array and when I reach 300 samples I average them. Is this the correct way to access the rssi_sample_value?

    I am using the nrf51-dk (pca10028) board, SD 110 v7.1.0 and SDK v7.2.0.

Related