The following steps are highly based on the excellent guides found here:

http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/

https://camp.isaax.io/en/isaax-examples/ir-control-via-lirc-on-raspberry-pi-zero-w

This guide is based on Rasbian Stretch and lirc 0.9.4c-9

Other guides may be based on earlier versions of and mention a hardware.conf file that is no longer needed with this version and higher. I've also found that it is no longer necessary on my systems to modify the /etc/modules file

At this time, additional changes will be needed for kernel version 4.19 that are not documented here currently. Please ensure you are on 4.14 for this set of instructions

The Linux Infrared Remote Control (LIRC) library is used to handle receiving IR commands through the receiver module, saving them to a file, and then sending the commands when desired through the IR LED.

The first step is to record the IR signals from our existing remote using the IR Receiver and saving them to a file. The IR Receiver is only needed initially to learn the IR signals and then could be removed, so a temporary connection could be used.

Connect the IR Receiver to the Raspberry Pi. Use the attached picture to identify the VCC, GND, and Signal pins. Using a breadboard, hookup wires, or creative bending of the pins to the following connections

VCC connects to 5 volt pin

GND to a ground pin

Signal to Pin 23

Power on and connect to the Raspberry Pi through either by opening the terminal on the local device, or creating an SSH connection using a program such as Putty for Windows.

The following lines can be copied and pasted into the SSH session. They will add/modify lines to various configuration files required for lirc to operate.

sudo apt update sudo apt install -y lirc echo dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22 | sudo tee -a /boot/config.txt sudo sed -i '/driver = */cdriver = default' /etc/lirc/lirc_options.conf sudo sed -i '/device = */cdevice = /dev/lirc0' /etc/lirc/lirc_options.conf sudo shutdown -r now

Wait for the device to reboot and log in again.

Optional: Test IR Receiver

Mount the LIRC device to confirm any input can be received. You may need to restart the Pi after this test is completed to make it available for later steps.

sudo systemctl stop lircd mode2 -d /dev/lirc0

Aim an IR remote control at the receiver and press a button and ensure data appears on the screen

CTRL+C to stop

At this point, the LIRC program is installed and we are able to view IR information.