NordicPlayground / nRF51-ble-bcast-mesh

Other
323 stars 121 forks source link

Notification interference #104

Closed vliedel closed 7 years ago

vliedel commented 8 years ago

Hi, I'm sending out 11 notifications per second and saw that when I enable meshing, I'm missing a notification pretty regularly (every 6th or 7th notification or so). Is this simply due to the increased radio activity or could it be a bug?

sample-num-diff-mesh-100hz In this graph, each peak at 10 means one notification is missed, peak of 19 means 2 notifications are missed. Horizontal axis: each 9 is one received notification. Without meshing enabled, this graph was a flat line, no notifications missed.

Btw, when I send 22 notifications per second, without meshing, I get this: sample-num-diff-no-mesh-200hz

trond-snekvik commented 8 years ago

Just to make sure: you're talking about GATT notifications, not radio-notifications, right?

What is your connection interval for this? Typically, you wouldn't be able to send more than one notification per connection event, and the mesh will be sending quite a few. You can monitor the mesh GATT activity over here, but I don't have any quick fixes except shrinking your connection interval. You could disable acks for the commands, but that would only help you if you are pushing commands from the master. You could also choose to stop the mesh notifications all togheter, and poll instead, but you'll reduce functionality dramatically.

daviddedwin commented 8 years ago

I do not understand how we miss a Handle Value Notification on the softdevice, since the BTLE connected link layer is a reliable link. Please clarify. I am assuming "radio-notifications".

vliedel commented 8 years ago

I meant GATT notifications, but I just found out I might be doing something wrong, so I'll first test a bit more. Thanks for the feedback.

vliedel commented 8 years ago

So, I now check if a notification is sent, before sending the next. Then, instead of missing notifications, my send buffer overflows quickly with mesh enabled, without meshing this doesn't happen.

trond-snekvik commented 8 years ago

You can try reducing the mesh GATT traffic, as I described above, or increase the size of your send buffer. Reducing the connection interval should improve your notification throughput, but stay above 15ms to give the mesh some room to breathe! These are the only options you have at this point, as the limit you're hitting now is a hard one - there simply isn't enough bandwidth in GATT to support your traffic rates.

vliedel commented 8 years ago

Ok thanks, it's always good to know the limits :)

daviddedwin commented 8 years ago

Are you waiting for the BLE_EVT_TX_COMPLETE for the Notification before sending the next one ?

vliedel commented 8 years ago

Yep