Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Bluetooth USB dongle sporadic stop #1

Open
jpunie opened this issue Dec 12, 2022 · 1 comment
Open

Bluetooth USB dongle sporadic stop #1

jpunie opened this issue Dec 12, 2022 · 1 comment

Comments

@jpunie
Copy link

jpunie commented Dec 12, 2022

Hello,

We are using BlueHeron in combination with nerves. We use an RPI CM3 with USB Bluetooth dongle. We are experiencing some sporadic behaviour when bluetooth will stop working with following log statements:

2022-12-09 10:02:11.234 [warn] [module=Nerves.Runtime.Log.KmsgTailer pid=<0.1990.0> ] usb 1-1.4: Process 171 (hci_transport) called USBDEVFS_CLEAR_HALT for active endpoint 0x81
2022-12-09 10:02:11.234 [warn] [module=Nerves.Runtime.Log.KmsgTailer pid=<0.1990.0> ] usb 1-1.4: Process 171 (hci_transport) called USBDEVFS_CLEAR_HALT for active endpoint 0x81
2022-12-09 10:02:11.239 [warn] [module=BlueHeronTransportUSB function=handle_info/2 pid=<0.2297.0> ] BlueHeron(USB): Transfer stalled, trying again
...
a lot more of the same messages
...
2022-12-09 10:02:11.276 [warn] [module=BlueHeronTransportUSB function=handle_info/2 pid=<0.2297.0> ] BlueHeron(USB): Transfer stalled, trying again
2022-12-09 10:02:11.276 [warn] [module=Nerves.Runtime.Log.KmsgTailer pid=<0.1990.0> ] usb 1-1.4: Process 171 (hci_transport) called USBDEVFS_CLEAR_HALT for active endpoint 0x81
2022-12-09 10:02:11.573 [warn] [module=BlueHeronTransportUSB function=handle_info/2 pid=<0.2497.0> ] BlueHeron(USB): No acceptable Bluetooth modules found
2022-12-09 10:02:11.573 [error] [module=BlueHeronTransportUSB function=handle_info/2 pid=<0.2497.0> ] BlueHeron(USB): btusb_open failed

It seems that the only way to solve this at the moment is by temporary disconnecting the power on the RPI CM3.
Maybe someone has suggestions what could be the issue and how to prevent his from happening or restart some underlying linux systems?

Note: We are using a modified version of this USB transport, which allows replugging of the USB dongle. The default implementation will crash and not setup the transport after replugging the dongle. We applied these changes because of prior issues which caused the software not being able to start after boot.

Let me know when more information is needed about our nerves setup.
Thanks for the contributors for enabling Bluetooth in an easy way on elixir/nerves.

Kind regards,

Jochen

@trarbr
Copy link

trarbr commented Dec 15, 2022

Hi Jochen.

Unfortunately I cannot help with fixing the issue, but I can suggest an alternative to rebooting the device: resetting the USB bus. I know we've had to do that on an old system several years ago (not related to Bluetooth), and resetting the USB subsystem allowed us to work around the issue. This article has some pointers on resetting a USB bus: https://www.linux.org/threads/resetting-the-usb-subsystem.10404/ and here are a few helper scripts: https://gist.github.com/planetceres/917840478e1e4d45f8373667630e51a0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants