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

Coded PHY distance testing

We're developing Bluetooth tags that we would like to operate at both 1Mbps and coded (long range). From what I've read and seen from the Nordic testing, specifically "Testing Long Range (Coded PHY) with Nordic solution (It Simply Works)" found on the DevZone is that coded PHY should reach a distance of approximately twice as far (90%) as 1M PHY. With our initial distance testing on our product, we're not seeing much of a difference (if any) between the two PHY's. Our application is a custom beacon. We also tried the "nRF52-ble-long-range-demo" found on GitHub, which is the code that the previously mentioned article uses to do their testing. Using this unmodified hex file on the nRF52840 dev kits, we also found almost no difference in our distance testing. We're generally doing line of sight testing. I'm wondering what we could be doing wrong and have other users of coded PHY seen the twice the distance claim in their testing. We need to be able to achieve this advertised additional distance in our product.

Parents
  • Here's how I change between 1M and coded:

    if (use_coded)
    {
    m_adv_params.primary_phy = BLE_GAP_PHY_CODED;
    m_adv_params.secondary_phy = BLE_GAP_PHY_CODED;
    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    }
    else
    {
    m_adv_params.primary_phy = BLE_GAP_PHY_1MBPS;
    m_adv_params.secondary_phy = BLE_GAP_PHY_1MBPS;
    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    }

    m_adv_params.scan_req_notification = 0;

    m_adv_params.p_peer_addr = NULL; // Undirected advertisement.
    m_adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval = NON_CONNECTABLE_ADV_INTERVAL;
    m_adv_params.duration = 0; // Never time out.

    err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len);
    APP_ERROR_CHECK(err_code);

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

    err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);
    APP_ERROR_CHECK(err_code);

    I'm I missing anything?

Reply
  • Here's how I change between 1M and coded:

    if (use_coded)
    {
    m_adv_params.primary_phy = BLE_GAP_PHY_CODED;
    m_adv_params.secondary_phy = BLE_GAP_PHY_CODED;
    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    }
    else
    {
    m_adv_params.primary_phy = BLE_GAP_PHY_1MBPS;
    m_adv_params.secondary_phy = BLE_GAP_PHY_1MBPS;
    m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    }

    m_adv_params.scan_req_notification = 0;

    m_adv_params.p_peer_addr = NULL; // Undirected advertisement.
    m_adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval = NON_CONNECTABLE_ADV_INTERVAL;
    m_adv_params.duration = 0; // Never time out.

    err_code = ble_advdata_encode(&advdata, m_adv_data.adv_data.p_data, &m_adv_data.adv_data.len);
    APP_ERROR_CHECK(err_code);

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

    err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);
    APP_ERROR_CHECK(err_code);

    I'm I missing anything?

Children
  • Might not help, but we had this note:

        // If using BLE_GAP_PHY_CODED in Central change NRF_BLE_SCAN_BUFFER (31) to BLE_GAP_SCAN_BUFFER_EXTENDED_MIN (255)
        init.config.ble_adv_secondary_phy = BLE_GAP_PHY_CODED; // uint32_t PHY for the primary advertising. @ref BLE_GAP_PHYS (BLE_GAP_PHY_1MBPS, BLE_GAP_PHY_2MBPS or BLE_GAP_PHY_CODED)
        init.config.ble_adv_primary_phy   = BLE_GAP_PHY_CODED; // uint32_t PHY for the secondary (extended) advertising @ref BLE_GAP_PHYS (BLE_GAP_PHY_1MBPS, BLE_GAP_PHY_2MBPS or BLE_GAP_PHY_CODED)

    Maybe try adjusting the tx power

      // Optional: Change transmitter output power
      // - If role is BLE_GAP_TX_POWER_ROLE_ADV, the advertising set identified with the advertising handle,
      //   will use the specified transmit power, and include it in the advertising packet headers
      //  - For all other roles the handle is ignored
      int8_t TxPower = +4;
      // Supported tx_power values: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +3dBm and +4dBm.
      uint32_t err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, TxPower);

  • Yes, I didn't show the line of code, but I have set to +8.

Related