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

Read RSSI value

Hello,

I'm using 2 nRF58840 dev kit with SDK 14.2.0. I'm trying to read the RSSI value of the second board from the first board using LE Coded PHY in both modules.

I started with the "ATT_MTU Throughput" example which worked correctly when choosing the LE coded PHY.

I changed the "DEVICE_NAME" so that no connection will be established. In the BLE_GAP_EVT_ADV_REPORT event, I put this below line to display the RSSI value

if ( p_gap_evt->params.adv_report.scan_rsp )
       NRF_LOG_INFO("rssi =%d dBm",p_gap_evt->params.rssi_changed.rssi);

When running this code no BLE_GAP_EVT_ADV_REPORT event corresponds to the scan_rsp. also no BLE_GATTS_EVT_TIMEOUT events aswell.

My questions are :

  • any thoughts of what might be wrong in my configuration ?

  • When executing sd_ble_gap_scan_start(), the BLE_GAP_EVT_ADV_REPORT will be set each time a device is discovered or it after 'scan window' time ?

-When using only the LE coded PHY, the nRF module will only see modules advertising on the same physical layer ?

  • sd_ble_gap_rssi_start() function require a connection, is there another function that scans for the RSSI of visible devices ?

Any helps would be very appreciated

Thank You Chaabane

  • Hi,

    Q1: I'm not sure if I understand why you useif ( p_gap_evt->params.adv_report.scan_rsp ). Do you really only want to print RSSI on scan responses? You are not necessarily getting a scan response from all devices. Why don't you simply use NRF_LOG_INFO("rssi =%d dBm",p_gap_evt->params.rssi_changed.rssi);, and no if(...) in each BLE_GAP_EVT_ADV_REPORT event? This would print the RSSI from every single received advertising packet.

    Q2: The event will occur each time a device is discovered.

    Q3: Yes. Devices on different physical layers cannot hear each other.

    Q4: You should use the BLE_GAP_EVT_ADV_REPORT event.

  • Hi Martin, Thank you for the feedback.

    Q1: without scan_rsp checking I get RSSI values : 0, 2 and 6. They don't look like real RSSI in dBm ?. That's why I put this condition for testing purposes. so the real question is why I'm receiving these values of RSSI and also is it normal that the RSSI si declared as signed char ?

    Q2 : Ok, that's what I thought.

    Q3: When using my phone (doesn't have bleutooth 5) with nRF connect App I am able to see both modules. I verified that the PHY used in both modules is LE coded by using 'config print' command in PuTTY. Does that make sense ?

    Q4: OK.

    Thank you. Chaabane

  • Thinking about it, RSSI values can be positive. It is just that i'm not used to have such a strong signal with the modules I used before!

  • Q1: I didn't read your code carefully enough. You should use p_ble_evt->evt.gap_evt.params.adv_report.rssi to get the RSSI. Then you will get it in every adv report, not just the scan reports.

    Q3: Not really. If the phone doesn't support 2Mbps or coded phy it is simply not physically possible. It is possible though, that your module is designed to advertise on 1Mbps phy and then switch to coded phy after you have connected.

Related