Help in buying IR/WIreless remote control for volumio

Hi All,

I am planning to buy an IR remote control for my RPi 4 running on Volumio 3.449. I have seen many options of wireless/IR remote options in my local Amazon store like the following:

Can someone please let me know the following:

  1. Whether this kind of remote will work. If not, kindly post some product links which you use.
  2. Do I need to install anything on the RPi board or the USB dongle that will come with such remote control will work.

Thanks in advance.

Regards,
Sudhanshu

It works with Volumio, using the same one
You do need to install something like:

and you need to create or adapt the code:

#!/usr/bin/python3

import struct
import time
import subprocess
import os

dev_list_filename = '/proc/bus/input/devices'

while True:
    dev_list_file = open(dev_list_filename, 'r')

    dev_found = False
    infile_path = "/dev/input/"
    for line in dev_list_file:
        if '=' in line:
            tokens = line.split('=')
            if  'ZYSD.Ltd HCY RC Consumer Control' in tokens[1]:
                dev_found = True
            if dev_found and 'Handlers' in tokens[0]:
                tokens = tokens[1].split(' ')
                infile_path = infile_path + tokens[1]
                break

    if dev_found:
        EVENT_SIZE = struct.calcsize("llHHIllHHIllHHI")
        file = open(infile_path, "rb")
        event = file.read(EVENT_SIZE)
        #print(event)
        pressed = -1
        while event:
            (tv_sec1, tv_usec1, type1, code1, value1, tv_sec2, tv_usec2, type2, code2, value2, tv_sec2, tv_usec3, type3, code3, value3) = struct.unpack("llHHIllHHIllHHI", event)
            if pressed == -1:
                pressed = value1
                print(value1)
                # Home => 786979
                # Back => 786980
                # -    => 786666
                # +    => 786665
                
                if value1 == 786666:
                    command = 'volumio previous'
                    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
                elif value1 == 786665:
                    command = 'volumio next'
                    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
                elif value1 == 786979:
                    command = 'node /data/plugins/user_interface/randomizer/randomAlbum'
                    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
                elif value1 == 786980:
                    command = 'node /data/plugins/user_interface/randomizer/randomTracks'
                    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)

            elif pressed == value1:
                pressed = -1
            event = file.read(EVENT_SIZE)
    else:
        dev_list_file.close()
        time.sleep(1)
#!/usr/bin/python3
import struct
import time
import subprocess
import os

dev_list_filename = '/proc/bus/input/devices'

while True:
    dev_list_file = open(dev_list_filename, 'r')

    dev_found = False
    infile_path = "/dev/input/"
    for line in dev_list_file:
        if '=' in line:
            tokens = line.split('=')
            if  'ZYSD.Ltd HCY RC' in tokens[1]:
                dev_found = True
            if dev_found and 'Handlers' in tokens[0]:
                tokens = tokens[1].split(' ')
                infile_path = infile_path + tokens[2]
                break

    if dev_found:
        EVENT_SIZE = struct.calcsize("llHHIllHHIllHHI")
        file = open(infile_path, "rb")
        event = file.read(EVENT_SIZE)
        #print(event)
        pressed = -1
        while event:
            (tv_sec1, tv_usec1, type1, code1, value1, tv_sec2, tv_usec2, type2, code2, value2, tv_sec2, tv_usec3, type3, code3, value3) = struct.unpack("llHHIllHHIllHHI", event)
            if pressed == -1:
                pressed = value1
                print(value1)
                # OK => 458792
                # ^  => 458834
                # v  => 458833
                # <  => 458832
                # >  => 458831

                if value1 == 458832:
                   command = 'volumio seek minus'
                   process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
                elif value1 == 458831:
                   command = 'volumio seek plus'
                   process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
                elif value1 == 458792:
                    command = 'volumio toggle'
                    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
                elif value1 == 458834:
                    command = 'sudo systemctl restart oled'
                    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
                elif value1 == 458833:
                    command = 'sudo systemctl restart oled1'
                    process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)

            elif pressed == value1:
                pressed = -1
            event = file.read(EVENT_SIZE)
    else:
        dev_list_file.close()
        time.sleep(1)
2 Likes

Thanks @Wheaten, appreciate the solution.

I have zero knowledge of tinkering with Linux and adding codes in Volumio. I needed a simpler solution with an off the shelf plug and play kind of thing. Plz let me know if you know any.

nope, then you should go with an IR, for which there is a plugin. and supporting many remotes.

I got a couple of these:

they work fine with Volumio 2 & 3 on RPI3, RPI4, Wyse3040 thin client.
You need only to plug the dongle into an USB port.
Frankly speaking, any “Air Mouse” does the trick, even the one posted by the opener,
Just check the buttons layout, before you buy. Be sure you get an air mouse with the basic buttons you could find on a standard remote: play, stop, next track, previous track, volume, etc.

Cutting & pasting from my old posts with some use details:

About the remote
After experimenting remotes with diodes you need to connect to the bus, I found a simpler solution with the “Air Mouse” types. A remote like that provides out-of-box, plug&play, functions of play/stop & track skip togheter volume control for Rasperry. With a Wsye 3040, you can enjoy a safe ON/OFF functions, too, with just a simple bios setting. More again, since the air mouse communicates with the unit wirelessly via its own USB dongle, you can drive the unit through the wall of another room. This is the perfect solution for me, since I have to hide my wyse, the dac and the amplifier, inside a furniture of my living room.

from here

and

Other than inserting the dongle supplied with the remote, into a USB port, nothing at all. No bios config, no drive, no OS script or setup-up. An Air Mouse is just a mouse with multimedia buttons on it. After a while of use, I can, now, navigate the Volumio UI from my armchair, just looking at the TV set.
It needs some exercise, since you have to learn to rotate just the wrist, not move the arm.

from here

HTH

1 Like

Thanks a lot @Wheaten . I will try this. :+1:t2::blush:

That’s so amazing. I was looking for such solutions precisely. Thanks a lot @Gdg :ok_hand:t2::+1:t2:

1 Like