Last active
July 26, 2021 12:30
-
-
Save justinyoo/34e3470ced2641221c69ebeab6e034f7 to your computer and use it in GitHub Desktop.
Turning Raspberry PI into Remote Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update -y && sudo apt-get upgrade -y | |
sudo apt-get install lirc -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /boot/config.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment this to enable infrared communication. | |
#dtoverlay=gpio-ir,gpio_pin=17 | |
#dtoverlay=gpio-ir-tx,gpio_pin=18 | |
dtoverlay=gpio-ir,gpio_pin=18 | |
dtoverlay=gpio-ir-tx,gpio_pin=17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /etc/lirc/hardware.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LIRCD_ARGS="--uinput --listen" | |
LOAD_MODULES=true | |
DRIVER="default" | |
DEVICE="/dev/lirc0" | |
MODULES="lirc_rpi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /etc/lirc/lirc_options.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#driver = devinput | |
#device = auto | |
driver = default | |
device = /dev/lirc0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo /etc/init.d/lircd status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo cp ~/<model_name>.lircd.conf /etc/lirc/lircd.conf.d/<model_name>.lircd.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo /etc/init.d/lircd stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mode2 -m -d /dev/lirc0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /boot/config.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment this to enable infrared communication. | |
#dtoverlay=gpio-ir,gpio_pin=17 | |
#dtoverlay=gpio-ir-tx,gpio_pin=18 | |
dtoverlay=gpio-ir,gpio_pin=18 | |
#dtoverlay=gpio-ir-tx,gpio_pin=17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mode2 -m -d /dev/lirc0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo irrecord -d /dev/lirc0 --disable-namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mode2 -m -d /dev/lirc0 > <remote_controller_name>.lircd.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin remote | |
name tv | |
flags RAW_CODES | |
eps 25 | |
aeps 100 | |
ptrail 0 | |
repeat 0 0 | |
gap 20921 | |
begin raw_codes | |
name SWITCH_ON | |
8996 4451 552 574 551 576 | |
552 576 551 579 550 575 | |
553 1683 577 550 551 1683 | |
... | |
564 | |
name SWITCH_OFF | |
9000 4453 578 548 580 548 | |
578 549 556 572 552 576 | |
552 1683 577 551 550 1683 | |
... | |
573 | |
end raw_codes | |
end remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo cp ~/<remote_controller_name>.lircd.conf /ect/lirc/lircd.conf.d/<remote_controller_name>.lircd.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mv devinput.lircd.conf devinput.lircd.conf.dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /boot/config.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment this to enable infrared communication. | |
#dtoverlay=gpio-ir,gpio_pin=17 | |
#dtoverlay=gpio-ir-tx,gpio_pin=18 | |
dtoverlay=gpio-ir,gpio_pin=18 | |
dtoverlay=gpio-ir-tx,gpio_pin=17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo /etc/init.d/lircd status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irsend LIST <remote_controller_name> "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irsend SEND_ONCE tv SWITCH_ON |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Justin,
What are you using for your IR? I'm trying to get a USB IR device, I have irtoy2 and irdroid modules, to work on Raspberry PI OS but neither work with these instructions. Both flash the data received LED when I press buttons in irrecord but irrecord times out in 10 seconds with no data received.