I have been using a small c program I wrote to get bluetooth ble advertising packets from low cost bluetooth temperature sensors. A number of these sensors broadcast their temperature and humidity readings in either type 0 or type 4 bluetooth advertising packets. This gives me the ability to get this data from low cost sensors and not have to use the vendors app or cloud services.

This has been working great for months using a raspberry pi to collect this data and publish to MQTT. Recently the program started to fail. I tracked down the issue to the bluetooth stack crashing after some number and combination of it logging errors like these:

Bluetooth: hci0: unknown advertising packet type: 0xdf
Bluetooth: hci0: unknown advertising packet type: 0xd8
Bluetooth: hci0: Dropping invalid advertising data
Bluetooth: hci0: advertising data len corrected

I see these errors when I run my program on: ARM Raspbian GNU/Linux 10 (buster) Intel Ubuntu 18.04.5 LTS

The bluetooth stack failure and reload seems to occur most often on a Raspberry Pi with a USB Bluetooth adapter. A lower occurrence on Raspberry Pi using internal UART Bluetooth adapter, or any adapter on a beefier i5 x86 Ubuntu machine. However all log some combo of the above messages.

Here is where this starts to get a bit weird. I'm pretty sure the actions that are causing these messages and crashes are my using my iPhone to control my HomePods.....

This is moved quickly out of my pay grade. I have seen some reports of some similar messages well prior to HomePods at seem to indicate that the rate of advertising packets is exceeding some internal of Linux bluetooth stack. But, as I said, my system had been running for months with no issues. Until, I think, I introduced the HomePods into my home, and even then I think it might have been a new version of HomePod firmware that started the issues.

Any ideas or direction to explore would be appreciated.

Thanks!

0

There are 0 best solutions below