Description
I am trying to develop a Bluetooth low energy sensor application, and it turns out that the Bluetooth system(BCM43435/UART/Bluetooth stack) is losing data on the raspberrypi board rather than in the 'air'.
If I look in /var/log/kern.log I see regular entries such as:
Jun 29 16:31:20 rpi kernel: [102519.580522] Bluetooth: hci0: Frame reassembly failed (-84)
Jun 29 16:31:20 rpi kernel: [102519.580561] Bluetooth: hci0: Frame reassembly failed (-84)
Jun 29 16:31:20 rpi kernel: [102519.580666] Bluetooth: hci0: Frame reassembly failed (-84)
Jun 29 16:31:20 rpi kernel: [102519.580716] Bluetooth: hci0: Frame reassembly failed (-84)
It appears that the errors are commonly in groups of 3-4, but some occur as a single, or pairs or a set of 5. I have four sensors that are streaming at ~1.2kbytes/second, and the errors occur intermittently from 30 seconds apart to forty minutes apart. I'm more than happy to help diagnosing the problem, but I don't know whether this is indicative of the Wifi/BT chip firmware having an issue, or if it is the main Quad-core having an issue.
I have also tested this with a single sensor running at its maximum transfer rate and this also exhibited the same data loss, so it is not the multiple sensors, although it may be the data-rate. I hope/suspect it should be if the Wifi/BT chip has a single interface then the Wi-fi portion should stress the interface far more in terms of data transfer, but maybe not in terms of the number of transactions (many small packets vs. a few large ones).
In some of my testing I was using a known data pattern, and seeing the discontinuities and these errors turning up in the logs at the same time, so I am happy that the issue is on the raspberrypi 3 somewhere.
As background, I have set my bluetooth sensors to have a connection interval of 7.5ms, and they can transmit 6 packets per interval. For me the data needs to be contiguous, and so I already have in place controls for ensuring the data is not deleted on the sensor until it is successfully transmitted to the host, so if the radio connection is broken I know which packets of data need to be resent. I have been testing overnight with the latest raspberrypi firmware, including kernel 4.4.14-v7+. This I have updated using the rpi-update program. I am running the ubuntu mate desktop at the moment too.
If you need any more information, please ask, if you can point me were to look, or configuration options I can change to help with this, then please do and I will try them out.
Peter Myerscough-Jackopson
Ps. I have seen the ticket #1360 that seems to show this behaviour has been experienced elsewhere, but that ticket seemed to uncover a null pointer issue that was being triggered by this data loss, and did not address the data loss issue.