1

I have an infrared remote control which sends RC-5 signals and a computer with an IR receiver. The computer runs Debian 8 and I'm trying to set up LIRC so that I can control the music player daemon (MPD) with the remote.

I have installed the lirc package and added a configuration file for RC-5 signals in /etc/lirc/lircd.conf.d/.

The daemon seems to be active:

$ systemctl status lirc.service 
● lirc.service - LSB: Starts LIRC daemon.
   Loaded: loaded (/etc/init.d/lirc)
   Active: active (exited) since Sun 2016-01-31 20:18:17 CET; 32s ago
  Process: 408 ExecStart=/etc/init.d/lirc start (code=exited, status=0/SUCCESS)

However, when I try to test the remote control with irw it fails:

$ irw
connect: No such file or directory

According to man irw this seems to be cause by the absence of the socket file /var/run/lirc/lircd. The directory /var/run/lirc is empty.

Any clues would be greatly appriciated.

  • 1
    The daemon isn't running (active (exited)), so there's no socket. You need to figure out why it's exited, presumably by looking at its logs. – Stephen Kitt Jan 31 '16 at 22:03
  • @StephenKitt Thanks for the hint. It turned out that I needed to set driver and device in /enc/lirc/hardware.conf. I will soon post a complete (minimal) solution. – August Karlstrom Feb 2 '16 at 22:42
2

Here are the steps I needed to perform to make it work. Initially I got stuck at step two.

  1. Install LIRC:

    # apt-get install lirc
    
  2. In /etc/lirc/hardware.conf, set DRIVER and DEVICE:

    DRIVER="default"
    DEVICE="/dev/lirc0"
    
  3. Download a configuration file for the remote control and copy it to /etc/lirc/lircd.conf. In my case the protocol is RC-5 and I found a working configuration file at http://lirc.sourceforge.net/remotes/rc-5/RC-5.

  4. Restart the LIRC daemon:

    # systemctl restart lirc
    
  5. To find out the name for each button, run irw, point the remote control to the IR receiver and press buttons.

  6. Specify what should happen when a button is pressed in the file /etc/lirc/lircrc. Here is the file I created for MPD:

    begin
        button = sys_14_command_21
        prog   = irexec
        config = mpc prev
    end
    
    begin
        button = sys_14_command_20
        prog   = irexec
        config = mpc next
    end
    
    begin
        button = sys_14_command_35
        prog   = irexec
        config = mpc play
    end
    
    begin
        button = sys_14_command_30
        prog   = irexec
        config = mpc pause
    end
    
    begin
        button = sys_14_command_36
        prog   = irexec
        config = mpc stop
    end
    
  7. Start irexec:

    $ irexec --daemon
    
| improve this answer | |
0

I had a problem similar to this and the only way for me to make it work was to run:

sudo /usr/sbin/lircd --driver=default --device=/dev/lirc0 

Under:

 Linux raspberrypi 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux

This seems to create the directory needed for the pid and socket connection!? I could be wrong but after a lot of testing that was the only substantial change I've made.

Once I have a fresh installation I'll confirm this and post all the commands I ran

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.