Austin Stanton
Published © GPL3+

Creating A Raspberry Pi Universal Remote With LIRC

This project allows anyone to turn a Raspberry Pi into a universal remote using LIRC (LINUX Infrared Remote Control).

IntermediateFull instructions provided2 hours118,534
Creating A Raspberry Pi Universal Remote With LIRC

Things used in this project

Hardware components

Raspberry Pi 3 Model B
Raspberry Pi 3 Model B
×1
IR receiver (generic)
×1
IR transmitter (generic)
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×1

Software apps and online services

LIRC
LINX
NI LINX
LabVIEW Community Edition
LabVIEW Community Edition

Story

Read more

Code

Code snippet #3

Plain text
sudo cat > /etc/lirc/hardware.conf <<EOF 
########################################################
# /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=""
######################################################## 
EOF

Code snippet #7

Plain text
space 16300
pulse 95
space 28794
pulse 80
space 19395
pulse 83
space 402351
pulse 135
space 7085
pulse 85
space 2903

Code snippet #8

Plain text
# Stop lirc to free up /dev/lirc0
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


# 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

Code snippet #9

Plain text
# List all of the commands that LIRC knows for 'Roku'
irsend LIST Roku ""


# Send the KEY_POWER command once
irsend SEND_ONCE Roku KEY_POWER


# Send the KEY_VOLUMEDOWN command once
irsend SEND_ONCE Roku KEY_VOLUMEDOWN

Credits

Austin Stanton

Austin Stanton

14 projects • 37 followers
I work as a Product Marketing Engineer at NI. In my free time, I love tinkering and finding creative ways to solve everyday problems.

Comments