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

jeenyeong@Jeen-NAS:~$ uname -a
Linux Jeen-NAS 4.4.302+ #64570 SMP Tue Jun 13 21:39:53 CST 2023 x86_64 GNU/Linux synology_v1000_1821+

Linux NAS2 3.10.108 #64570 SMP Fri Jul 14 01:07:53 CST 2023 x86_64 GNU/Linux synology_avoton_1517+
upgrade to 7.2

I need the kernel version from dsm 7.2, I assume this one is from 7.1

itā€™s 7.2 kernel. iā€™m upgrade my 1517+ to 7.2 update 3

hmmā€¦ so it is the old kernel used in 7.1

I was able to compile the modules by following the guide that Iā€™ve posted.

Here are the compiled modules for avoton DSM 7.2 kernel 3.10.108
https://drive.google.com/drive/folders/1H0wdFXY-nkStIMTtzYT8iJ1n5Y0jGniR?usp=sharing

1 Like

thanks a lot! iā€™m use https://cdn.kernel.org/pub/linux/kernel/v3.x/linux-3.10.108.tar.gz kernel and bluetooth.ko not compiled. everything works now.

So (I think) I managed to get BlueZ installed via Entware, following the guide here: DSM 7: Enable Compiling Of Native Modules Ā· homebridge/homebridge-syno-spk Wiki Ā· GitHub

However, Iā€™m still getting the same error "ā€œFailed to start Bluetooth: [org.freedesktop.DBus.Error.ServiceUnknown] The name org.bluez was not provided by any .service filesā€

Unfortunately I am super noob with linux and cli. Are you guys installing BlueZ another way? Do I even need to install it?

Or does my issue have anything to do with the way Iā€™m installing my Home Assistant? Iā€™m using the following code:

docker run -d --name=hassio_supervisor \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/run/dbus:/run/dbus:ro \
-v /volume1/docker/homeassistant:/data \
-e SUPERVISOR_SHARE=/volume1/docker/homeassistant \
-e SUPERVISOR_NAME=hassio_supervisor \
-e HOMEASSISTANT_REPOSITORY=homeassistant/qemux86-64-homeassistant \
--security-opt seccomp=unconfined \
--privileged \
--restart always \
ghcr.io/home-assistant/amd64-hassio-supervisor:2023.09.2
mount --make-shared /volume1/

I am using Container Manager (dsm 7.2) for managing docker containers including HA. This is the image:

And the bluetooth tools are available inside the container:
image

bluetoothctl cannot be used, I donā€™t think the HA container has the D-Bus available for the bluez service.

Hi kcsoft, thanks for the reply.

Yeah the hciconfig and hcitools commands seem to work fine for me:

homeassistant:/config# hciconfig
hci1:   Type: Primary  Bus: USB
        BD Address: 00:19:86:00:0B:79  ACL MTU: 1017:8  SCO MTU: 64:0
        UP RUNNING
        RX bytes:1408 acl:0 sco:0 events:52 errors:0
        TX bytes:413 acl:0 sco:0 commands:40 errors:0

hci0:   Type: Primary  Bus: USB
        BD Address: 00:1A:7D:02:16:A3  ACL MTU: 1021:6  SCO MTU: 255:12
        UP RUNNING
        RX bytes:454729 acl:0 sco:0 events:22288 errors:0
        TX bytes:156533 acl:0 sco:0 commands:22288 errors:0

homeassistant:/config# hcitool scan
Scanning ...
        00:04:4B:5B:C1:A2       nVidia SHIELD

But when I go into my home assistant integrations, bluetooth keeps showing an error.


I wonder if my issue has to do with me using ā€œHome Assistant Supervisorā€, you seem to be using the standard version

I have the same error in the BT config in the UI.
I am using ā€œPassive BLE Monitor integrationā€ with a few ble devices.

Iā€™ve got Passive BLE Monitor also, but I donā€™t really know how to use it. It doesnā€™t seem to pick up anything.
Basically all I want to do is connect my Home Assistant to a single Switchbot Bot

Iā€™ve tried manually adding the MAC address of the SwitchBot device in my config yaml fileā€¦ like this:

ble_monitor:
  bt_interface:
    - '00:19:86:00:0B:79'
    - '00:1A:7D:02:16:A3'
  devices:
    - mac: 'D0:98:64:99:05:6B'

But it doesnā€™t seem to pick up anythingā€¦ (againā€¦ Iā€™m not really sure if Iā€™m using it correctly)

So I ended up just backing up my home assistant settings, removing the docker version and installing HA via VM, then restoring the backup. Bluetooth worked straight away and immediately found my SwitchBot device.
Super easy to setup. I donā€™t know why I didnā€™t just do this to begin with. I guess I was worried it was going to be a big task transitioning from Docker to VM, but it was super simple. Surprisingly, I didnā€™t run into a single issue!
Problem solved for me :slight_smile:

Thank you very much for the guideline, maybe my platform is too small potato. it is RTD1296 of DS218
For the container manager, I can run now and install the Ubuntu 2204, but when in the step of EnvDeploy, there is error showing that the chroot for Exec format error, and if I use my x86 to do the compile, the arch will be x86 and canā€™t find the aarch64 gcc in which I already installed
may I know if you are going to share cross platformā€™s experience so that we can try on it? as Bluetooth is quite important but DSM 7.0 already delete the support about it.

Thanks ,when i run:ā€œhciconfig hci0 upā€ in homeassistant container, an erro :ā€œCanā€™t init device hci0: Operation not permitted (1)ā€,how to dail with it?

If you use a synology with VM to run home assistant you donā€™t need all that ā€œhokus-pokusā€ described above this contribution.
Although DSM 7.X is no longer available for USB devices, the pass-through still works. That means you really can have a bluetooth dongle working in home assistant within a minute.

Here are the steps:

  • Plug your dongle into the synology.
  • Go to your VM machine and choose in the column on the left side: ā€˜Virtual machineā€™
  • In the upper bar choose: ā€˜Actionā€™
  • Within action choose : ā€˜Editā€™
  • In the popup screen choose the tab: ā€˜Otherā€™.
  • Then scroll all the way down and find ā€˜USB-deviceā€™.
  • Click on the ā€˜+ā€™ sign next to it and select the dongle you just inserted.
  • Press OK

Probably before you return to Home Assistant it will say here that a new device has been detected. Configure it and probably new devices will be detected right away.

2 Likes

Thank you! Was wasting the entire day trying to get past those errors! Once I installed Virtual Machine Manager, and configured Home Assistant as VM w/ passthrough USB device as you described above, everything works as expected. Thank you! Saved me a ton of time!

Needs --Privileged / added to the docker start scriptā€¦ then youā€™ll be able to run those hciconfig commands, but youā€™ll still get additional errors. Only way that seems to work is through VMM.

1 Like

Compiled for cedarview (1513+) DSM7.1

https://drive.google.com/drive/folders/1hoLc5yefBk4Q9ts_bwKq7s4g6G6YYsCm?usp=sharing

Hello!

I tried to compile the bluetooth driver for Linux 4.4.302+ aarch64 GNU/Linux synology_rtd1296_ds218play but failed miserably? Maybe someone else has this driver and might want to share them would be greatly appreciated :wink:

https://drive.google.com/drive/folders/14KPDiymwuX2lXHuoVqkG7jNmVveEN_m9?usp=sharing
take a try, I was stopped at the python, python didnā€™t included with bluetooth.
it is 4.4.302+ aarch64 GNU/Linux synology_rtd1296

1 Like