loading

Introduction

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.

Scope

This instructable will show how to use irw program to verify and debug why LIRC clients don't respond as expected.

Target Readers

Anyone 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.

<p>Hi Mirza,</p><p>Not sure if you can help me to debug a problem that I have after installing <br>lirc in my Raspbery pi. I checked your above. It works fine. When I press a key <br>from remote it output some as follow.</p><p>0000000000ff4ab5 00 key_0 /home/pi/lircd.conf</p><p>which I think is correct.</p><p>Fyi, I configured lirc following this url.</p><p><a href="http://ozzmaker.com/2013/10/24/how-to-control-the-gpio-on-a-raspberry-pi-with-an-ir-remote/" rel="nofollow">http://ozzmaker.com/2013/10/24/how-to-control-the-...</a></p><p>I want to use IR by a python program I created.</p><p>The python code is as follows</p><p>--------------------------------------------------------</p><p>import lirc</p><p>sockid = lirc.init(&quot;ir_test3, blocking = False)</p><p>codeir = lirc.nextcode() </p><p>print codeir # test point 1</p><p>if codeir:</p><p>if codeir[0] == 'ONE':</p><p>print ONE # test point 2</p><p>--------------------------------------------------------------</p><p>the lircrc is as follows</p><p>--------------------------------------------------</p><p>begin</p><p>button = key_1</p><p>program = ir_test3</p><p>config = ONE</p><p>end</p><p>------------------------------------------------</p><p>I ran the ir_test3 python and then I expected if I press key_1 of the remote <br>it to goto lircrc and look for key_1 and come back to ir_test3 and print ONE.</p><p>But it prints [] which I assume NULL. That is from test point 1 of ir_test3. <br>It never goes to test point 2</p><p>Could you please help to troubleshoot what went wrong.?</p><p>Regards</p><p>Ziath Nazoordeen</p>

About This Instructable

2,441views

9favorites

Bio: Systems Administrator and Software Programmer.
More by mirza irwan osman:Install Modem USB Device in Raspberry Pi Make the Volume Knob of Sound Blaster X-Fi Surround 5.1 Pro Sound Card Work in Raspberry Pi Create a Volume Control for USB Sound Card in Raspberry Pi 
Add instructable to: