IR control guide for Raspberry pi

Get help for Volumio here!

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.

IR control guide for Raspberry pi

Postby jppmedia » Sun Apr 15 2018 18:18

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
User avatar
jppmedia
Sunday DIYer
Sunday DIYer
 
Posts: 18
Joined: Thu Nov 10 2016 23:48

Ads helps Volumio remain Free and Open Source. Please consider donating to help us continue to serve you.


IR control guide for Raspberry pi

Postby c-st » Mon Apr 16 2018 09:40

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 = <your new button>
config = mpc <command> or volumio <command>
end

the name of the buttons depends on your lirc config file.
hope it helps.
Random avatar
c-st
Fresh off the boat
Fresh off the boat
 
Posts: 5
Joined: Thu Mar 08 2018 07:54


IR control guide for Raspberry pi

Postby jppmedia » Mon Apr 16 2018 20:58

c-st wrote:So you installed lirc and got it running?

Yes
c-st wrote:Did you create the .lircrc file for volumio?

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 ....
Raspberry Pi 3 and pifiberry dac+ sku:363003
User avatar
jppmedia
Sunday DIYer
Sunday DIYer
 
Posts: 18
Joined: Thu Nov 10 2016 23:48


IR control guide for Raspberry pi

Postby gvolt » Mon Apr 16 2018 22:38

jppmedia wrote: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 would first check if lirc is running at all:
Code: Select all
systemctl status lirc

If it is not running you could try to start it
Code: Select all
systemctl start lirc

while logging with
Code: Select all
jounrnalctl -f

to look for further error messages.
You can also check
Code: Select all
dmesg

for errors.

Furthermore have a look at the contents of /dev. What does
Code: Select all
ls -al /dev/lirc*

show?

Then check the setting of REMOTE_DEVICE in /etc/lirc/hardware.conf.
Random avatar
gvolt
Objectivist
Objectivist
 
Posts: 289
Joined: Fri Mar 02 2018 16:47


IR control guide for Raspberry pi

Postby jppmedia » Tue Apr 17 2018 06:01

gvolt wrote:I would first check if lirc is running at all:
systemctl status lirc

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.

gvolt wrote:Furthermore have a look at the contents of /dev. What does
ls -al /dev/lirc*

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

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

-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=""
Raspberry Pi 3 and pifiberry dac+ sku:363003
User avatar
jppmedia
Sunday DIYer
Sunday DIYer
 
Posts: 18
Joined: Thu Nov 10 2016 23:48


IR control guide for Raspberry pi

Postby gvolt » Tue Apr 17 2018 09:01

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
Code: Select all
mode2 -d /dev/lirc0

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

jppmedia wrote: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

That looks ok to me.

jppmedia wrote:-I do not have REMOTE_DEVICE!

My bad, it should be "DEVICE".

Please check if in hardware.conf the entry for LIRCD_ARGS is preceded with "--" like that
Code: Select all
"--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
Code: Select all
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.
Random avatar
gvolt
Objectivist
Objectivist
 
Posts: 289
Joined: Fri Mar 02 2018 16:47


IR control guide for Raspberry pi

Postby jppmedia » Tue Apr 17 2018 11:51

gvolt wrote:Please check if in hardware.conf the entry for LIRCD_ARGS is preceded with "--" like that
CODE: TOUT SÉLECTIONNER
"--uinput"


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!)
Raspberry Pi 3 and pifiberry dac+ sku:363003
User avatar
jppmedia
Sunday DIYer
Sunday DIYer
 
Posts: 18
Joined: Thu Nov 10 2016 23:48


IR control guide for Raspberry pi

Postby gvolt » Tue Apr 17 2018 12:18

Great that it worked out! :D
Random avatar
gvolt
Objectivist
Objectivist
 
Posts: 289
Joined: Fri Mar 02 2018 16:47


IR control guide for Raspberry pi

Postby jppmedia » Tue Apr 17 2018 12:31

So by following this guide for raspberry pi: http://www.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?
Code: Select all
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
Raspberry Pi 3 and pifiberry dac+ sku:363003
User avatar
jppmedia
Sunday DIYer
Sunday DIYer
 
Posts: 18
Joined: Thu Nov 10 2016 23:48


IR control guide for Raspberry pi

Postby gvolt » Tue Apr 17 2018 16:04

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.
Random avatar
gvolt
Objectivist
Objectivist
 
Posts: 289
Joined: Fri Mar 02 2018 16:47


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest