IR Remote Control Support on Raspbian Buster – JustBoom
This guide will show you how to get your IR remote control working with the Raspberry Pi using the latest Raspbian Buster OS. Since the release of Buster there have been some significant changes to the way IR is handled, in particular there is now a new driver replacing the old lirc driver. In this guide will be showing you how to setup the JustBoom remote control with the JustBoom DAC HAT. This guide will work for any IR remote control and IR receiver.
What you will need
- Raspberry Pi board
- 8GB (min) micro SD card with latest Raspbian Buster OS
- Power Supply
- Mouse & Keyboard (or SSH)
- JustBoom HAT (IR receiver)
- IR remote control
Step 1 – First step is to add the new driver as a dtoverlay. Open up a terminal window or SSH into the Raspberry Pi and then edit the /boot/config.txt file to add the following line:
sudo nano /boot/config.txt
Add:
dtoverlay=gpio-ir,gpio_pin=25
For the JustBoom HAT the IR receiver is connected to GPIO pin 25, if your differs then you will need to change to the pin that the IR receiver is connected to on the Raspberry Pi.
Reboot for the driver to be loaded:
sudo reboot
Step 2 – Now lets get those scan codes from your remote control. For this we are going to use IR-Keytable:
sudo apt install ir-keytable
Now run the following and press the keys on your remote to get the scan codes:
sudo ir-keytable -c -p all -t
Make a note of the button pressed and the scan code.
Step 3 – Install lirc (Linux infrared control) with the following commands:
sudo apt update sudo apt install lirc
Note: Installation at this point may fail on Buster.
sudo cp /etc/lirc/lirc_options.conf.dist /etc/lirc/lirc_options.conf sudo apt install lirc
Edit the following file:
sudo nano /etc/lirc/lirc_options.conf
Change the following lines:
driver = default device = /dev/lirc0
Save and Exit:
CTRL+O & ENTER to exit
CTRL+X to exit
Step 4 – Create remote configuration file with scan codes.
sudo nano ~/lircd.conf
Add the following for the JustBoom remote scan codes:
# Please make this file available to others # by sending it to <lirc@bartelmus.de> # # this config file was automatically generated # using lirc-0.9.0-pre1(default) on Thu Dec 15 14:58:27 2016 # # contributed by: Francesco Vannini # # brand: JustBoom # model no. of remote control: IR Remote # devices being controlled by this remote: # begin remote name lircd.conf bits 5 flags RC5|CONST_LENGTH eps 30 aeps 100 one 921 855 zero 921 855 plead 936 pre_data_bits 8 pre_data 0xA0 gap 114211 toggle_bit_mask 0x800 begin codes Home 0x10 Mute 0x12 Power 0x11 Up 0x1A Down 0x1B Left 0x13 Right 0x14 OK 0x15 Menu 0x16 Back 0x17 Volume-Up 0x19 Volume-Down 0x18 end codes end remote
Save and Exit:
CTRL+O & ENTER to exit
CTRL+X to exit
Back up the old configuration file and then replace with new file we just created:
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
Reboot:
sudo reboot
Step 5 – Now lets test our remote with the following command:
irw