TLDR:
I managed to compile the bluetooth kernel modules (bluetooth.ko
and btusb.ko
) for Synology DSM 7.1 kernel 4.4.180+, geminilake (x86_64). Models like DS220+, 720, 920.
You can download them from here: geminilake DSM 7.1 - Google Drive
To install them and run them automatically on boot:
- copy bluetooth.ko and btusb.ko to nas /lib/modules/
sudo cp bluetooth.ko btusb.ko /lib/modules/
- create a startup file on nas to load them on boot
echo -e "#!/bin/sh\ncase \$1 in\n start)\n insmod /lib/modules/bluetooth.ko > /dev/null 2>&1\n insmod /lib/modules/btusb.ko > /dev/null 2>&1\n ;;\n stop)\n exit 0\n ;;\n *)\n exit 1\n ;;\nesac" | sudo tee /usr/local/etc/rc.d/bluetooth-modules.sh
sudo chmod 755 /usr/local/etc/rc.d/bluetooth-modules.sh
- execute manually this time
sudo /usr/local/etc/rc.d/bluetooth-modules.sh start
To test if the module is loaded:
lsmod | grep bt
I am using a Sena UD100 usb bluetooth adapter with my docker installation of Home Assistant and that is working fine. The container is running in privileged mode.
You can verify that in the docker container:
docker exec -it homeassistant /bin/sh
then in the container
I will try to find some spare time to document this so others can build for different architectures or for DSM 7.2 that is currently in beta.
The main purpose of this is to allow you to run HA in docker on Synology NAS and having access to a usb bluetooth dongle.
Note:
I have noticed that after reboot, the nas is not bringing the bluetooth interface up.
Also the ble_monitor
component can’t do it, maybe related to setcap
.
[custom_components.ble_monitor] HCIdump thread: Something wrong - interface hci0 not ready
So you might need to do this from HA docker: hciconfig hci0 up
You can do this automatically from HA by creating a shell command and running that command as an automation on HA startup.