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

nrf long range example with low data rate

hello,

i am using two customised  nrf52840 boards and this example https://github.com/NordicPlayground/nRF52-ble-long-range-demo  to get the maximum range between two boards i want to achieve that in low data rate of  500 kbps or 125 kbps. i know that by default that example uses BLE_GAP_PHY_CODED  0x04 i dont know which data rate is this my question is

1)how can i set the data rates to 500 kbps or 125kpbs in that example

2) if i can connect the two devices in 1 km range can i able send the data without any packet loss? how can i do this?

regards

manikandan

Parents
  • Hi,

    1. See this post.
    2. The maximum range will depend on the environment and surroundings. You will not be able to achieve 1km range indoors with much interference, but it could be achieved outside with free line of sight and little interference. You will always see some packet loss, 0% packet loss is almost never possible in wireless communication, unless you are transmitting in a fully shielded room. The Bluetooth stack will ACK the messages, to make sure that packages are arriving correctly, or perform a retransmit if packet is lost. If packets cannot be delivered, a timeout error can be reported. If the devices are too far apart to communicate, the connection will be disconnected after a timeout period.

    Best regards,
    Jørgen

Reply
  • Hi,

    1. See this post.
    2. The maximum range will depend on the environment and surroundings. You will not be able to achieve 1km range indoors with much interference, but it could be achieved outside with free line of sight and little interference. You will always see some packet loss, 0% packet loss is almost never possible in wireless communication, unless you are transmitting in a fully shielded room. The Bluetooth stack will ACK the messages, to make sure that packages are arriving correctly, or perform a retransmit if packet is lost. If packets cannot be delivered, a timeout error can be reported. If the devices are too far apart to communicate, the connection will be disconnected after a timeout period.

    Best regards,
    Jørgen

Children
  • thanks that helped now can i able to connect the two devices now i have to disconnect the device after 5 seconds and again start scanning after 3 seconds i doing it like this but that does not seems to be working can you help me with this

    if(m_adv_scan_phy_selected == SELECTION_CODED_PHY)
             {
               NRF_LOG_INFO("Connecting on coded phy.");
               err_code = sd_ble_gap_connect(&p_adv_report->peer_addr,
                                               &m_scan_param_coded_phy,
                                               &m_conn_param,
                                               APP_BLE_CONN_CFG_TAG);
               if (err_code != NRF_SUCCESS)
                 {
                     NRF_LOG_ERROR("sd_ble_gap_connect() failed: 0x%x.", err_code);
                 }
     
              printf("mani");   
            //err_code = app_timer_start(led_toggle_on_connection, FAST_BLINK_INTERVAL, NULL);
    
            nrf_delay_ms(5000);
            sd_ble_gap_disconnect(m_conn_handle,BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);  
                 
             }

    thanks and regards

    manikandan v

  • Did you check the return code from sd_ble_gap_disconnect(), to see if any errors are returned?

    In general, it is better to use a timer for such tasks. I suspect that the function your are putting the 5 seconds delay inside is running in interrupt context, which may prevent your application from handling other lower/same priority events an potentially preventing handling of events from the softdevice. If you want to test with delays, set a flag in the function after connection, then check for this flag inside main() loop and put the delay here to allow handling of other events.

Related