This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2652R: "Out of network buffers" error

Part Number: CC2652R
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi,

I am working in a bluetooth mesh aplication where a node sends a message every 1 or 2 seconds, but after some days or sometimes less than a day running this error appears ("Out of network buffers") and it can no longer send the messages.

This part of code is from the transport.c file of the bluetooth mesh libraries and where I get the "Out of network buffers" error:

static int send_unseg(struct bt_mesh_net_tx *tx, struct net_buf_simple *sdu,
		      const struct bt_mesh_send_cb *cb, void *cb_data,
		      const uint8_t *ctl_op)
{
	struct net_buf *buf;

	buf = bt_mesh_adv_create(BT_MESH_ADV_DATA, tx->xmit, BUF_TIMEOUT);
	if (!buf) {
		BT_ERR("Out of network buffers");
		return -ENOBUFS;
	}

I have increased the number of advertising buffers but the error continues. I don't know if there's a way to increase the number of network buffers but I haven't found it.

Thanks,

Daniel Fernandez

  • Hello Daniel,

    Thanks for reaching out.

    May I ask what SDK version are you using and if this is coming from an out of the box example to have it as reference?

    BR,

    David.

  • Hello David,

    I am using the 6.40.0.13 version of the SDK and the project is based on the simple_mesh_node example.

    Thanks,

    Daniel.

  • Hello Daniel,

    Thanks. Could you please share a bit more of the modifications you have done to the project? Did it work out of the box? How did you modified the number of adv buffers (CONFIG_BT_MESH_ADV_BUF_COUNT)?

    BR,

    David.

  • I changed de number of adv buffers in sysconfig: RF Stacks -> BLE -> BLE Mesh -> Transport Layer -> Num of advertising buffers.

    I have to mention that the device is acting as a provisioner and also as a node of the mesh. Could this be the cause of the error? Would it be better to have that node and the provisioner on diferent devices?

    Thanks,

    Daniel.

  • Hello Daniel,

    I don't think this would be the root cause of the issue, does any new node comes into the mesh during the period of time that leads to the error? Does this error reproduces if the timeout is increased? If you can share a bit more detail about how the issue reproduces, it would be helpful.

    BR,

    David.

  • Hello,

    The node sends a message (1 byte) to another 5 nodes aproximately every second (it sends the message to a group address where all the others nodes are suscribed so it doesn't need to send five messages) and then the other nodes respond with another message (8 bytes) to the main node, at the same time it checks if an unprovisioned beacon has arrived for provision another node. Also that device uses spi(as slave) to comunicate with another device. And that's all it does.

    I think that the error (out of network buffers) may occur when it fails many times to provision a node, but not 100% sure.

    The last week I changed the freqüency of the sending messages to 2 seconds and since then the error has not occurred again

    Thanks,

    Daniel

  • Hello Daniel,

    I see. What I would suggest is to log/print the status return of the function used to provision the node to hopefully find the reason why it fails. In addition, I would add a counter to see after how many attempts it causes the error. I would think the error is due to lack of resource at the time of a new node being provisioned and therefore this is alleviated by doubling the interval of sending a msg.

    BR,

    David.