Question about Bluetooth usage in Intel NUC

Hi,

I’m struggling to understand what is the way to manage bluetooth devices with my Docker image:

  • I found (see here Bluetooth Firmware failed - Intel NUC7i5 - Intel Wireless-AC 8265 + BT 4.2 ) that we had missing firmware into the Resin OS - workaround works
  • when I want to access bluetooth device into the docker image, I must at least install “bluez” package
    – This package also install the bluetoothd service and auto start it, but as it is already running onto the host , we have errors like this :

Sep 14 10:49:05 236c040 systemd[1]: Starting Bluetooth service…
Sep 14 10:49:05 236c040 bluetoothd[172]: Bluetooth daemon 5.43
Sep 14 10:49:05 236c040 systemd[1]: Started Bluetooth service.
Sep 14 10:49:05 236c040 bluetoothd[172]: Starting SDP server
Sep 14 10:49:05 236c040 bluetoothd[172]: binding L2CAP socket: Address already in use
Sep 14 10:49:05 236c040 bluetoothd[172]: Server initialization failed
Sep 14 10:49:05 236c040 bluetoothd[172]: Bluetooth management interface 1.13 initialized
Sep 14 10:49:05 236c040 bluetoothd[172]: Failed to start listening: l2cap_bind: Address already in use (98)
Sep 14 10:49:05 236c040 bluetoothd[172]: Failed to create GATT database for adapter
Sep 14 10:49:05 236c040 bluetoothd[172]: Unable to register new adapter

Of course, as it runs already on the host. So I guess, guideline would be to avoid starting that service into the docker. But, then …

How do we configure devices like bluetooth keyboard / mouse inside the docker image, if we cannot communicate with the bluetoothd on the host? tool like bluetoothctl refuse to connect.

For information,
hci0 device works inside the docker image:
hci0: Type: Primary Bus: USB
BD Address: F8:63:3F:4B:C2:F5 ACL MTU: 1021:4 SCO MTU: 96:6
UP RUNNING
RX bytes:1337 acl:0 sco:0 events:79 errors:0
TX bytes:1130 acl:0 sco:0 commands:79 errors:0

Tool like “hcitool lescan” works too.

It should be possible to communicate with the bluetoothd on the host with the D-Bus API.

Is this test app working for you? https://github.com/resin-io-playground/test-bluetooth