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

Mesh range, power and mode

Hi, 

In this topic, i was asking about how to increase range in mesh networks. I did some outdoors tests (clear field), changing power (-40, +4, +8 dBm) and mode (1MB and Long Range). Here are my results using light switch example:

nRF52832 / 1MB / +4dBm : ~420 m

nRF52840 / 1MB / +8dBm : ~420 m                                       nRF52840 / 1MB / -40dBm : ~1.3 m

nRF52840 / LR / +8dBm    : ~422 m                                       nRF52840 / LR / -40dBm    : ~1.5 m

It seems that my implementation of the "+8dBm" (which is not defined in Nordic mesh examples) is not correct since i got the same range. I just added a line in the typedef enum "radio_tx_power_t" in radio_config.h. Do i have to do something more to make it work ? What did i miss ? 

/**
 * @brief The tx power configuration values.
 *
 * @note NRF52 does not have -30DBm setting, instead it can be configured to -40DBm,
 * the value of -40DBm and -30DBm are kept the same for code compatibility.
 */
typedef enum
{
    RADIO_POWER_NRF_POS8DBM  = 0x08,
    RADIO_POWER_NRF_POS4DBM  = 0x04,
#ifdef NRF52_SERIES
    RADIO_POWER_NRF_POS3DBM  = 0x03,
#endif
    RADIO_POWER_NRF_0DBM     = 0x00,
    RADIO_POWER_NRF_NEG4DBM  = 0xFC,
    RADIO_POWER_NRF_NEG8DBM  = 0xF8,
    RADIO_POWER_NRF_NEG12DBM = 0xF4,
    RADIO_POWER_NRF_NEG16DBM = 0xF0,
    RADIO_POWER_NRF_NEG20DBM = 0xEC,
    RADIO_POWER_NRF_NEG30DBM = 0xD8,
#ifdef NRF52_SERIES
    RADIO_POWER_NRF_NEG40DBM = 0xD8
#endif
} radio_tx_power_t;

Then, about Long Range, i followed all the steps defined in this thread and the increase in range is really small (about 2 meters out of 420m in +8dBm and 0,20m at -40dBm). 
Could we not expect better results with long range ? Would the difference be greater in indoors environment (I will test this soon, but I think I am missing something when I see my results...).

  • That seems like a good spot to test long range with 8dBm. It  kind of looks the same as the testing place I used to test long range here. But looking at your results it does not look that the radio has changed TX power. Can you be absolutely sure by sniffing the radio registers that the NRF_RADIO-> TXPOWER register is set to the right value. Because the below results cannot be correct with the correct configuration

    nRF52832 / 1MB / +4dBm : ~420 m

    nRF52840 / 1MB / +8dBm : ~420 m 

    nRF52840 / LR / +8dBm    : ~422 m 

     Also, which nRF52840 Rev IC are you testing with?

    There is one thing I need to check regarding adding range delays to the mesh code for long range. I will check this an come back to you soon.

  • Hi Damien,

    Do you know that LR is not part of the Mesh spec and if you use this feature in your product, you will not be able to qualify it ?

    The thread where gave a solution is very experimental and is not intended to be used in final products.

    There are many other conventions that the Mesh stack assumes and I am not sure if every aspect of long range is taken into account here. 

    Since using LR with Mesh is out of our offering for now, I would not be able to spend time to assist in that. But, i would like to know why changing TX power from 4dBm to 8dBm had no effect. 

    Can you attach part of your code where you are changing the tx power

  • Thank you i did not realize that it was not part of the mesh spec.
    I completely understand if you can't assist us on this point.

    Regarding the +8dBm, i added the line "  RADIO_POWER_NRF_POS8DBM = 0x08," in the typedef definition as i showed before. Then i changed the tx_power in this function in advertiser.c:

    static inline void set_default_broadcast_configuration(broadcast_t * p_broadcast)
    {
        p_broadcast->params.access_address = BEARER_ACCESS_ADDR_DEFAULT;
        p_broadcast->params.radio_config.payload_maxlen = RADIO_CONFIG_ADV_MAX_PAYLOAD_SIZE;
        p_broadcast->params.radio_config.radio_mode = RADIO_MODE_BLE_1MBIT;
        p_broadcast->params.radio_config.tx_power = RADIO_POWER_NRF_POS8DBM;
    }

    and in this funcion in scanner.c:

    void scanner_init(bearer_event_flag_callback_t packet_process_cb)
    {
        memset(&m_scanner, 0, sizeof(m_scanner));
    
        packet_buffer_init(&m_scanner.packet_buffer, m_scanner.packet_buffer_data, SCANNER_BUFFER_SIZE);
        scanner_config_reset();
        m_scanner.config.radio_config.tx_power = RADIO_POWER_NRF_POS8DBM;
        m_scanner.config.radio_config.payload_maxlen = RADIO_CONFIG_ADV_MAX_PAYLOAD_SIZE;
        m_scanner.timer_window_end.cb = scan_window_end;
        m_scanner.timer_window_start.cb = scan_window_start;
        m_scanner.state = SCANNER_STATE_IDLE;
        m_scanner.window_state = SCAN_WINDOW_STATE_ON;
        m_scanner.nrf_mesh_process_flag = bearer_event_flag_add(packet_process_cb);
    }

    That's all, and when i change this two lines with "RADIO_POWER_NRF_NEG40DBM" it clearly works since the range is reduced to something like 1 meter.

  • There seems to be a lot of places where i see RADIO_POWER_NRF_0DBM is hardcoded into the tx_power setting.Just to make sure can you set the tx power in radio_config.c file radio_config_config() function and set directly NRF_RADIO->TXPOWER =  RADIO_POWER_NRF_POS8DBM 

    I am still wondering which version of the chip you are using for nRF52840

     

  • I am using nRF52840 Rev1 sorry.
    Yes i can try with this setting if you think it would work but i would be strange since it works with -40dBm, isn't it ?

Related