[SOLVED]How to start, enable Lirc server?

Hello!
I have Raspberry Pi 3 with OSMC install. On top of that i have also Hyperion and Lirc with IR blaster for controlling of other IR devices. I execute Lirc commands from Openhab.
I recently bought Sonoff device for controlling lights in my living room.
Now, what i am trying to do is to enable Lirc server, so that i could switch my lights with my remote.
There is instruction for that on Openhab site, but i am having problem of locating lirc.service file.
I found two similar, lircd_helper@.service and eventlircd.service in lib/ run/ lirc. If I put --listen at the end of ExecStart line in one or another file, Lirc binding does not connect to it.
Any ideas?
Thanks.

I think you want irexec for blasting.

There was some discussion about this some time ago. A search will review some things.

@DBMandrake – one to revisit when we get a quiet day.

Sam

I have to apologize for my bad English first. Second for my bad knowledge of Linux :slight_smile:
Sam, if I understand you good you are referring to IR blasting as I mentioned it in my post above?
If so, I have no problems with it. It is working fine. To transmit Ir commands i use Openhab with Exec binding.
What i am trying to do is, sent Ir command that are received with raspberry, over network to my Openhab Lirc binding.
From there i could control my WiFi switch.
I just need some direction where to put --listen argument…
here is similar post

In osmc there is file /var/run/lirc/lircd-lirc0.sh, that is starting lircd and you can add here option --listen.
But this file is regenerated at every reboot, so this changes will be lost soon.
Then you can look at file /lib/udev/lircd_helper, that is generating lircd-lirc0.sh file. And add there needed option --listen. But this file also could be regenerated when osmc update comes.

In your situation… if i undestand correctly, you have two microcomputers ?..

  1. raspberry + ir transceiver + osmc + lirc
  2. … + ir transceiver + openhub + lirc

then i think you can add additional remote configuration to your 2 microcomputer, without using 1 at all.

Thanks edno!
My situation is:
1.raspberry + ir transceiver+ir receiver + osmc + lirc
2.Nas+OpenHab

Could somebody help me to put --listen in the file?

#!/bin/sh
################################################################################
**# lircd_helper**
**#**
**# This script can be used by udev to start or stop lircd when a remote control**
**# device is added or removed.**
**#**
**# lircd_helper configures lircd to output using a uinput event device so that**
**# eventlircd can aggregate the outputs into a single lircd socket.**
**#**
**# lircd_helper configures lircd to use an lircd socket name that is derived**
**# from the device name. In addition, lircd_helper creates symbolic links to this**
**# lircd socket that are derived from the device symbolic links. You can use this**
**# socket and the symbolic link to this socket when using commands such as**
**# irsend.**
**#**
**# lircd_helper understands two lircd_helper specific device properites set**
**# using ENV{} and passed as environment variables:**
**#   lircd_driver:**
**#     Used to tell lircd_helper the name of the lircd driver.**
**#   lircd_conf:**
**#     Used to tell lircd_helper the path to the lircd.conf file to use.**
**#   lircd_uinput_disable:**
**#     Used to tell lircd_helper to not not have lircd create a uninput event**
**#     device. Kernel LIRC drivers that use rc_core perform kernel space signal**
**#     decoding and create an event device. Therefore, we do not want lircd to**
**#     create another event device. However, if the LIRC device is a transmitter**
**#     as well as receiver, then we still need lircd running.**
################################################################################

logger -t "lircd_helper" ACTION ${ACTION}
logger -t "lircd_helper" lircd_driver ${lircd_driver}
logger -t "lircd_helper" DEVNAME ${DEVNAME}
case "${ACTION}" in
    add|change)
        if test "x${lircd_driver}" = "x" ; then
            exit 1;
        fi
if test "x${lircd_conf}" = "x" ; then
            exit 1;
        fi
        if test ! -e '/var/run/lirc' ; then
            mkdir -p '/var/run/lirc'
        fi
        devname_instance=`echo ${DEVNAME} | sed -e 's/\/\+/~/g' -e 's/^~dev~//'`
        if test "x${lircd_driver}" = "xatilibusb" ; then
            devname_instance="atilibusb"
        fi
        logger -t "lircd_helper" add/change devname_instance ${devname_instance}
        if test -e "/var/run/lirc/lircd-${devname_instance}.pid"; then
            process=$(ps -p $(cat /var/run/lirc/lircd-${devname_instance}.pid) -o$
            if test ! "x${process}" = "xlircd" ; then
                logger -t "lircd_helper" removing stale pid "/var/run/lirc/lircd-$
                rm -rf "/var/run/lirc/lircd-${devname_instance}.pid"
            fi
        fi
        if test ! -e "/var/run/lirc/lircd-${devname_instance}.pid" ; then
            daemon='/usr/sbin/lircd'
 fi
        if test ! -e '/var/run/lirc' ; then
            mkdir -p '/var/run/lirc'
        fi
        devname_instance=`echo ${DEVNAME} | sed -e 's/\/\+/~/g' -e 's/^~dev~//'`
        if test "x${lircd_driver}" = "xatilibusb" ; then
            devname_instance="atilibusb"
        fi
        logger -t "lircd_helper" add/change devname_instance ${devname_instance}
        if test -e "/var/run/lirc/lircd-${devname_instance}.pid"; then
            process=$(ps -p $(cat /var/run/lirc/lircd-${devname_instance}.pid) -o$
            if test ! "x${process}" = "xlircd" ; then
                logger -t "lircd_helper" removing stale pid "/var/run/lirc/lircd-$
                rm -rf "/var/run/lirc/lircd-${devname_instance}.pid"
            fi
        fi
        if test ! -e "/var/run/lirc/lircd-${devname_instance}.pid" ; then
            daemon='/usr/sbin/lircd'
            daemon="${daemon} --driver=${lircd_driver}"
            daemon="${daemon} --device=${DEVNAME}"
            if test ! "x${lircd_uinput_disable}" = "xtrue" ; then
                daemon="${daemon} --uinput"
            fi
            daemon="${daemon} --output=/var/run/lirc/lircd-${devname_instance}"
            daemon="${daemon} --pidfile=/var/run/lirc/lircd-${devname_instance}.p$
            daemon="${daemon} ${lircd_conf}"
            echo "${daemon}" > "/var/run/lirc/lircd-${devname_instance}.sh"
            chmod a+x "/var/run/lirc/lircd-${devname_instance}.sh"
            systemctl start lircd_helper@${devname_instance}.service
            logger -t "lircd_helper" add/change DEVLINKS ${DEVLINKS}
            for devlink in ${DEVLINKS} ; do
                devlink_instance=`echo ${devlink} | /bin/sed -e 's/\/\+/~/g' -e '$
                if test ! "x${devlink_instance}" = "x" ; then
                    logger -t "lircd_helper" add/change devlink_instance ${devlin$
                    rm -f "/var/run/lirc/lircd-${devlink_instance}"
                    ln -s "lircd-${devname_instance}" "/var/run/lirc/lircd-${devl$
                fi
            done

Add this to the other similar lines:
daemon="${daemon} --listen"

Thanks penfold42! That was it!
Now I can toggle my WiFi switch with my remote :slight_smile:
Lirc server is up and connected to my OpenHab server.
Lots of thanks to everyone…