Added support of bluetooth remote G20BTS PRO to my Volumio on RPI4

have you tried to use a BT remote that comes with a dongle?

No. I have not tried that.
So frustrating as I have this working on one of my systems.
Any idea why I have to do a factory reset between attempts to discover the remote.
I can see it on first boot of a fresh build, try to connect, fails most of the time, then you never see it again in the scan unless you do a factory reset.
Thanks for your suggestion.

maybe something like this?

is that what you had in mind? or give up on BT and go for a “just boom” remote ? kinda pricey…

You need to look for a remote that have the buttons you need. For me all the BT remotes I have (with dongle) just works.
like:

or:

Hmmm. I found these on the canadian website. Looks the same as what you have suggested.
Is this BT? How would I pair it and would it work with triggerhappy?
If it does, I’ll order it. txs is one better than the other? I just want volume control really…

no need to pair, they do it automatically, hence the dongle.
unfortunately I have no experience using triggerhappy, as I coded the BT receive response myself.
But I see no reason why this would fail.

Ok, I’m going to switch technology, however I will keep trying the BT technology because that’s how one of my systems is running and I really like it.
So I like the Huafelix remote, so i will order that.
Also, I may need to depend on you to get it all working but in return I will do a write up of my “remote control” experience for the next person wanting this functionality.
BTW remote plus peppy meter is a dynamite configuration!
Thanks

I got the usb remote and I am giving it a try. It seems to work out of the box but does not have the smothness that the Bluetooth remote had.
Anyways, I have basic functionality, txs. Now how do I program some of the keys? for example a mute key?
Not sure how to do that.
When I was playing with the bluetooth I used this command and it was quite useful. Is there an equivalent for this usb mouse.

You can see which code represent every key by running the following command:
sudo thd --dump /dev/input/event0

Thanks. Really appreciate the help.

these are the basic Volumio shell commands:

volumio@volumio-n2:~$ volumio

Usage : volumio <argument1> <argument2>

[[PLAYBACK STATUS]]

status                             Gives Playback status information
volume                             Gives Current Volume Information
volume <desired volume>            Sets Volume at desired level 0-100
volume mute                        Mutes
volume unmute                      Unmutes
volume toggle                      Mutes/Unmutes
volume plus                        Increases Volume of one step
volume minus                       Decreases Volume of one step
seek plus                          Forwards 10 seconds in the song
seek minus                         Backwards 10 seconds in the song
seek <seconds>                     Plays song from selected time
repeat                             Toggles repetition of queue
random                             Toggles randomization of queue


[[PLAYBACK CONTROL]]

play
pause
toggle                             Toggles between play/pause
next
previous
stop
clear

Thanks I need an example for me to understand.
The remote does not have a mute button, so I would like to program another button on the remote that I do not use to act as a mute button. Maybe this is not possible…
How would I use the info you sent me above to accomplish this?

if you want button x to act as mute/unmute, you place the code below under the button event:
volumio volume toggle

I expect that works the same in happytrigger,

Thanks :pray:. I’ll play with it. In the mean time pause works. Thanks Wheaten! Btw, it’s trigger-happy :grinning:

Could you be so kind and explain me how to fix the peppymeter issue? G20BTS is finally working with Volumio but peppeymeter stopped to work.
Could someone help to fix it? Thank you

please read you PM

Deat @Wheaten , grettings from here - now i’m arrived (and my BT mouse as well).
Unfortunately something weird is happening with this device as well.
Without any configuration some buttons of the BT device are triggering actions in Volumio.
Especially the “off” button works immediatly and shuts down the pi.
Some buttons working “likely” some doesn’t.
Using your python script (the generic one (FEB 2024, last post)) some buttons are deteced some not.
E.g. buttons “volume +” and "volume - " are NOT detected by the python script BUT triggering (buggy) Volume increase and decrease in Volumio.

The buttons are detected like this:


device /dev/input/event0, name "2.4G Composite Devic Wireless Devic", phys "usb-0000:01:00.0-1.4/input2"
device /dev/input/event2, name "2.4G Composite Devic Wireless Devic Consumer Control", phys "usb-0000:01:00.0-1.4/input3"
=== Start ===
<RIGHT> Pressed
/dev/input/event0: key event at 1739630595.682951, 106 (KEY_RIGHT), down
---
Task exception was never retrieved
future: <Task finished coro=<print_events() done, defined at test.py:42> exception=UnboundLocalError("local variable 'url' referenced before assignment")>
Traceback (most recent call last):
  File "test.py", line 63, in print_events
    if len(url) > 0:
UnboundLocalError: local variable 'url' referenced before assignment
<LEFT> Pressed
/dev/input/event0: key event at 1739630637.608716, 105 (KEY_LEFT), down
---
<LEFT> Pressed
/dev/input/event0: key event at 1739630641.001214, 105 (KEY_LEFT), down
---
<LEFT> Pressed
/dev/input/event0: key event at 1739630644.241630, 105 (KEY_LEFT), down
---
/dev/input/event0: key event at 1739630648.282184, 108 (KEY_DOWN), down
---
/dev/input/event0: key event at 1739630650.114443, 103 (KEY_UP), down
---
/dev/input/event0: key event at 1739630671.621446, 104 (KEY_PAGEUP), down
---
/dev/input/event0: key event at 1739630676.350099, 104 (KEY_PAGEUP), down
---
/dev/input/event0: key event at 1739630677.966327, 109 (KEY_PAGEDOWN), down
---
/dev/input/event0: key event at 1739630681.710809, 109 (KEY_PAGEDOWN), down
---
[1]+  Stopped                 python3 test.py

Do you understand what happens here?

Any hint HIGHLY appreciated.

Regards,
Ralf

Please post this output here.

volumio@volumio:~$ cat /proc/bus/input/devices
I: Bus=0003 Vendor=a604 Product=0715 Version=0101
N: Name="2.4G Composite Devic Wireless Devic"
P: Phys=usb-0000:01:00.0-1.4/input2
S: Sysfs=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.2/0003:A604:0715.0001/input/input0
U: Uniq=
H: Handlers=sysrq kbd leds event0
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=1f

I: Bus=0003 Vendor=a604 Product=0715 Version=0101
N: Name="2.4G Composite Devic Wireless Devic Mouse"
P: Phys=usb-0000:01:00.0-1.4/input3
S: Sysfs=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.3/0003:A604:0715.0002/input/input1
U: Uniq=
H: Handlers=mouse0 event1
B: PROP=0
B: EV=17
B: KEY=1f0000 0 0 0 0 0 0 0 0
B: REL=1943
B: MSC=10

I: Bus=0003 Vendor=a604 Product=0715 Version=0101
N: Name="2.4G Composite Devic Wireless Devic Consumer Control"
P: Phys=usb-0000:01:00.0-1.4/input3
S: Sysfs=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.3/0003:A604:0715.0002/input/input2
U: Uniq=
H: Handlers=kbd event2
B: PROP=0
B: EV=1f
B: KEY=3f 33fff 0 0 0 0 483ffff 17aff32d bfd44446 0 0 1 130ff3 8b17d000 677bfa d9415fed 19ed680 4400 0 10000002
B: REL=1040
B: ABS=1 0
B: MSC=10

I: Bus=0003 Vendor=a604 Product=0715 Version=0101
N: Name="2.4G Composite Devic Wireless Devic System Control"
P: Phys=usb-0000:01:00.0-1.4/input3
S: Sysfs=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.3/0003:A604:0715.0002/input/input3
U: Uniq=
H: Handlers=kbd event3
B: PROP=0
B: EV=13
B: KEY=c000 100000 0 0 0
B: MSC=10

I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="raspberrypi-ts"
P: Phys=
S: Sysfs=/devices/platform/soc/soc:firmware/soc:firmware:touchscreen/input/input4
U: Uniq=
H: Handlers=mouse1 event4
B: PROP=2
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=2608000 3

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio_ir_recv"
P: Phys=gpio_ir_recv/input0
S: Sysfs=/devices/platform/ir-receiver@17/rc/rc0/input5
U: Uniq=
H: Handlers=kbd event5
B: PROP=20
B: EV=100017
B: KEY=fff 0 0 4200 108fc32e 2376051 0 0 0 7 158000 4192 4001 8e9680 0 0 10000000
B: REL=3
B: MSC=10


nothing spectacular.
Key-pressings are broadcasted via /dev/input/event0
/dev/input/event1 seems to be the mouse portion of this device (“AirMouse”), so gyroscopic thousands of events by touching and moving the device. (/dev/input/event2 as well as /dev/input/event3 are receiving nothing.

And my main “problem” persists: How can this device already trigger events in volumio despite I haven’t installed anything… ???

At least you need to modify the script to capture al events with:

# If mouse has more then one event, comment out what is not needed
event0 = InputDevice('/dev/input/event0')
event1 = InputDevice('/dev/input/event1')
event2 = InputDevice('/dev/input/event2')
event3 = InputDevice('/dev/input/event3')

for device in event0, event1, event2, event3:
    asyncio.ensure_future(print_events(device))

Is this a clean install or some residue from the IR experience?
It might that triggerhappy is intercepting something.

The latter I can’t advise, as I never even looked at Triggerhappy.

I’ve tried this on the same system.
I will give your script-idea a try but I cannot imagine that this will change things - I’ve tried to catch signals on event2&3 …

Triggerhappy is no option - not even another tool.

Do you have an idea where the given reactions from GUI came from?
Is there any key-mapping internally?
Than I might do not need to catch the signals with the python script but adjust given mapping.

My main fear is that the already given interpretation of signals interfers with the script.
So I stuck in the middle of nowhere - given interpretation is suboptimal (unknown wherefrom) and new one potentiall makes thiks even worse…
Thanks anyway so far.
Ralf

You were (as to be assumed) right.
(I have to say I am not able to understand this) - but including event2 and event3 shows up at least (buggy!) the volumeup and volumedown key.
But keystrokes do not produce reliably same code (!).
So my remote control seem to be crap.

I will put this s*%& in the waste bin and try to find an alternative.

BTW: I’ve disabled the IR-stuff - behaviour unchanged…

Warm regards and many thanks!
Ralf