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

Related to BLE lon range

Dear nordic

I changed my BLE application to coded phy for long range (chip used nrf52840) . application works fine(debug). 

But i cant see any advertising  in smart phone BLE appliation's 

I need a help to see my device advertising packet . I think device advertising has no problem but its not seen in smart phones  

can you help me to find out why smart phone not detect the advertisings.

is it any other way to find device properly advertise or not?

need some helps

Parents
  • What smart phones?

    And running what operating system(s)?

    And what version(s) ?

    Do the phones and/or operating systems support BT 5 features?

    blog.bluetooth.com/exploring-bluetooth-5-going-the-distance

  • SDK 15 are used in device

    Android 8.0 and Bluetooth 5 are also supported

    Nothing will see in phones but code works fine no hangs this is for coded phy

    but in 1mb phy phone get advertising and find device 

    i don't know where the problem (device side or phone side)? i need some help to solve this

  • Bluetooth 5 are also supported

    Note that many BT 5 features are optional (as mentioned in the link) - are you sure that the Coded PHY is supported ... ?

  • Iam tested using Smartphone redmi note5 pro

    Phone spec shows it Suppotted BT5 

    how i check it supported coded phy ?

    is it any way to find my device beconing in coded phy ?

  • Hi Alan,

    That the phone supports BT5 does not mean it supports DLE or coded phy, since these features are optional, so you don't need to have them to support BT5.

    You can check which features are supported if you take a sniffer trace and see the feature exchange between phone and nRF52840. You can use nRF sniffer for example.

    But be aware that we haven't seen any phone that supports coded PHY in the market yet.

    If you want to experiment with all the features for Bluetooth 5 I recommend you purchasing two nRF52840 Preview Development Kits.

    See this blog post about how you can test the long range (with LE Coded PHY) feature with 2 nRF52840 DK here https://devzone.nordicsemi.com/b/blog/posts/testing-long-range-coded-phy-with-nordic-solution-it-simply-works-922075585

    Best Regards,

    Marjeris

  • That the phone supports BT5 does not mean it supports DLE or coded phy, since these features are optional

    Indeed.

    And that doesn't just apply to phones: it applies to any device claiming "BT5" support - eg, the nRF52832 & nRF52810 both state "BT5" support, but do not have Coded PHY:

    https://devzone.nordicsemi.com/f/nordic-q-a/39532/is-it-only-nrf52840-s140-which-support-bt5-long-range-coded-phy

  • Thanks for your reply i need one more help i tested BLE central relay example for long range 

    i dont know it is right procedure to setting

    can you check that?

    I changed in ble_advertising .c like below(bolded below)

    uint32_t ble_advertising_init(ble_advertising_t * const p_advertising,
    ble_advertising_init_t const * const p_init)
    {
    uint32_t ret;
    if ((p_init == NULL) || (p_advertising == NULL))
    {
    return NRF_ERROR_NULL;
    }
    if (!config_is_valid(&p_init->config))
    {
    return NRF_ERROR_INVALID_PARAM;
    }

    p_advertising->adv_mode_current = BLE_ADV_MODE_IDLE;
    p_advertising->adv_modes_config = p_init->config;
    p_advertising->conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT;
    p_advertising->evt_handler = p_init->evt_handler;
    p_advertising->error_handler = p_init->error_handler;
    p_advertising->current_slave_link_conn_handle = BLE_CONN_HANDLE_INVALID;
    p_advertising->p_adv_data = &p_advertising->adv_data;

    memset(&p_advertising->peer_address, 0, sizeof(p_advertising->peer_address));

    // Copy advertising data.
    if (!p_advertising->initialized)
    {
    p_advertising->adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
    }
    p_advertising->adv_data.adv_data.p_data = p_advertising->enc_advdata;
    p_advertising->adv_data.adv_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX;

    ret = ble_advdata_encode(&p_init->advdata, p_advertising->enc_advdata, &p_advertising->adv_data.adv_data.len);
    VERIFY_SUCCESS(ret);

    if (&p_init->srdata != NULL)
    {
    p_advertising->adv_data.scan_rsp_data.p_data = p_advertising->enc_scan_rsp_data;
    p_advertising->adv_data.scan_rsp_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX;

    ret = ble_advdata_encode(&p_init->srdata,
    p_advertising->adv_data.scan_rsp_data.p_data,
    &p_advertising->adv_data.scan_rsp_data.len);
    VERIFY_SUCCESS(ret);
    }
    else
    {
    p_advertising->adv_data.scan_rsp_data.p_data = NULL;
    p_advertising->adv_data.scan_rsp_data.len = 0;
    }

    // Configure a initial advertising configuration. The advertising data and and advertising
    // parameters will be changed later when we call @ref ble_advertising_start, but must be set
    // to legal values here to define an advertising handle.
    p_advertising->adv_params.primary_phy = BLE_GAP_PHY_CODED;
    p_advertising->adv_params.duration = p_advertising->adv_modes_config.ble_adv_fast_timeout;
    p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
    p_advertising->adv_params.p_peer_addr = NULL;
    p_advertising->adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
    p_advertising->adv_params.interval = p_advertising->adv_modes_config.ble_adv_fast_interval;

    ret = sd_ble_gap_adv_set_configure(&p_advertising->adv_handle, NULL, &p_advertising->adv_params);
    VERIFY_SUCCESS(ret);

    p_advertising->initialized = true;
    return ret;
    }

    above two line i changed 

     is it any wrong in my procedure i need some help

Reply
  • Thanks for your reply i need one more help i tested BLE central relay example for long range 

    i dont know it is right procedure to setting

    can you check that?

    I changed in ble_advertising .c like below(bolded below)

    uint32_t ble_advertising_init(ble_advertising_t * const p_advertising,
    ble_advertising_init_t const * const p_init)
    {
    uint32_t ret;
    if ((p_init == NULL) || (p_advertising == NULL))
    {
    return NRF_ERROR_NULL;
    }
    if (!config_is_valid(&p_init->config))
    {
    return NRF_ERROR_INVALID_PARAM;
    }

    p_advertising->adv_mode_current = BLE_ADV_MODE_IDLE;
    p_advertising->adv_modes_config = p_init->config;
    p_advertising->conn_cfg_tag = BLE_CONN_CFG_TAG_DEFAULT;
    p_advertising->evt_handler = p_init->evt_handler;
    p_advertising->error_handler = p_init->error_handler;
    p_advertising->current_slave_link_conn_handle = BLE_CONN_HANDLE_INVALID;
    p_advertising->p_adv_data = &p_advertising->adv_data;

    memset(&p_advertising->peer_address, 0, sizeof(p_advertising->peer_address));

    // Copy advertising data.
    if (!p_advertising->initialized)
    {
    p_advertising->adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
    }
    p_advertising->adv_data.adv_data.p_data = p_advertising->enc_advdata;
    p_advertising->adv_data.adv_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX;

    ret = ble_advdata_encode(&p_init->advdata, p_advertising->enc_advdata, &p_advertising->adv_data.adv_data.len);
    VERIFY_SUCCESS(ret);

    if (&p_init->srdata != NULL)
    {
    p_advertising->adv_data.scan_rsp_data.p_data = p_advertising->enc_scan_rsp_data;
    p_advertising->adv_data.scan_rsp_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX;

    ret = ble_advdata_encode(&p_init->srdata,
    p_advertising->adv_data.scan_rsp_data.p_data,
    &p_advertising->adv_data.scan_rsp_data.len);
    VERIFY_SUCCESS(ret);
    }
    else
    {
    p_advertising->adv_data.scan_rsp_data.p_data = NULL;
    p_advertising->adv_data.scan_rsp_data.len = 0;
    }

    // Configure a initial advertising configuration. The advertising data and and advertising
    // parameters will be changed later when we call @ref ble_advertising_start, but must be set
    // to legal values here to define an advertising handle.
    p_advertising->adv_params.primary_phy = BLE_GAP_PHY_CODED;
    p_advertising->adv_params.duration = p_advertising->adv_modes_config.ble_adv_fast_timeout;
    p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
    p_advertising->adv_params.p_peer_addr = NULL;
    p_advertising->adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
    p_advertising->adv_params.interval = p_advertising->adv_modes_config.ble_adv_fast_interval;

    ret = sd_ble_gap_adv_set_configure(&p_advertising->adv_handle, NULL, &p_advertising->adv_params);
    VERIFY_SUCCESS(ret);

    p_advertising->initialized = true;
    return ret;
    }

    above two line i changed 

     is it any wrong in my procedure i need some help

Children
  • uint32_t ble_advertising_init(ble_advertising_t            * const p_advertising,
                                  ble_advertising_init_t const * const p_init)
    {
        uint32_t ret;
        if ((p_init == NULL) || (p_advertising == NULL))
        {
            return NRF_ERROR_NULL;
        }
        if (!config_is_valid(&p_init->config))
        {
            return NRF_ERROR_INVALID_PARAM;
        }
    
        p_advertising->adv_mode_current               = BLE_ADV_MODE_IDLE;
        p_advertising->adv_modes_config               = p_init->config;
        p_advertising->conn_cfg_tag                   = BLE_CONN_CFG_TAG_DEFAULT;
        p_advertising->evt_handler                    = p_init->evt_handler;
        p_advertising->error_handler                  = p_init->error_handler;
        p_advertising->current_slave_link_conn_handle = BLE_CONN_HANDLE_INVALID;
        p_advertising->p_adv_data                     = &p_advertising->adv_data;
    
        memset(&p_advertising->peer_address, 0, sizeof(p_advertising->peer_address));
    
        // Copy advertising data.
        if (!p_advertising->initialized)
        {
            p_advertising->adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
        }
        p_advertising->adv_data.adv_data.p_data = p_advertising->enc_advdata;
        p_advertising->adv_data.adv_data.len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX;
    
        ret = ble_advdata_encode(&p_init->advdata, p_advertising->enc_advdata, &p_advertising->adv_data.adv_data.len);
        VERIFY_SUCCESS(ret);
    
        if (&p_init->srdata != NULL)
        {
            p_advertising->adv_data.scan_rsp_data.p_data = p_advertising->enc_scan_rsp_data;
            p_advertising->adv_data.scan_rsp_data.len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX;
    
            ret = ble_advdata_encode(&p_init->srdata,
                                      p_advertising->adv_data.scan_rsp_data.p_data,
                                     &p_advertising->adv_data.scan_rsp_data.len);
            VERIFY_SUCCESS(ret);
        }
        else
        {
            p_advertising->adv_data.scan_rsp_data.p_data = NULL;
            p_advertising->adv_data.scan_rsp_data.len    = 0;
        }
    
        // Configure a initial advertising configuration. The advertising data and and advertising
        // parameters will be changed later when we call @ref ble_advertising_start, but must be set
        // to legal values here to define an advertising handle.
        p_advertising->adv_params.primary_phy     = BLE_GAP_PHY_CODED;
        p_advertising->adv_params.duration        = p_advertising->adv_modes_config.ble_adv_fast_timeout;
        p_advertising->adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
        p_advertising->adv_params.p_peer_addr     = NULL;
        p_advertising->adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
        p_advertising->adv_params.interval        = p_advertising->adv_modes_config.ble_adv_fast_interval;
    
        ret = sd_ble_gap_adv_set_configure(&p_advertising->adv_handle, NULL, &p_advertising->adv_params);
        VERIFY_SUCCESS(ret);
    
        p_advertising->initialized = true;
        return ret;
    }
    

    just change phy and type.

  • Hi,

    I think this will work. Have you try to test it?

    And if you haven't had a look at it I will post the link to our long range demo with nRF52840 DK here.

    In the demo the secondary phy was also set to BLE_GAP_PHY_CODED. You can read more about advertising in Bluetooth 5 in this blog post.

    If it doesn't work just let med know and I will try to implement long range with the relay example myself on Monday.

    Best Regards,

    Marjeris

  • Thanks for your support i tested but its not working so i debugged the program and check current phy

    I found that the phy automatically changes to 1mb phy i need some help to solve this 

    The problem i have no DK board i have only my own custom board i tested with my custom board so i want to change in relay application to get long range if any wrong in my procedure(code)  it is very difficult to find because i have no DK board. so need some help to implement long range

  • Hi Alan,

    I will take a look at how to implement long range in the relay example for your application and try to help you as good as I can. But could you open a new ticket for this question? Since it can get messy and the original post was about not seeing the device advertising with your smartphone.

    Best Regards,

    Marjeris

Related