Verify and Debug Linux Infrared Remote Control (LIRC) Daemon Configurations
Intro: Verify and Debug Linux Infrared Remote Control (LIRC) Daemon Configurations
After training LIRC daemon to recognise the signals of my infrared (IR) remote control unit and configuring LIRC client to respond accordingly, sometimes stuff didn't happen as expected when you click on the IR remote control unit.
irw program can be used to verify and debug why LIRC clients don't respond as expected. The program "irw" is a type of LIRC client and it is provided by LIRC package.
ScopeThis instructable will show how to use irw program to verify and debug why LIRC clients don't respond as expected.
Target ReadersAnyone with a Raspberry Pi running on RaspbianOS
STEP 1: Verify the Mapping of Button Click to LIRC Event
Open terminal emulator in Raspberry Pi
$sudo service lirc start $irw<br>
Point the infrared remote control unit at the Raspberry Pi.
Click a button or buttons.
irw will display IR codes and its mapped LIRC events as shown in the screenshot
Open another terminal emulator in Raspberry Pi
Open the LIRC daemon configuration as shown in the screenshot
vi /etc/lirc/lircd.conf
Compare the entries in /etc/lirc/lircd.conf with the output of program irw
The program irw will display the LIRC event (KEY_STOP, KEY_RESTART) that corresponds to the IR code sent by the remote control unit, /etc/.lirc/lircd
Verify that this LIRC event matches what you or the LIRC client is expecting.
Comments
ziath 8 years ago
Hi Mirza,
Not sure if you can help me to debug a problem that I have after installing
lirc in my Raspbery pi. I checked your above. It works fine. When I press a key
from remote it output some as follow.
0000000000ff4ab5 00 key_0 /home/pi/lircd.conf
which I think is correct.
Fyi, I configured lirc following this url.
http://ozzmaker.com/2013/10/24/how-to-control-the-...
I want to use IR by a python program I created.
The python code is as follows
--------------------------------------------------------
import lirc
sockid = lirc.init("ir_test3, blocking = False)
codeir = lirc.nextcode()
print codeir # test point 1
if codeir:
if codeir[0] == 'ONE':
print ONE # test point 2
--------------------------------------------------------------
the lircrc is as follows
--------------------------------------------------
begin
button = key_1
program = ir_test3
config = ONE
end
------------------------------------------------
I ran the ir_test3 python and then I expected if I press key_1 of the remote
it to goto lircrc and look for key_1 and come back to ir_test3 and print ONE.
But it prints [] which I assume NULL. That is from test point 1 of ir_test3.
It never goes to test point 2
Could you please help to troubleshoot what went wrong.?
Regards
Ziath Nazoordeen