Forum

Full Version: How to run custom comand with IR remote?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
The program you need is irexec.
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
Edit the file for your config in /etc/lirc/hardware/ and set START_IREXEC=false to START_IREXEC=true
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.
It should work like this, can help you further, sorry.
Should I create a bugreport on the github page?
No, because i got it working perfectly here. So it must be something in your config that we don't see.
Ok, then is somewhere any log that can show me what happens?
Reference URL's