[Solved] USB Bluetooth support on Synology DSM 7.1 and DSM 7.2

Do you have any recommendation for an adapter working with the VM directly? What adapter are you using?
Thank you @DN38416 @Snuf1

Can someone compile Bluetooth modules for Armada375 architecture?
I followed guide down below, but couldn’t finish because of compilation errors in step 4 (make command). I tried changing EnvDeploy version to 7.0 but I get same result.

Other info if needed:

Thanks in advance!

since reloading Synology OS 7.2 from fresh I have to manually run this command from SSH on the NAS not the container (well I do that too via the Home Assistant script (see above)).

hciconfig hci0 up

without it the Synology NAS says hciconfig is down

Any pointers to what is wrong?

I believe this is because I hack onto the synology OPKG and blues before I found out that synology does not do b-bus.

fixed by removing opgk and removing bluez

Can someone recommend the best Bluetooth dongle to purchase? I have the 1520+

I get all the code in the terminal to find the drivers. I just want to make sure I get a dongle that’s actually gonna work first just the best one you guys opinion or will all of them work?

Thanks

@image969:

I use SABRENT BT-UB40 (CSR chipset CSR8510A10) on DSM7.2 (DS920+ , geminilake) successfully.

There is an interesting link to various BT adapters here:

I would imagine the previous list of DSM6.x compatible USB adapters would also work : ?
https://www.synology.com/en-uk/compatibility?search_by=category&category=usb_bluetooth_dongles

The only aspect you mind want to consider is whether the range provided by those btdongle will suffice given their small antenna design nature or if you want an external antenna.

Saying that, I come to revisit this thread aftrer around 1 year after noticing that the bluetooth.ko and btusb.ko had somehow disappeared from /lib/modules/ and Homeassistant docker container was error’ing with “hciconfig hci0 up” error.

I coppied once more those files with 644 permissions and tried to execute the “start-bluetooth” (aka insmod script) - No errors but at the same time the modules are no loaded ? and hciconfig still fails

The DS920 GUI still shows the dongle detected but for a reason or another things behave differently to how they did about 1 years ago.

Currently running DSM 7.2.1-69057 Update 3


UPDATE:
The dmesg output might be telling me that those bluetooth modules might need to be recompiled for the the Linux 4.4.302 ?

I am using a DS920+ (gemini lake) , anyone with this already compiled for the 4.4.302 ?


root@DiskStation:/dev# ls -la | grep hci
root@DiskStation:/dev# sudo /usr/local/etc/rc.d/start-bluetooth-modules.sh start
root@DiskStation:/dev# dmesg | grep bluetooth
[75141.942304] bluetooth: version magic '4.4.180+ SMP mod_unload ' should be '4.4.302+ SMP mod_unload '
root@DiskStation:/dev# dmesg | grep bt
[75141.964161] btusb: version magic '4.4.180+ SMP mod_unload ' should be '4.4.302+ SMP mod_unload '
root@DiskStation:/dev# ls -la /lib/modules | grep bluetooth
-rw-r--r--  1 root root 6952800 Apr  4 22:05 bluetooth.ko
root@DiskStation:/dev# ls -la /lib/modules | grep btusb
-rw-r--r--  1 root root  588904 Apr  4 22:05 btusb.ko
root@DiskStation:/dev# lsmod | grep bt
btrfs                1283822  4 nfsd
raid6_pq               97268  4 async_pq,raid456,btrfs,async_raid6_recov
xor                    10808  2 btrfs,async_xor
zstd_compress         154833  1 btrfs
zstd_decompress        60974  1 btrfs
ecryptfs               85159  1 btrfs
root@DiskStation:/dev#

UPDATE: I realised that those geminilake / 4.4.302 had already provided by @kcsoft back on the 1st Sept 2023 -

I guess that I must have updated my DSM release since March 2023 and never realised the issue.

After using the compiled modules, all is working well again.

root@DiskStation:/lib/modules# lsmod | grep bt
btusb                  27178  0
bluetooth             278277  2 btusb
btrfs                1283822  4 nfsd
raid6_pq               97268  4 async_pq,raid456,btrfs,async_raid6_recov
xor                    10808  2 btrfs,async_xor
zstd_compress         154833  1 btrfs
zstd_decompress        60974  1 btrfs
ecryptfs               85159  1 btrfs
usbcore               209065  22 uas,ch341,btusb,etxhci_hcd,r8152,usblp,uhci_hcd,usb_storage,cp210x,usbserial,ti_usb_3410_5052,ehci_hcd,ehci_pci,pl2303,usbhid,ftdi_sio,cdc_acm,xhci_hcd,xhci_pci
root@DiskStation:/lib/modules# lsmod | grep bluietooth
root@DiskStation:/lib/modules# lsmod | grep bluetooth
bluetooth             278277  2 btusb
root@DiskStation:/lib/modules# hciconfig hci0 up

THanks @kcsoft

Thank you for making this possible. I am new to setting this up on a Synology DSM 7.2. I followed all your steps from the guide, but got stuck on copying the bluetooth kernel modules to the Synology NAS /lib/modules. how can I find the 2 files and copy to the NAS. I tried the ‘sudo cp’ command in root of NAS and I get ‘No such file or directory’ Thanks for any reply about this.

If the compilation was successful, you should find them on the compiled module path:
eg: bluetooth.ko should be in /usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/src/linux-4.4.302/net/bluetooth/
and
btusb should be under /usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/src/linux-4.4.302/drivers/bluetooth/

The paths are inside the chroot: eg: /toolkit/build_env/ds.geminilake-7.2/

I mentioned the path in the guide too:

# copy the 2 files bluetooth.ko btusb.ko to to NAS /lib/modules/
# /toolkit/build_env/ds.geminilake-7.2/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/src/linux-4.4.302/net/bluetooth/bluetooth.ko
# /toolkit/build_env/ds.geminilake-7.2/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/src/linux-4.4.302/drivers/bluetooth//btusb.ko

Thank you for the reply and the extra detailed answer. I have another basic question. When I tried the setup of the startup file I get this error:

-ash: !/bin/sh\case: event not found

that command should be executed on the Synology console (ssh). You don’t need sudo since you if you already logged in as root.

That command just creates a file on this path /usr/local/etc/rc.d/bluetooth-modules.sh with this content:

#!/bin/sh
case $1 in
 start)
 insmod /lib/modules/bluetooth.ko > /dev/null 2>&1
 insmod /lib/modules/btusb.ko > /dev/null 2>&1
 ;;
 stop)
 exit 0
 ;;
 *)
 exit 1
 ;;
esac

You can create it with some other tools, maybe vi editor.

Finished all steps, manual start and this is the result. I don’t see any btusb and bluetooth. any idea what is wrong? possible the modules are not good? thank you for all the help.

Capture 2

Possibly you are not using the same kernel version of the modules as your synology.

uname -a
will tell you what is your version on the Synology.

Hey, thanks so much for the work, I followed your steps and now bluetooth is recognized, although just in passive mode, as you mention.

It would be awesome to be able to have full bluetooth support using docker. I understand that bluez should be installed on the NAS somehow, although I see the attempts of Dan (DN38416) were not successful.

Anyone has a solution?

I could switch to the VM solution, but I would like to avoid the overhead of it.

Thanks!

I did manage to setup full bluetooth support, BUT on my side I can’t find a usage for it so I’m not using it.

I have added a small guide to the github repo (easier to track than a reply)

1 Like

it this sitll working as of today because my home assisant is setup great! but only the bluetooth auto disconnetsfrom my VM randomly…

ok so for some reaon uising this script the homeassisant vm bluetooth kinda keeps workind, iu mean kinda because in the vm setting it will still disconnects. shouldnt we get a workiing script applying the usb vm mount on dsm each timei nsteaD?