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

Mesh LE Coded

Hello everybody

I have some nrf52840-DKs and other boards with the same module and I want to create a LE Coded mesh with these boards, I am aware that the BLE Mesh standard is for BLE Legacy it's just a proof of concept as LE Coded has given us good results in the same environment. I have seen that this is something that has been commented on several times in this forum. I have tried to use the patch that is commented in this old thread but it does not seem to work for me, apart from the modifications discussed there I also changed the power, this seems to work because I see a notable difference between using RADIO_POWER_NRF_0DBM and RADIO_POWER_NRF_POS8DBM which tells me that it is changing the power even though with the regular SDK I use softdevice to change these parameters instead of modify these registers.

However with the rest of the changes it is only works without the last change but seems to be the same as I test with 2 DKs at same position and orientations and results are almost the same Coded or Legacy. If I set the last change (5th element in radio_mode_to_us_per_byte[] from 128 to 64.) gives me an error.

app_error_weak.c,  105, Mesh assert at 0x0003BB20 (:0)

This belong to the following line

nordic_sdk/sdk_mesh/mesh/bearer/src/bearer_handler.c:162 (discriminator 1)

Which is also commented here

I don't know what the problem could be, I believe I have set all correctly, maybe in newer versions of the Mesh SDK something has been changed and this patch doesn't work.

I'm testing with the mesh sensor example, the SDK version is 17.0.2 and the SDK for Mesh is 5. The code of the project is attached as well

Another doubt I have is if I understood the mesh architecture correctly, there is on one hand the communication between the different nodes of the mesh (which I try to change to Coded) and on the other hand an advertisement that through the nodes that works as a proxy it serves as an entry point to the mesh for e.g. a mobile device.

I have a One Plus 8T with which I tested long range beacon and ble uart coded and it works flawlessly. My idea was that the advertisement of the mesh should also be Le Coded to take advantage of the support of the smartphone. I didn't test it too much I tried to change in mesh_adv.c the primary and secondary PHY for Coded along with some change of buffers sizes and intervals but it didn't work, I understand that the main problem to deal with Coded is the bigger preamble and time on air of the frames. In any case this last one is secondary if it is possible to do it perfect if not I simply connect by serial another board that forward the information in beacon long range or something Le Coded that the mobile can read perfectly.

Thanks in advance

Best regards

Parents
  • Ups silly of me, I just noticed that I had the following code wrong in broadcast.c that's why it didn't work when I made the last change of the patch.

    I have this

    static inline ts_timestamp_t time_required_to_send_us(const packet_t * p_packet, uint8_t channel_count, radio_mode_t radio_mode)
    {
        static const uint8_t radio_mode_to_us_per_byte[RADIO_MODE_END] =  {8, 4, 32, 8
                                                                #ifdef NRF52_SERIES
                                                                               ,4, 64
                                                                #endif
                                                                               }; //128
        uint32_t packet_length_in_bytes = BLE_PACKET_OVERHEAD(RADIO_MODE_BLE_1MBIT) + p_packet->header.length;
    #ifdef NRF52_SERIES
        if (radio_mode == RADIO_MODE_BLE_2MBIT)
        {
            packet_length_in_bytes += RADIO_PREAMBLE_LENGTH_2MBIT_EXTRA_BYTES;
        }
    #endif
        uint32_t radio_time_per_channel = RADIO_RAMPUP_TIME +
                                          (packet_length_in_bytes * radio_mode_to_us_per_byte[radio_mode]) +
                                          RADIO_DISABLE_TO_DISABLED_DELAY_US;
        if (radio_mode == RADIO_MODE_NRF_62K5BIT)
        {
            //__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "long range preamble\n");
            packet_length_in_bytes += RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES;
        }
        return (BROADCAST_SOFTWARE_OVERHEAD_US + USR_SOFTWARE_OVERHEAD_US + radio_time_per_channel * channel_count);
    }
    

    I put the "if" of RADIO_MODE_NRF_62K5BIT after set the radio_time_per_channel if I put the "If" before this variable works without error with 64 but no futher improvement in range

Reply
  • Ups silly of me, I just noticed that I had the following code wrong in broadcast.c that's why it didn't work when I made the last change of the patch.

    I have this

    static inline ts_timestamp_t time_required_to_send_us(const packet_t * p_packet, uint8_t channel_count, radio_mode_t radio_mode)
    {
        static const uint8_t radio_mode_to_us_per_byte[RADIO_MODE_END] =  {8, 4, 32, 8
                                                                #ifdef NRF52_SERIES
                                                                               ,4, 64
                                                                #endif
                                                                               }; //128
        uint32_t packet_length_in_bytes = BLE_PACKET_OVERHEAD(RADIO_MODE_BLE_1MBIT) + p_packet->header.length;
    #ifdef NRF52_SERIES
        if (radio_mode == RADIO_MODE_BLE_2MBIT)
        {
            packet_length_in_bytes += RADIO_PREAMBLE_LENGTH_2MBIT_EXTRA_BYTES;
        }
    #endif
        uint32_t radio_time_per_channel = RADIO_RAMPUP_TIME +
                                          (packet_length_in_bytes * radio_mode_to_us_per_byte[radio_mode]) +
                                          RADIO_DISABLE_TO_DISABLED_DELAY_US;
        if (radio_mode == RADIO_MODE_NRF_62K5BIT)
        {
            //__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "long range preamble\n");
            packet_length_in_bytes += RADIO_PREAMBLE_LENGTH_LR_EXTRA_BYTES;
        }
        return (BROADCAST_SOFTWARE_OVERHEAD_US + USR_SOFTWARE_OVERHEAD_US + radio_time_per_channel * channel_count);
    }
    

    I put the "if" of RADIO_MODE_NRF_62K5BIT after set the radio_time_per_channel if I put the "If" before this variable works without error with 64 but no futher improvement in range

Children
No Data
Related