nRF5340 ESB, scanning RSSI across channels

I have worked a bit with ESB and see that there are functions to get/set a channel, as well as check the RSSI value in the "struct esb_payload" for a packet. Are there already some existing functions in the ESB library, or lower level libraries, that allow for scanning all the channels and reviewing all their RSSI values? Or would it have to be done in the application side with the existing ESB library functions?

We're trying to ultimately implement adaptive frequency hopping, but with ESB.

I'm working with the nRF5340, Windows 11, and NCS Connect SDK v2.5.0.

-------

EDIT 1 - I tried using some of the 'fw' code from the RSSI Viewer app (in a standalone application i.e., no ESB) and flashed it onto the nRF. It did report fluctuating values across all the channels I was interested in. But when I undo the commenting out of the ESB functionality, logs seem to report 1 TX_FAILED event followed by no other packets received.

  • See the PTX project here, adapted from NCS v2.5.0 at nrf/samples/esb/esb_ptx/
  • For PRX project, I used the one exactly from NCS v2.5.0 at nrf/samples/esb/esb_prx/

-------

EDIT 2 - From reviewing the RSSI code some more, it seems to switch the radio to RX mode, read the RSSI, then disable the radio. Perhaps that's causing ESB to be disabled somehow?

Parents
  • Hello,

    All communication in the 2.4GHz band is packet based and changes continuously. RSSI might give some indication on the receive strength, e.g. whether the peer device is near or far away, but it's not very useful for any kind of assessment of the channel. If you want such functionality, then simply over time have an array where you for instance monitor the amount of retransmissions or packet lost on the channels used, and then based on that you can try to avoid specific channels that you see there is more loss on than others. 

    If you want to manually sweep through channels to measure RSSI, then I expect you need to disable ESB, manually do as you already do in rssi_measurer_scan_channel_repeat(), then enable ESB again afterwards. Be aware that the rssi_measurer_scan_channel_repeat() seems to rely on a lot of radio registers have their default reset state, which might not be the case if ESB is initialized, hopefully disabling ESB will reset the radio, else you may need to attach a debugger and find which registers that ESB might have left configured after disable and write them back to default reset state before you do the rssi_measurer_scan_channel_repeat().

    Kenneth

Reply
  • Hello,

    All communication in the 2.4GHz band is packet based and changes continuously. RSSI might give some indication on the receive strength, e.g. whether the peer device is near or far away, but it's not very useful for any kind of assessment of the channel. If you want such functionality, then simply over time have an array where you for instance monitor the amount of retransmissions or packet lost on the channels used, and then based on that you can try to avoid specific channels that you see there is more loss on than others. 

    If you want to manually sweep through channels to measure RSSI, then I expect you need to disable ESB, manually do as you already do in rssi_measurer_scan_channel_repeat(), then enable ESB again afterwards. Be aware that the rssi_measurer_scan_channel_repeat() seems to rely on a lot of radio registers have their default reset state, which might not be the case if ESB is initialized, hopefully disabling ESB will reset the radio, else you may need to attach a debugger and find which registers that ESB might have left configured after disable and write them back to default reset state before you do the rssi_measurer_scan_channel_repeat().

    Kenneth

Children
Related