- sudo modprobe lirc_dev
- sudo modprobe lirc_rpi gpio_in_pin=23 gpio_out_pin=22
Modify /etc/lirc/hardware.conf
########################################################
# /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=""
########################################################
Start and Stop lirc
Check Key List name $ irrecord --list-namespace
# Stop lircd so /dev/lirc0 is not in use
sudo /etc/init.d/lirc stop
# Create a new remote control configuration file (using /dev/lirc0) and save the output to ~/lircd.conf
irrecord -d /dev/lirc0 ~/lircd.conf
# Edit ~/lircd.conf and add edit the name of the controlled device
nano ~/lircd.conf
# Make a backup of the original lircd.conf file
sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd_original.conf
# Copy over your new configuration file
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
# Start up lirc again
sudo /etc/init.d/lirc start
TEST
# List all of the commands that LIRC knows for 'samsung_tv'
irsend LIST samsung_tv ""
# Send the KEY_POWER command once
irsend SEND_ONCE samsung_tv KEY_POWER
# Send the KEY_VOLUMEDOWN command once
irsend SEND_ONCE samsung_tv KEY_VOLUMEDOWN
# Send the KEY_VOLUMEDOWN command 10 times lowering the volume for 10 units at once
irsend --count=10 samsung_tv KEY_VOLUMEDOWN