IR control guide for Raspberry pi

Hello,
I use volumio2 with a raspberry pi 3 and a PiFi HIFI DAC + card. I found this guide: http://www.raspberrypiwiki.com/index.php/IR_control_guide to control Volumio 2 with a remote control: https://fr.aliexpress.com/item/1-Set-T-l-commande-Infrarouge-Module-Sans-Fil-R-cepteur-IR-Module-DIY-Kit-HX1838/32675236938.html?spm=a2g0s.9042311.0.0.jHoJLk, since the sound card has an IR receiver.
I had already installed and uninstall the plugin: IR remote controller because it does not work.
So I followed the guide, my remote works because I can have a lirc.conf file.
But nothing happens in volumio 2.
Can you help me ?
jp

I found that the ir-remote plugin does not work if you use a different remote. What is more you need to uninstall it if you want to use lirc with your remote, because it will constantly reset your config file.

So you installed lirc and got it running?
Did you create the .lircrc file for volumio?

If you have not you need to create a file called .lircrc in your home folder e.g. /home/volumio:
nano ~/.lircrc

with the following contents (copy from my file):
begin
prog = irexec
button = play [key of remote]
config = /usr/local/bin/volumio play
end
begin
prog = irexec
button = stop [key of remote]
config = /usr/local/bin/volumio stop
end
begin
prog = irexec
button = skip [key of remote]
config = /usr/local/bin/volumio previous
end
begin
prog = irexec
button = back [key of remote]
config = /usr/local/bin/volumio next
end
begin
prog = irexec
button = [key of remote]
config = /usr/local/bin/volumio seek plus
end
begin
prog = irexec
button = [key of remote]
config = /usr/local/bin/volumio seek minus
end

add any command by adding:
begin
prog = irexec
button =
config = mpc or volumio
end

the name of the buttons depends on your lirc config file.
hope it helps.

Yes

Yes

Yes I did everything! I do not understand, I can not launch the command “irw”, it returns to me “connect: no such file or directory”. It is therefore impossible to control that the buttons work.
The “irexec” command returns me
irexec: could not connect to socket
irexec: No such file or directory
I may have forgotten something, I do not understand, but I’m looking for …

I would first check if lirc is running at all:

systemctl status lirc

If it is not running you could try to start it

systemctl start lirc

while logging with

jounrnalctl -f

to look for further error messages.
You can also check

dmesg

for errors.

Furthermore have a look at the contents of /dev. What does

ls -al /dev/lirc*

show?

Then check the setting of REMOTE_DEVICE in /etc/lirc/hardware.conf.

volumio@volumio:~$ systemctl status lirc
● lirc.service - LSB: Starts LIRC daemon.
Loaded: loaded (/etc/init.d/lirc)
Active: active (exited) since Mon 2018-04-16 21:10:10 UTC; 8h ago
Process: 594 ExecStart=/etc/init.d/lirc start (code=exited, status=0/SUCCESS)
Apr 16 21:10:09 volumio lirc[594]: Loading LIRC modules:.
Apr 16 21:10:09 volumio lirc[594]: Starting remote control daemon(s) : LIRC :/usr/sbin/l…‘i’
Apr 16 21:10:09 volumio lirc[594]: Usage: lircd [options] [config-file]
Apr 16 21:10:09 volumio lirc[594]: .
Apr 16 21:10:09 volumio lirc[594]: Starting execution daemon: irexec: failed!
Apr 16 21:10:10 volumio systemd[1]: Started LSB: Starts LIRC daemon…
Hint: Some lines were ellipsized, use -l to show in full.

volumio@volumio:~$ ls -al /dev/lirc*
crw-rw---- 1 root video 245, 0 Apr 16 21:09 /dev/lirc0
lrwxrwxrwx 1 root root 21 Apr 16 21:10 /dev/lircd -> …/var/run/lirc/lircd

-I do not have REMOTE_DEVICE!

/etc/lirc/hardware.conf

Arguments which will be used when launching lircd

LIRCD_ARGS="-uinput"

#Don’t start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Don’t start irexec, even if a good config file seems to exist.
#START_IREXEC=false

#Try to load appropriate kernel modules
LOAD_MODULES=true

Run “lircd --driver=help” for a list of supported drivers.

DRIVER=“default”

usually /dev/lirc0 is the correct setting for systems using udev

DEVICE="/dev/lirc0"
MODULES=“lirc_rpi”

Default configuration files for your hardware if any

LIRCD_CONF=""
LIRCMD_CONF=""

So, lirc is not running which is not unexpected after the problem you described.

In order to test if the lirc driver works you could run

mode2 -d /dev/lirc0

and hit some buttons on your remote. You should see multiple lines beginning with “pulse” and “space”.

That looks ok to me.

My bad, it should be “DEVICE”.

Please check if in hardware.conf the entry for LIRCD_ARGS is preceded with “–” like that

"--uinput"

The code you posted seems to have just a single “-” in front of “uinput” but that may be caused by copying and pasting. Apart from that the hardware.conf also looks ok to me.

If the above mentioned test with “mode2 …” was successful you could make sure no lircd process is running anymore and try

lird -d /dev/lirc0

Then call irw again and see if it works.

It could be helpful to run journalctl -f in parallel and watch the messages.

You are right ! “–uinput” was not correctly written, now it works perfectly.
Thank you very much for helping me.
(Thanks also to google who translated these posts, I’m french, I know nobody is perfect!)

Great that it worked out! :smiley:

So by following this guide for raspberry pi: raspberrypiwiki.com/index.ph … trol_guide, it is possible to control Volumio 2 with another remote control than those that are in the plugin “IR Remote Controler” (mine is buy at aliexpress), provided you have an IR receiver of course …
Here is my .lircrc file, difficult to make easier. In this regard do you know other orders?

begin prog = irexec button = play config = /usr/local/bin/volumio play end begin prog = irexec button = stop config = /usr/local/bin/volumio stop end begin prog = irexec button = next config = /usr/local/bin/volumio next end begin prog = irexec button = prev config = /usr/local/bin/volumio previous end begin prog = irexec button = volup config = /usr/local/bin/volumio volume plus end begin prog = irexec button = voldown config = /usr/local/bin/volumio volume minus end

For further commands have a look at the lircrc here: https://github.com/volumio/volumio-plugins/blob/master/plugins/accessory/ir_controller/configurations/Denon%20Remote%20RC-1204/lircrc.

The list seems to be pretty complete regarding commands for /usr/bin/volumio. But of course irexec is able to execute other programs than /usr/bin/volumio, too.