Have anyone successfully added bluetooth or usb media remote controller?(hid device)

Hi!

Have anyone used hid remotes successfully on rpi with volumio? I’m mainly interested in using bluetooth low energy remote myself, but usb would be option aswell for me.

I just got my rpi4 yesterday and tried to connect it to my ble hid media controller, but it seems while I can connect just fine, the rpi with volumio does not subscribe for indications or notifications automatically so i believe that the OS does not support hid over gatt atleast out the of box.

Is this because of too old bluetooth stack/packages volumio uses? Since from what I found other distros does support hid over gatt out of box.

Will a broke the volumio install if i try manually upgrade those bluetooth related packages to newer ones?

1 Like

made some progress atleast, now i got all the pieces working, just cant figure how to glue it together.

installed newer bluetooth stack bluez 5.50

volumio@passatmediacenter:~$ dmesg | grep -i -E "bluetooth|input"
[   14.914448] Bluetooth: Core ver 2.22
[   14.914544] Bluetooth: HCI device and connection manager initialized
[   14.914575] Bluetooth: HCI socket layer initialized
[   14.914593] Bluetooth: L2CAP socket layer initialized
[   14.914636] Bluetooth: SCO socket layer initialized
[   15.094668] Bluetooth: HCI UART driver ver 2.3
[   15.094684] Bluetooth: HCI UART protocol H4 registered
[   15.094769] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   15.094990] Bluetooth: HCI UART protocol Broadcom registered
[   15.672346] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   15.672353] Bluetooth: BNEP filters: protocol multicast
[   15.672365] Bluetooth: BNEP socket layer initialized
[   18.482647] input: Passat SWC kit as /devices/virtual/misc/uhid/0005:5B3A:6B2A.0001/input/input0
[   18.489269] hid-generic 0005:5B3A:6B2A.0001: input,hidraw0: BLUETOOTH HID v90.8c Device [Passat SWC kit] on B8:27:EB:55:7E:86

So my device is registered as hid device by the system, auto connect and registering gatt charasterics is working fine.

btmon receives raw data.

Bluetooth monitor ver 5.50
= Note: Linux version 4.19.118-v7l+ (armv7l)                                                                                                                                                                                        0.712574
= Note: Bluetooth subsystem version 2.22                                                                                                                                                                                            0.712578
= New Index: B8:27:EB:55:7E:86 (Primary,UART,hci0)                                                                                                                                                                           [hci0] 0.712580
= Open Index: B8:27:EB:55:7E:86                                                                                                                                                                                              [hci0] 0.712582
= Index Info: B8:27:EB:55:7E:86 (Broadcom Corporation)                                                                                                                                                                       [hci0] 0.712583
@ MGMT Open: bluetoothd (privileged) version 1.14                                                                                                                                                                          {0x0001} 0.712585
@ MGMT Open: btmon (privileged) version 1.14                                                                                                                                                                               {0x0002} 0.712608
> ACL Data RX: Handle 64 flags 0x02 dlen 10                                                                                                                                                                            #21 [hci0] 103.280748
      ATT: Handle Value Notification (0x1b) len 5
        Handle: 0x0010
          Data: 020800

and evdev does create input device in /dev/input

volumio@passatmediacenter:~$ ls /dev/input event0 mice

the proplem is i cannot receive any data from within the event0 with cat command or python script, anyone have idea?

i think it boild down to a fact that the kernel does not assign any drivers to parse the hid

  looking at device '/devices/virtual/misc/uhid/0005:5B3A:6B2A.0001/input/input0/event0':
    KERNEL=="event0"
    SUBSYSTEM=="input"
    DRIVER==""   <-- nothing

  looking at parent device '/devices/virtual/misc/uhid/0005:5B3A:6B2A.0001/input/input0':
    KERNELS=="input0"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{uniq}=="88:6B:0F:A2:ED:F3"
    ATTRS{properties}=="0"
    ATTRS{phys}=="B8:27:EB:55:7E:86"
    ATTRS{name}=="Passat SWC kit"

  looking at parent device '/devices/virtual/misc/uhid/0005:5B3A:6B2A.0001':
    KERNELS=="0005:5B3A:6B2A.0001"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"

  looking at parent device '/devices/virtual/misc/uhid':
    KERNELS=="uhid"
    SUBSYSTEMS=="misc"
    DRIVERS==""  <-- nothing

So i have a Bluetooth media remote working with Volumio 3 on a Pi 4…

i followed this walkthrough: 컴맹의 Rasbarry pi 3 PIFI Volumio blutooth remote control : 네이버 블로그

i did NOT $sudo apt-get update.
most of the stuff was already installed as well. once i got the media remote paired, trusted and connected and triggerhappy installed my bluetooth device was at event1, not event 0 so i need to dump sudo thd --dump /dev/input/event1 instead of sudo thd --dump /dev/input/event0

when trying to change triggerhappy to listen to event1 (from: GitHub - wertarbyte/triggerhappy: A lightweight hotkey daemon) i was getting the error: send_command: Transport endpoint is not connected.

i followed the bug report “I had to delete
“/lib/systemd/system/triggerhappy.socket” and reboot for my system for
bluetooth device to be detected by triggerhappy.”

now all is working well.

hope this helps anyone looking for Bluetooth media controls!

There is also this topic, which does the job very well.
Without installing all kind of packages:

1 Like

So just an update here. I just set my Car Volumio up with bluetooth controls and there was no need to install any packages. everything was already installed. Im running the Touch diplay and Now playing plugins.

Steps to get this working took about 2 minutes:

hciconfig -a
bluetoothctl
[bluetooth]# power on
[bluetooth]# pairable on
[bluetooth]# scan on
(start pairing on the Bluetooth controller, then look for your device)
[bluetooth]# pair xx:xx:xx:xx:xx:xx
[bluetooth]# trust xx:xx:xx:xx:xx:xx
[bluetooth]# connect xx:xx:xx:xx:xx:xx
sudo nano /etc/triggerhappy/triggers.d/audio.conf
(i commented out default config and added below)
KEY_PLAYPAUSE 0 /usr/local/bin/volumio toggle
KEY_NEXTSONG 0 /usr/local/bin/volumio next
KEY_PREVIOUSSONG 0 /usr/local/bin/volumio previous
sudo /etc/init.d/triggerhappy reload
rm /lib/systemd/system/triggerhappy.socket
sudo reboot

then you have working Bluetooth controls. I am using this controller:

Bluetooth low energy is completely different than normal Bluetooth.

I have never had any proplems with USB or normal Bluetooth devices, only with Bluetooth low energy devices in general.

I got around this by writing my own client software which fits my need while driving, so I could use my BLE remote hardware and retain original steering wheel controls.

Do you need to have a touch display to make this work?
tcs