Ble Mesh: rx->seq cause error

binhla
Posts: 10
Joined: Tue Nov 12, 2019 2:25 am

Ble Mesh: rx->seq cause error

Postby binhla » Sat Jan 08, 2022 4:00 am

Dears,

I created a Ble Mesh Network with a Provisioner and a Node, both are using ESP32-WROM-32 chipset.

Sometime, after provisioning, when I sent esp_ble_mesh_config_client_get_state or esp_ble_mesh_config_client_set_state from the Provisioner to the Node, I got this error:
W (122865) BLE_MESH: Replay: src 0x0001 dst 0x000b seq 0x000046
I added some log inside the IDF

Code: Select all

bool bt_mesh_rpl_check(struct bt_mesh_net_rx *rx, struct bt_mesh_rpl **match)
{
    int i;

    /* Don't bother checking messages from ourselves */
    if (rx->net_if == BLE_MESH_NET_IF_LOCAL) {
        return false;
    }

    /* The RPL is used only for the local node */
    if (!rx->local_match) {
        return false;
    }

    for (i = 0; i < ARRAY_SIZE(bt_mesh.rpl); i++) {
        struct bt_mesh_rpl *rpl = &bt_mesh.rpl[i];

        /* Empty slot */
        if (!rpl->src) {
            if (match) {
                *match = rpl;
            } else {
                update_rpl(rpl, rx);
            }

            return false;
        }

        /* Existing slot for given address */
        if (rpl->src == rx->ctx.addr) {
            if (rx->old_iv && !rpl->old_iv) {
				BT_ERR("rx->old_iv %d, rpl->old_iv %d", rx->old_iv, rpl->old_iv);
                return true;
            }

            if ((!rx->old_iv && rpl->old_iv) ||
                    rpl->seq < rx->seq) {
                if (match) {
                    *match = rpl;
                } else {
                    update_rpl(rpl, rx);
                }

                return false;
            } else {
				BT_ERR("rx->old_iv %d, rpl->old_iv %d, rpl->seq %d, rx->seq %d", rx->old_iv, rpl->old_iv, rpl->seq, rx->seq);
                return true;
            }
        }
    }

    BT_ERR("RPL is full!");
    return true;
}
The log now become
E (1958985) BLE_MESH: rx->old_iv 0, rpl->old_iv 0, rpl->seq 261, rx->seq 74
W (1958985) BLE_MESH: Replay: src 0x0001 dst 0x000e seq 0x00004a
esp32> E (2030955) BLE_MESH: rx->old_iv 0, rpl->old_iv 0, rpl->seq 261, rx->seq 75
W (2030965) BLE_MESH: Replay: src 0x0001 dst 0x000e seq 0x00004b
E (2031055) BLE_MESH: rx->old_iv 0, rpl->old_iv 0, rpl->seq 261, rx->seq 76
W (2031055) BLE_MESH: Replay: src 0x0001 dst 0x000e seq 0x00004c
E (2031755) BLE_MESH: rx->old_iv 0, rpl->old_iv 0, rpl->seq 261, rx->seq 77
W (2031755) BLE_MESH: Replay: src 0x0001 dst 0x000e seq 0x00004d
E (2031795) BLE_MESH: rx->old_iv 0, rpl->old_iv 0, rpl->seq 261, rx->seq 78
W (2031795) BLE_MESH: Replay: src 0x0001 dst 0x000e seq 0x00004e
E (2032505) BLE_MESH: rx->old_iv 0, rpl->old_iv 0, rpl->seq 261, rx->seq 79
W (2032505) BLE_MESH: Replay: src 0x0001 dst 0x000e seq 0x00004f
So must be something wrong with the seq sent from the Provisioner.

How can I fix this error?
I am using ESP_IDF ver 4.2.1

ixtreme3
Posts: 7
Joined: Sat May 13, 2023 10:00 am

Re: Ble Mesh: rx->seq cause error

Postby ixtreme3 » Fri Jul 21, 2023 6:31 pm

Hello! I faced the same issue. Did you manage to solve it?

Who is online

Users browsing this forum: No registered users and 237 guests