No, your RS component is working fine, it's just that you have configured the LIRC driver and test it if it work. You got:
$ mode2 -d /dev/lirc0
space 4813301
pulse 1700
space 640287
pulse 1652
...
It means that it's working.
The next step is to configure the remote controller before test it with the irw command. Use irrecord as below to generate the remote controller config file, and follow instructions given to you:
Note: It will ask you for the button name, you should use predefined key names, this link can help:
New LIRC Name Space
$ irrecord -d /dev/lirc0 ~/out.conf
Once finished, check the generated file content using a text editor like nano:
$ nano ~/out.conf
The file content should be something like:
# 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 Sun Nov 8 17:32:03 2015
#
# contributed by
#
# brand:
# model no. of remote control:
# devices being controlled by this remote:
#
begin remote
name LG_P-020B_VCR
bits 16
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 8945 4476
one 555 1676
zero 555 561
ptrail 549
repeat 8945 2249
pre_data_bits 16
pre_data 0x7689
gap 107554
toggle_bit_mask 0x0
begin codes
KEY_POWER 0x28D7
KEY_EJECTCD 0x00FF
KEY_MENU 0x6897
KEY_OK 0x718E
KEY_LEFT 0xC13E
KEY_RIGHT 0x09F6
KEY_PLAY 0x10EF
KEY_STOP 0x807F
KEY_REWIND 0x40BF
KEY_FORWARD 0xC03F
KEY_RECORD 0x906F
KEY_SLOW 0x12ED
KEY_VOLUMEUP 0x22DD
KEY_VOLUMEDOWN 0xA25D
KEY_INFO 0xF50A
KEY_AGAIN 0xD02F
end codes
end remote
Now copy this file to /etc/lirc/lircd.conf, and don't worry about the existant file, it's an empty file:
$ sudo cp ~/out.conf /etc/lirc/lircd.conf
Then restart the lirc service:
$ sudo /etc/init.d/lirc restart
Finally, you can use irw to check your remote controller:
irw
00000000768928d7 00 KEY_POWER
00000000768900ff 00 KEY_EJECTCD
00000000768900ff 00 KEY_EJECTCD
000000007689718e 00 KEY_OK
000000007689718e 01 KEY_OK
...
The remote controller configuration is done, and LIRC associate buttons to a namespaces.
You should also know that to use the remote controller to control something you should use irexec command and this is how things should be done.
First use a test editor to write the script that should associate namespaces to actions it should be the ~/.lircrc:
$ nano ~/.lircrc
Insert this content:
begin
prog = irexec # YOUR PROGRAM NAME CAN BE ANYTHING
button = KEY_1 # The namespace of the key to use
config = echo "You pressed one" # The command to execute
repeat = 0
end
begin
prog = myprogram # ANOTHER PROGRAM NAME CAN BE ANYTHING
button = KEY_2 # The namespace of the key to use
config = echo "You pressed two" # The command to execute
repeat = 0
end
Save the file, then use irexec command to make magic happen:
$ irexec
Hope that helps.