Forum
How to run custom comand with IR remote? - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Hardware (/forum-7.html)
+--- Forum: Remotes and CEC support (/forum-26.html)
+--- Thread: How to run custom comand with IR remote? (/thread-760.html)



How to run custom comand with IR remote? - kraleksandr - 9th Apr, 2013 05:09 AM

Sometimes my IR remote starts work incorrectly. To fix it I must went to another room then run ssh client and execute 2 sudo-commands. How to map these commands to one button of my remote?


RE: How to run custom comand with IR remote? - CurlyMo - 9th Apr, 2013 05:15 AM

The program you need is irexec.


RE: How to run custom comand with IR remote? - kraleksandr - 9th Apr, 2013 03:34 PM

Ok, thanks.
Second question. How to run this at the system start? Looks like this dont work
Terminal
xbian@xbian ~ $ cat /etc/rc.local
#!/bin/sh -e
#
# By default this script does nothing.

irexec -d /home/xbian/.lircrc
exit 0
xbian@xbian ~ $ ls -al /etc/rc.local
-rwxr-xr-x 1 root root 336 Apr 9 09:13 /etc/rc.local



RE: How to run custom comand with IR remote? - CurlyMo - 9th Apr, 2013 06:18 PM

Edit the file for your config in /etc/lirc/hardware/ and set START_IREXEC=false to START_IREXEC=true


RE: How to run custom comand with IR remote? - kraleksandr - 9th Apr, 2013 06:46 PM

If I use GPIO reciever, I have to change the /etc/lirc/hardware/lirc_rpi.conf, right?
Now it looks like that
Terminal
xbian@xbian ~ $ cat /etc/lirc/hardware/lirc_rpi.conf
# /etc/lirc/hardware/lirc_rpi.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="-u"

#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=true

#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=""
Terminal
xbian@xbian ~ $ cat .lircrc
begin
prog = irexec
button = key_open/close
config = sudo /home/xbian/irrestart.sh &
end
Terminal
xbian@xbian ~ $ cat irrestart.sh
#!/bin/bash
service lirc stop
sleep 3
service lirc start

It works when I starts the irexec manually. But autostart doesnt work.


RE: How to run custom comand with IR remote? - CurlyMo - 9th Apr, 2013 06:56 PM

It should work like this, can help you further, sorry.


RE: How to run custom comand with IR remote? - kraleksandr - 18th Apr, 2013 03:16 PM

Should I create a bugreport on the github page?


RE: How to run custom comand with IR remote? - CurlyMo - 18th Apr, 2013 05:05 PM

No, because i got it working perfectly here. So it must be something in your config that we don't see.


RE: How to run custom comand with IR remote? - kraleksandr - 18th Apr, 2013 05:54 PM

Ok, then is somewhere any log that can show me what happens?