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

nRF52840 Dongle long range (coded PHY) testing

Hi,

I am interested in testing the capability of Bluetooth 5's long range.

I have two nRF52840 dongles (pca10059 v1.0.0). So far I have had one dongle using nRF Connect v2.5.0 - Bluetooth Low Energy app on Windows 10 to scan and have attempted to program the second dongle with the ble_app_blinky_pca10059_s140 example (from nRF_SDK_15.1.0), slightly modified to advertise using coded PHY (this has not been successful).

I just want to test what rssi values I get at different distances using this long range feature, if anyone can suggest an easy way to do this using the two dongles I have that would be great.

Some other questions I have.

1. Does the nRF Connect - Bluetooth Low Energy app scan for coded PHY advertisements by default if I am using an nRF52840 dongle? Assuming I got one dongle to correctly advertise using coded PHY, would it show up on the Connect - BLE app when scanning with the other dongle?

2. I have been unsuccessful in changing the ble_app_blinky example to advertise using coded PHY. The code snippets below reflect the only changes I have made to the example in my attempts.

    // Set advertising parameters.
    memset(&adv_params, 0, sizeof(adv_params));

    adv_params.primary_phy     = BLE_GAP_PHY_CODED;
    adv_params.secondary_phy   = BLE_GAP_PHY_CODED;
    adv_params.duration        = APP_ADV_DURATION;
    adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED; //from not extended and scannable
    adv_params.p_peer_addr     = NULL;
    adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    adv_params.interval        = APP_ADV_INTERVAL;

    err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &adv_params);
    APP_ERROR_CHECK(err_code);

/**@brief Struct that contains pointers to the encoded advertising data. */
static ble_gap_adv_data_t m_adv_data =
{
    .adv_data =
    {
        .p_data = m_enc_advdata,
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    },
    .scan_rsp_data =
    {
        .p_data = NULL,
        .len    = 0 //was as abve

    }
};

In this case the green LED that is supposed to turn on when advertising does not turn on. 

I have also tried leaving the code unchanged from when I initially downloaded it and only adding secondary_phy = BLE_GAP_PHY_CODED

    // Set advertising parameters.
    memset(&adv_params, 0, sizeof(adv_params));

    adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
    adv_params.secondary_phy   = BLE_GAP_PHY_CODED;
    adv_params.duration        = APP_ADV_DURATION;
    adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED; //from not extended and scannable
    adv_params.p_peer_addr     = NULL;
    adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    adv_params.interval        = APP_ADV_INTERVAL;

    err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_data, &adv_params);
    APP_ERROR_CHECK(err_code);

/**@brief Struct that contains pointers to the encoded advertising data. */
static ble_gap_adv_data_t m_adv_data =
{
    .adv_data =
    {
        .p_data = m_enc_advdata,
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    },
    .scan_rsp_data =
    {
        .p_data = m_enc_scan_response_data,
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX

    }
};

In this case the dongle is advertising (LED is green and I can see it in scan) but I don't think it is using the long range (coded PHY)

Any help/suggestions is appreciated.

Thanks, Reece

Parents
  • Hello,

    I would recommend that you try to port it to SDK15.2.0. SDK15.1.0 was pulled (not from all download sites, but some). There was some issues. It is fixed in SDK15.2.0. It should be API compatible.

    Just to mention first, the RSSI is not stronger when you use long range. But you can get the RSSI value from e.g. the advertising reports.

    1: No. The nRF Connect for desktop can't scan with CODED_PHY. The reason for this is that it is currently using an old version of the softdevice.

    2: You can't use Coded Phy as the primary phy, but you can use it as the secondary phy. This is why you can't see it when you try to use coded as primary phy. sd_ble_gap_adv_set_configure will not return NRF_SUCCESS with coded phy as primary phy.

    If you have an nRF52840DK, I would suggest that you use this for development. First when you know that the application is running, you can flash it to the dongle. The reason for this is that you can debug with the DK, and not with the dongle. So it is easier to catch errors like this with the DK.

    To see scan using coded phy, you must create a central application that does this.

    Best regards,

    Edvin

  • Hi, 

    Thanks for this information it has been very helpful.

    Reece

Reply Children
No Data
Related