Hello
I've been experimenting in increasing the number of targets that a mesh FOTA distribution server can support on nRF52840
The CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX has a maximum 65535
Hello
I've been experimenting in increasing the number of targets that a mesh FOTA distribution server can support on nRF52840
The CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX has a maximum 65535
Hi Andy,
What you are trying is to try sending a large number of receive info in one shot. This will exceed the maximum size of a mesh packet (segmented packets) hence the build error you saw. With mesh, the strategy is to avoid sending a large packet. It will be redistributed to the whole network and waste a lot or resources of the network (and cause congestion).
The better way of doing it is to send smaller number of receive list one by one using Firmware Distribution Receivers Add messages, instead of sending them at once.
This is my understanding after taking a look at the doc:
https://docs.zephyrproject.org/latest/connectivity/bluetooth/api/mesh/dfu.html#populating-the-distributor-s-receivers-list
The reason for the build errors is the assert. The assert occurs if CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX is increased. My goal is to be able to have 50 or more targets. If I increase the number of targets I get the assert. If I increase the CONFIG_BT_MESH_TX_SEG_MAX build succeeds but any CONFIG_BT_MESH_TX_SEG_MAX value greater than 10 results in "SDU canceled" message during transfer and transfer fails.
So in reality the max number of targets I can have with CONFIG_BT_MESH_TX_SEG_MAX=10 is 22
Is there a way to overcome this limit?
In your internal testing, what was the largest number of targets you were able to send a DFU image to?
What's the difference between sending receivers-add once with 60 targets and sending it 3 times with 20 targets? All targets are added to the same list which is CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX long. Could you clarify?
Also if you recall I ran into another problem . CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX > 22 will require a CONFIG_BT_MESH_TX_SEG_MAX to be set to a value higher than 10 which results in "DFU canceled" error during distribution
I mentioned this earlier:
With mesh, the strategy is to avoid sending a large packet. It will be redistributed to the whole network and waste a lot or resources of the network (and cause congestion).
The better way of doing it is to send smaller number of receive list one by one using Firmware Distribution Receivers Add messages, instead of sending them at once.
Have you tried to test setting CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX >22 but only send a few target once at a time (6 targets and four times for example)?
Please clarify what you mean by "send a few target once at a time" What commands should I use??
Do you mean I can do
mesh models dfd receivers-add <1,2,3>
mesh models dfd start ...
mesh models dfd receivers-add <4,5.6>
mesh models dfd start ...
??
If that's the case - how long should I wait before sending the next batch?
Please try:
mesh models dfd receivers-add <1,2,3>
mesh models dfd receivers-add <4,5,6>
mesh models dfd receivers-add <7,8,9>
mesh models dfd start ...
Set CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX = 70
Set CONFIG_BT_MESH_TX_SEG_MAX = 32
Used method you suggested to add targets in batches of 3
Get the "SDU canceled" error and transfer fails
The error occurs regardless of the number of targets - even with just one.
What triggers it it seems is CONFIG_BT_MESH_TX_SEG_MAX > 10
So at the moment I'm stuck with 22 targets - maximum possible with CONFIG_BT_MESH_TX_SEG_MAX =10 without getting build asserts.
Please advise
Set CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX = 70
Set CONFIG_BT_MESH_TX_SEG_MAX = 32
Used method you suggested to add targets in batches of 3
Get the "SDU canceled" error and transfer fails
The error occurs regardless of the number of targets - even with just one.
What triggers it it seems is CONFIG_BT_MESH_TX_SEG_MAX > 10
So at the moment I'm stuck with 22 targets - maximum possible with CONFIG_BT_MESH_TX_SEG_MAX =10 without getting build asserts.
Please advise
Hi Andy,
I'm finally back to the office and can actually do some tests.
I was doing a quick test with NCS v2.9.0 and the default distributor sample. Here is my list of commands:
By default CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX = 8 and CONFIG_BT_MESH_TX_SEG_MAX =10.
So it seems to works with small number of receiver and multiple dfd receivers-add packet.
However, when increasing CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX to 32 I hit what you reported earlier :
Yes, I'm using the same commands.
What you're describing is only 1 problem.
There are actually 3
1. When CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX is increased the CONFIG_BT_MESH_TX_SEG_MAX must be increased as well otherwise there is a build assert. Might be good to document it somewhere, (The one you describe)
2. Asserts check against BT_MESH_TX_SDU_MAX or BT_MESH_RX_SDU_MAX ( that the values they check are smaller)
However those defines use 2 hard coded values :BT_MESH_APP_SEG_SDU_MAX and BT_MESH_APP_UNSEG_SDU_MAX (12 and 15 respectively) - see in zephyr\include\zephyr\bluetooth\mesh\access.h
So even if CONFIG_BT_MESH_TX_SEG_MAX is increased to 32 the CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX cannot go higher than 70 or so.
3. Increasing CONFIG_BT_MESH_TX_SEG_MAX to 32 causes DFD to fail almost immediately with "SDU canceled" error even if the number of targets is 1.
Hi Andy,
My opinion is that the build assert i pointed in my last replay need to be removed or change to something else.
I assume issue #2 and #3 you mentioned are also related to that build assert, correct ?
I don't think CONFIG_BT_MESH_TX_SEG_MAX should be increased to a large number .The number of segment in a message should be kept low they use a lot of resource and can reduce the throughput of the network a lot.