BLE range testing with two nRF5340 DKs: example code for PHY and TX power variation?

Hi everyone,

I'm currently working on a BLE project using two nRF5340 DKs and would like to perform range tests to evaluate the maximum connection distance under different conditions.

My main objectives are:

  • Test BLE connection range using different PHYs (1M, 2M, Coded S=2, Coded S=8).

  • Be able to change the TX power (e.g., from -20 dBm to +3 dBm).

  • If possible, display real-time RSSI and bitrate or throughput from the central device during the connection.

I've tried doing this with different examples from the SDK (such as central_uart / peripheral_uart and hci_rpmsg / hci_pwr_ctrl), but I haven't been able to achieve the setup I need.

If anyone has any example code that does something similar or any tips or suggestions on how to approach this properly,

I would really appreciate the help!

Thanks in advance!

Parents Reply
  • Also, I’ve been using the throughput example you mentioned, and I actually added some logic to print the RSSI in real time and detect disconnections. It works fine most of the time, though once the connection is lost, the RSSI isn't updated anymore — which is expected, and not a big issue for now.

    The main problem I’m facing is that the connection drops very quickly, even when I'm using Coded PHY S=8. In fact, when I move the boards just around 10 meters apart, they already disconnect, which I didn’t expect given that S=8 should provide a much longer range.

    I'm not sure if I'm missing something — maybe a TX power setting, or antenna placement, or something else in the project configuration?

    Any ideas or advice would be very appreciated.

Children
  • Hi Diego,

    There is no out-of-the-box nRF Connect SDK sample that does exactly what you describe (advertising with selectable PHY, scanning with RSSI logging, and TX power control, all without establishing a connection) for the nRF5340 DK. The closest reference is the blog post on long-range testing with Coded PHY, but that example is based on the nRF52840 and the nRF5 SDK, not the nRF Connect SDK or nRF5340 DK. So the only way is to  adapt the approach from the blog post to the nRF5340 DK and nRF Connect SDK by modifying already existing samples. 

    diegonovo02 said:
    the connection drops very quickly, even when I'm using Coded PHY S=8. In fact, when I move the boards just around 10 meters apart, they already disconnect, which I didn’t expect given that S=8 should provide a much longer range.
    The connection range is often less than the maximum possible advertising/scanning range due to link layer supervision timeouts and other connection management factors. The blog post specifically notes that the maximum range in advertising/scanning mode is often greater than in connection mode. For example, in the referenced test, the non-connected (advertising/scanning) range was 1300 meters with Coded PHY, while the connected range was slightly less, even under ideal conditions. Indoors or with suboptimal antenna orientation, the range can be much less. Factors that can affect your results include: Antenna orientation, TX power, Environment, Project configuration.

    Regards,

    Swathy

Related