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

Easiest way to make a Long Range Beacon with nRF52840?

I've just got my hands on a nRF52840 DK and need to quickly evaluate it as a bluetooth 5 beacon in long range mode.

I assume I can just modify an example project to make this happen. If that's the case, what's the best example to start from and what sort of modification will I need to do to reconfigure it as a long range beacon?

Parents Reply Children
  • In my case it I'd like to test this for an application.

    Thanks for the threads. I've been changing some of the parameters based on what I've read.

    Seems like the below parameters compile and run, but I don't know if they actually work on BT5 yet!

        m_adv_params.primary_phy     = BLE_GAP_PHY_CODED;
        m_adv_params.secondary_phy   = BLE_GAP_PHY_CODED;
        m_adv_params.scan_req_notification = 0;
    
        m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
        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.

  • It should work with those parameters. You may change the output power after you have added the adv. set as well to increase the range further. The output power is 0 dBm by default. 

    eg.,

    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_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_adv_handle, 8); //+8dBm
    APP_ERROR_CHECK(err_code);
      

    Also, I saw from your other post that you wanted to use a 52840 dongle for scanning. We don't have any ready-made examples for it, but you can try the hex file attached below. I based it on the usbd_ble_uart example and changed it so that it will only scan for coded PHY advertisement packets and print the address and RSSI of those packets over the USB interface. 

    beacon_lr_scanner_w_s140.hex

    Expected output when you connect a serial client to the vcom port

      

  • Thank you! This is exactly the kind of tool I was looking for!

  • I'm trying to reproduce this from examples, to run on the nRF52840 DK, but I am really struggling. 

    Could you please talk me through the steps you took to achieve this? I feel there is a lot of specific advice on these forums across many many varying SDKs/soft devices, but a distinct lack of tutorials in anything.

  • The same .hex will probably run fine on the 5284 DK, but you need to connect another USB cable to the nRF USB port to get the log messages. 

    Below is the source code if you want to see the changes I made. It's based onthe usbd_ble_uart example in sdk 15.3.0 (\examples\peripheral\usbd_ble_uart)

    usbd_ble_uart_lr_scanner.zip

Related