Install LIRC (built on the previous step)
cd ~/lirc-src
sudo apt install -y ./liblirc0_0.10.1-6.2~deb10u1_armhf.deb ./liblircclient0_0.10.1-6.2~deb10u1_armhf.deb ./lirc_0.10.1-6.2~deb10u1_armhf.deb
Edit
/etc/lirc/lirc_options.conf
and make sure that driver and device are set as:
driver = default
device = /dev/lirc1
NOTE:
NOTE: Device /dev/lirc1
/dev/lirc1 is the receiver and device /dev/lirc0
/dev/lirc0 is the transmitter. Initially /dev/lirc1
/dev/lirc1 is used to scan a remote control. After that the configuration has to
be updated to /dev/lirc0
/dev/lirc0 and LIRC daemon must be restated with
sudo systemctl restart lircd
in order to send infrared commands.
Edit
/boot/config.txt
(with sudo or as root) and configure kernel extensions by adding the following line to the end of the file:
dtoverlay=gpio-ir,gpio_pin=18
dtoverlay=gpio-ir-tx,gpio_pin=17
Reboot Raspberry Pi:
sudo shutdown -r 0
Using IR Receiver
Using IR Receiver
Follow the steps below to verify that the IR receiver is working as expected:
Stop LIRC systemd service:
sudo systemctl stop lircd
Start outputting raw data from the IR receiver
mode2 -d /dev/lirc1
Point a remote control at the IR receiver on ANAVI Infrared pHAT and press its buttons. If the IR receiver is configured successfully you will see similar output:
space 3662230
pulse 2428
space 594
pulse 1201
space 596
pulse 1230
space 595
pulse 1209
space 590
pulse 1204
Using IR LED
Using IR LED
Follow the steps below to create LIRC configuration file and test the infrared transmitter:
Stop LIRC systemd service
sudo systemctl stop lircd
List all available names for buttons supported by LIRC:
irrecord --list-namespace
Type in the following command to create new LIRC control configuration file and follow the on screen instructions to scan a remote control:
irrecord -d /dev/lirc1 ~/lircd.conf
Example configuration output with name hifi: