LIRC supports many types of IR detectors, such as Energenie's PiMote IR board; however, since we only need to receive IR signals, we can use a simple (TSOP38238) IR detector:
Install the following packages using the apt-get command:
sudo apt-get install lirc lirc-x
Add the following to /boot/config.txt. This will enable the driver and define the pin the receiver is fitted on (BCM GPIO24):
dtoverlay=lirc-rpi,gpio_in_pin=23
Perform a restart of the Raspberry Pi so that the configuration takes effect:
sudo reboot
We should now find that ...