4

I’m working on Bluetooth mesh network solution and I have requirement to increase range.

I’m using nrf52840 DK and nrf52840 dongles, nrf5SDKforMeshv310. In Nordic Devzone I found solution which, enables BLE long range mode in NRF SDK for mesh.

NOTE! I'm aware solution doesn't comply with Bluetooth Mesh standard.

Following changes were applied to nrf5 SDK for Mesh v310:

  1. In advertise.c, set_default_broadcast_configuration() changed radio_mode to use RADIO_MODE_NRF_62K5BIT instead of RADIO_MODE_BLE_1MBIT.
  2. In scanner.c, scanner_config_reset() changed scanner_config_radio_mode_set() to use RADIO_MODE_NRF_62K5BIT instead of RADIO_MODE_BLE_1MBIT.
  3. In radio_config.c, radio_config_config() added the following code at the end:
    if (p_config->radio_mode==RADIO_MODE_NRF_62K5BIT ){
        NRF_RADIO->PCNF0 |=(
                    ((RADIO_PCNF0_PLEN_LongRange << RADIO_PCNF0_PLEN_Pos) & RADIO_PCNF0_PLEN_Msk) |
                    ((2 << RADIO_PCNF0_CILEN_Pos) & RADIO_PCNF0_CILEN_Msk) |
                    ((3 << RADIO_PCNF0_TERMLEN_Pos) & RADIO_PCNF0_TERMLEN_Msk) );
    }
    
  4. In broadcast.c, time_required_to_send_us() added:

    if (radio_mode == RADIO_MODE_NRF_62K5BIT)
    {
        packet_length_in_bytes +=RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES;
    }
    

    Defined RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES = 9 in same file

    Changed 5th element in radio_mode_to_us_per_byte[] from 128 to 64.

    NOTE. that the long-range mode is mislabeled. It is called RADIO_MODE_NRF_62K5BIT in the header file but corresponds to the 125kbps BLE long range mode instead.

Unfortunately for relays I’m pushed to use Zephyr to support friend feature and Zephyr is not relaying messages after applying changes to NRF SDK. I did brief investigation on Zephyr side and found that code bits for BLE long range described above for NRF SDK are in place and can be enabled using following Kconfig settings:

CONFIG_BT_AUTO_PHY_UPDATE=y
CONFIG_BT_PHY_UPDATE=y
CONFIG_BT_HCI_MESH_EXT=y
CONFIG_BT_CTLR_PHY=y
CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_CTLR_PHY_CODED=y

But still I don’t see that messages are being relayed on Zephyr side (using J-Link RTT Viewer). I also tried to increase log level for Bluetooth and Mesh to DEBUG, but I don’t see any signs that messages are malformed or rejected.

May be someone has ideas in which direction I should dig in on Zephyr side?

Felix
  • 51
  • 4

0 Answers0