Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]). | |
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch. | |
Following are the changes that I made to make it work. | |
$ sudo apt-get update | |
$ sudo apt-get install lirc | |
# Add the following lines to /etc/modules file | |
lirc_dev | |
lirc_rpi gpio_in_pin=18 gpio_out_pin=17 | |
# Add the following lines to /etc/lirc/hardware.conf file | |
LIRCD_ARGS="--uinput --listen" | |
LOAD_MODULES=true | |
DRIVER="default" | |
DEVICE="/dev/lirc0" | |
MODULES="lirc_rpi" | |
# Update the following line in /boot/config.txt | |
dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17 | |
# Update the following lines in /etc/lirc/lirc_options.conf | |
driver = default | |
device = /dev/lirc0 | |
$ sudo /etc/init.d/lircd stop | |
$ sudo /etc/init.d/lircd start | |
# Check status to make lirc is running | |
$ sudo /etc/init.d/lircd status | |
# Reboot before testing | |
$ reboot | |
# To test if lirc driver is working | |
$ sudo /etc/init.d/lircd stop | |
$ mode2 -d /dev/lirc0 | |
<press a key in remote and you should see multple lines like below> | |
pulse 560 | |
space 1706 | |
pulse 535 | |
# to record a custom remote/register a remote device | |
$ sudo /etc/init.d/lircd stop | |
$ sudo irrecord -d /dev/lirc0 ~/lircd.conf | |
# follow the instruction prompted by the above command carefully | |
# at the end ~/lircd.conf file will be generated | |
# backup the original lircd.conf | |
$ sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd_original.conf | |
$ sudo cp ~/lircd.conf /etc/lirc/lircd.conf | |
$ sudo /etc/init.d/lircd start | |
# you can test if the recorded remote works by | |
$ irsend SEND_ONCE <device-name> KEY_POWER | |
$ irsend SEND_ONCE <device-name> KEY_VOLUMEUP | |
[1] https://www.amazon.com/Infrared-Shield-for-Raspberry-Pi/dp/B00K2IICKK/ref=pd_sbs_328_1?_encoding=UTF8&psc=1&refRID=1QPY33VFCGETBJ17K8QE | |
[2] http://learn.linksprite.com/raspberry-pi/shield/infrared-transceiver-on-raspberry-pi-lirc-software-installation-and-configuration/ |
This comment has been minimized.
This comment has been minimized.
felixfischer
commented
Nov 12, 2017
Exactly what I wanted to say :) Thank you @prasanthj! |
This comment has been minimized.
This comment has been minimized.
thierrytien
commented
Nov 21, 2017
i like this |
This comment has been minimized.
This comment has been minimized.
OberstVonGatow
commented
Dec 3, 2017
Only Tutorial that worked! Thank You |
This comment has been minimized.
This comment has been minimized.
sandman112
commented
Dec 18, 2017
•
spent the last 4-5 hours trying to get this to work on an old RPI 1 and energenie IR board, this worked perfectly one thing I would add that I found elsewhere is to run the following command as well ... sudo /usr/share/lirc/lirc-old2new while this might not have been the cause of my problems this is where I managed to get things to start working, but the above sorted things out ... |
This comment has been minimized.
This comment has been minimized.
Alkuimista
commented
Dec 28, 2017
HI, I'm trying to get lirc working on Strech, but theres no "/etc/lirc/hardware.conf" because it's version 0.9.4 for what I've been told: |
This comment has been minimized.
This comment has been minimized.
siggi60
commented
Jan 2, 2018
@prasanthj Very good How-to, but, as remarked by Alkuimista, there's no hardware.conf file. Best regards and, of course, happy new Year :) |
This comment has been minimized.
This comment has been minimized.
ageorgios
commented
Jan 4, 2018
hardware.conf missing here too |
This comment has been minimized.
This comment has been minimized.
grigrichaminou
commented
Jan 6, 2018
Thank you very much for making this work. I looked for a long time but nothing worked. now everything is operational. |
This comment has been minimized.
This comment has been minimized.
dominikbrandon
commented
Jan 6, 2018
@Alkuimista @siggi60 @ageorgios also, i have faced a problem where everything seemed to work fine, but i didn't get any output running irw command. in case someone's stuck there: the problem is lircd.conf file which you've just generated. take a look at it - you probably will get two hex codes for each button, where the second one is always the same. simply delete this value from each line and everything should work now. |
This comment has been minimized.
This comment has been minimized.
jimbob-1
commented
Jan 13, 2018
Hi Guys, I might have something that someone else might find useful, that I couldn't find anywhere else on the web. Details: Some of your issues I "resolved" by jumping around the web, but this one was what solved it all for me.
My biggest issue was non-cfl... IR noise, even with the TSOP in a cardboard box (with a lid loosely on). I'm in practical darkness (where the sporadic noise is)
irrecord kept telling me that it was detecting "170 bytes" but that it was minimal noise. Once I moved it to the GOOD location in my house, it stopped reporting any sign of IR. "No significant noise (received 0 bytes)" is what you want IRRECORD to say; anything else and YOU WILL HAVE PROBLEMS. Another would be dead give away: irrecord would ask for button input, then a second or two later (before I press the button) it would say that it received a signal. What really helped conclude was: cat /dev/lirc0, and seeing tons of random jibberish all across my screen for 30 seconds (and would pause for a couple seconds, then repeat). I would expect to see non-unicode characters, but ONLY when I press the button! No other time, because it is NOISE! Maybe a few characters are acceptable (here and there)... While running cat /dev/lirc0 and moving the TSOP38328 sensor: I noticed it dropped right off as soon as I left my dark living room. I can't believe that someone (myself) dealing with RF on a day to day basis; took 3 days to figure out this problem! Thanks to all! |
This comment has been minimized.
This comment has been minimized.
josemotta
commented
Jan 15, 2018
Hi @Alkuimista, the link below has info about new setup for Raspberry Raspbian Stretch Lircd version 0.9.4c https://github.com/josemotta/IoT.Starter.Api/tree/master/gpio-base |
This comment has been minimized.
This comment has been minimized.
unnamalai-kb
commented
Jan 24, 2018
I am running Raspbian Stretch with Desktop (kernel version 4.9) on a Raspberry Pi 3. and ANAVI Infrared pHAT IR board. I followed the steps as in this how-to. Created a hardware.conf as this was missing . But when I tried recording a panasonic aircon remote, it failed to create .conf file and seemed to hung in irrecord after two lines of dots of button presses. Any help on this? logpi@raspberrypi:~ $ sudo irrecord -d /dev/lirc0 ~/lircd.conf irrecord - application for recording IR-codes ----Press RETURN to continue. Checking for ambient light creating too much disturbances. No significant noise (received 0 bytes) Enter name of remote (only ascii, no spaces) :panasonicir Now start pressing buttons on your remote control. It is very important that you press many different buttons randomly Press RETURN now to start recording. Please keep on pressing buttons like described above. |
This comment has been minimized.
This comment has been minimized.
unnamalai-kb
commented
Jan 26, 2018
I am now able to control the Panasonic aircon with anavi infrared phat on a raspberry pi board :-) by following the steps in the tutorial link https://www.cnx-software.com/2017/03/12/how-to-control-your-air-conditioner-with-raspberry-pi-board-and-anavi-infrared-phat/. Then, I had to update the lircd.conf file with the gap value that I had obtained in the past using irrecord (see my log posted earlier). The gap value was 78301 us. |
This comment has been minimized.
This comment has been minimized.
electron1979
commented
Feb 25, 2018
•
I used that, too! Just had to remove the trailing "large value" from every command, as well as the large one near the beginning. |
This comment has been minimized.
This comment has been minimized.
dretful
commented
Feb 26, 2018
Richard210363 was right. Thank you. |
This comment has been minimized.
This comment has been minimized.
kdpatino
commented
Mar 2, 2018
•
Hello! Do you know if it could work in GPIO16=IN and GPIO13=OUT? I'm testing with these pins and it not work for me |
This comment has been minimized.
This comment has been minimized.
kdpatino
commented
Mar 5, 2018
Just to Update. Thank You! I followed it and works on my MATRIX Creator Thank You!!! |
This comment has been minimized.
This comment has been minimized.
luyge
commented
Mar 28, 2018
Tks my friend. |
This comment has been minimized.
This comment has been minimized.
mcblacky
commented
Mar 31, 2018
•
For lircd 0.9.4c Rpi3 with PiFi DAC+ v2.0 and Humax RM-F04 remote Install lirc Download the index from the remote repository Find your remote Download your remote Copy your remote Change etc/lirc/lircd.conf/lirc_options.conf Restart lirc deamon Check your remote with command With pressing remote Vol-Up output should be like this: |
This comment has been minimized.
This comment has been minimized.
null-loop
commented
Apr 14, 2018
Just wanted to echo other peoples comments - best description of how to get everything setup I've found. Thank you for your efforts. |
This comment has been minimized.
This comment has been minimized.
markusamuel
commented
Apr 14, 2018
Thanks a lot ! I was having a rough time making this work on RPi |
This comment has been minimized.
This comment has been minimized.
LachlanHogan
commented
May 2, 2018
•
Anyone else using Raspbian Stretch that runs into the error:
After I removed the right hand codes from my |
This comment has been minimized.
This comment has been minimized.
sfsdfd
commented
Jun 4, 2018
•
This instruction set doesn't appear to be working. After stopping and starting lircd, I get this:
|
This comment has been minimized.
This comment has been minimized.
superiuspi
commented
Jun 8, 2018
Hello there ! |
This comment has been minimized.
This comment has been minimized.
barustnt
commented
Jul 6, 2018
hi |
This comment has been minimized.
This comment has been minimized.
TSM-EVO
commented
Jul 19, 2018
Can you go a step further and try to get lirc_web working as well? I am trying to get it working, but right now, it's not finding my remote. I need to use it to send the IR commands to my A/C. lirc is working and I can use irsend SEND_ONCE to send a keypress, but lirc_web doesn't find my remote. Any help is appreciated. |
This comment has been minimized.
This comment has been minimized.
adin283
commented
Aug 9, 2018
@unnamalai-kb |
This comment has been minimized.
This comment has been minimized.
barneyman
commented
Aug 18, 2018
thank you for doing this - i appreciate it. |
This comment has been minimized.
This comment has been minimized.
j00sef
commented
Aug 30, 2018
If anyone is having trouble with this guide as I have since it seems to be more suited to ver 0.9.0. I have found another guide that is intended to help you setup lirc's latest version(0.9.4c) with raspbian stretch. Here is the link https://github.com/mtraver/rpi-ir-remote. It worked for me hopefully it'll clarify some of your problems. |
This comment has been minimized.
This comment has been minimized.
m1r05l4v
commented
Oct 8, 2018
In case some run into same problems with new Stretch and LIRC 0.9.4c. This is how I have made work Above LIRC setup was not working for me. Some helpful tips I have found in first post I run setup as explained and it worked. RECORD Could not open new config file /home/user/lircd.conf in order to solve this I used sudo irrecord --driver default --device /dev/lirc0 ~/lircd.conf so steps are sudo /etc/init.d/lircd stop follow steps Check your remote with command here it should recognise your buttons and file name |
This comment has been minimized.
This comment has been minimized.
hG3n
commented
Dec 5, 2018
•
Thanks man! Setting this up drove me crazy. |
This comment has been minimized.
This comment has been minimized.
Matze2018
commented
Dec 10, 2018
Hello, i want to use lirc with a raspberry BUT not with the gpio. |
This comment has been minimized.
This comment has been minimized.
charlieskc
commented
Feb 24, 2019
mine still no luck... |
This comment has been minimized.
This comment has been minimized.
rogue45
commented
Feb 26, 2019
Thanks! This was a super helpful reference. |
This comment has been minimized.
This comment has been minimized.
Loopback59
commented
Apr 12, 2019
Great! Worked at my old Pi A (Stretch) too. |
This comment has been minimized.
This comment has been minimized.
drstil
commented
Apr 17, 2019
•
Thank you for this nice reference! I'm using a Raspberry PI 3 and set up everything as written above. I'm using a TSOP34836 IR receiver. When I start receiving data with "mode2 -d /dev/lirc0" I got a lot of data input: Do you have any idea what could be wrong or what I cloud try? Do you need more information? Thank you for your help and best! EDIT: |
This comment has been minimized.
This comment has been minimized.
drstil
commented
Apr 19, 2019
I tried without settings in /etc/modules and it did also work. Any idea for what you need the settings in /etc/modules, cloud we ignore them? |
This comment has been minimized.
This comment has been minimized.
johanvanl
commented
Apr 23, 2019
Thanks a lot to everyone for the info above. Having struggled to get lirc working. The solution mcblacky posted did the trick for me. One thing I had problems with was after restarting the Pi the solution stopped working. Irw only responded to some of the keys on my keyboard. Where I now have the following commands in my rc.local file for my solution to work after a boot: sleep 30s Why would lirc need to be stopped and started before working? Thanks |
This comment has been minimized.
This comment has been minimized.
knowblesse
commented
Jul 27, 2019
•
######### For users using kernel version 4.19+ ###########
|
This comment has been minimized.
This comment has been minimized.
mst94
commented
Jul 29, 2019
•
hello, my kernel is 4.19.58 on raspbian 10 buster.
The created configuration file has except for the name, gap and frequency everywhere 0 or 0x0. For the created key-codes as well, so it is useless. Does somebody have a glue? Thanks a lot |
This comment has been minimized.
This comment has been minimized.
essieM
commented
Jul 31, 2019
I'm having the exact same issue as you @mst94. Any luck with finding a solution? |
This comment has been minimized.
This comment has been minimized.
mst94
commented
Jul 31, 2019
Hi, unfortunately I am still searching for a solution to this problem... I will post a solution here when I am lucky! |
This comment has been minimized.
This comment has been minimized.
mst94
commented
Aug 3, 2019
Removing LIRC and reinstalling it with this guide made it working! https://github.com/AnaviTechnology/anavi-docs/blob/master/anavi-infrared-phat/anavi-infrared-phat.md#setting-up-lirc I hope it will work for you as well. |
This comment has been minimized.
This comment has been minimized.
essieM
commented
Aug 5, 2019
Thanks @mst94. I was able to get it working as well.. |
This comment has been minimized.
This comment has been minimized.
Ogg3l
commented
Oct 10, 2019
I have the same issue. Which raspberry pi Version and which Kernel Version do you use? I tried to Set it up with the tutorial. Maybe the ir receiver is the Problem? Which ir receiver do you use? |
This comment has been minimized.
This comment has been minimized.
mst94
commented
Oct 16, 2019
Hi, take a look above: "Kernel is 4.19.58 on raspbian 10 buster". I am using "TSOP31238 Integrated IR receiver 38kHz 45° VISHAY TELEFUNKEN", ordered from Amazon. |
This comment has been minimized.
Richard210363 commentedNov 12, 2017
This is the only place amongst the many I have looked at that is both carefully written and laid out, and works.
Well Done and thanks