|  | 
 
| Edited by darqoq at 2015-10-23 16:47 
 Hi!
 Now, you can control your android and apps liked Kodi using IR Remote Control
 
 1. Tested on Orange Pi PC
 2. Tested on loboris images (http://www.orangepi.org/orangepi ... =363&extra=page%3D1)
 3. based on https://github.com/cubieplayer/Cubian/issues/75
 
 Scenario:
 1. run Terminal Emulator app
 2. run su
 3. remount /system
 
 3. download files from mega to location /sdcard/Download/Copy codemount -o remount,rw /system
4 create dir
 5. copy files download from mega to to /etc/lircd/
 6. add execute attributesCopy codecp /sdcard/Download/evtest /system/bin/
cp /sdcard/Download/lircd /system/bin/lircd
cp /sdcard/Download/irw /system/bin/irw
cp /sdcard/Download/irrecord /system/bin/irrecord
cp /sdcard/Download/start_lircd.sh /system/bin/start_lircd.sh
cp /sdcard/Download/stop_lircd.sh /system/bin/stop_lircd.sh
 7. check is module loadedCopy codechmod a+x /system/bin/evtest
chmod a+x /system/bin/lircd
chmod a+x /system/bin/irw
chmod a+x /system/bin/irrecord
chmod a+x /system/bin/start_lircd.sh
result
 
 8. find IR event driverCopy codesunxi_ir_rx 9154 0 - Live 0x00000000
 resultCopy codecat /proc/bus/input/devices
 9. test driverCopy codeI: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-ir"
P: Phys=RemoteIR/input1
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=sysrq kbd event3 cpufreq_interactive
B: PROP=0
B: EV=100003
B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe
8. [you can skip this step it is only information]
 something wrong is with this module sunxi_ir_rx need to be reloaded
 because at the first time evtest shows result and hungs (pressing any key on yout IR remote, should add last line):
 
 Copy code...
    Event code 254 (?)
    Event code 255 (?)
    Event type 20 (Repeat)
Testing ... (interrupt to exit)
Event: time 1444933051.375784, -------------- Report Sync ------------
 9. reload sunxi_ir_rx  module
 Copy codermmod sunxi_ir_rx
insmod /system/vendor/modules/sunxi-ir-rx.ko
again check again is module loaded
 result
 
 10. check again driver,Copy codesunxi_ir_rx 9154 0 - Live 0x00000000
 result, ensure it still event3Copy codecat /proc/bus/input/devices
 11. test event againCopy codeI: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-ir"
P: Phys=RemoteIR/input1
S: Sysfs=/devices/virtual/input/input5
U: Uniq=
H: Handlers=sysrq kbd event3 cpufreq_interactive
B: PROP=0
B: EV=100003
B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe
result (pressing any key on yout IR remote, should add line with Event)
 
 it works, but still need some configurations ...Copy code...
    Event code 255 (?)
  Event type 20 (Repeat)
Testing ... (interrupt to exit)
Event: time 1444933164.078062, type 1 (Key), code 123 (Hanja), value 1
Event: time 1444933164.078073, -------------- Report Sync ------------
Event: time 1444933164.276381, type 1 (Key), code 123 (Hanja), value 0
Event: time 1444933164.276389, -------------- Report Sync ------------
Event: time 1444933164.477201, type 1 (Key), code 123 (Hanja), value 1
Event: time 1444933164.477211, -------------- Report Sync ------------
Event: time 1444933164.676388, type 1 (Key), code 123 (Hanja), value 0
Event: time 1444933164.676396, -------------- Report Sync ------------
12. now record your IR remote,
 
 You can see allowed key names withCopy code/system/bin/irrecord -H devinput -d name=sunxi-ir /etc/lircd/lircd.conf
Check /etc/lircd/lircd.conf, if your key codes are doubled like
 
 edit /etc/lircd/lircd.confand manually remove the second code part (0x00000000000000)Copy codebegin codes
        KEY_0                    0x0100FF00000001 0x00000000000000
        KEY_1                    0x01000100000001 0x00000000000000
      end codes
result:
 
 edit /etc/lircd/lircd.conf and change the 'name' from lircd.conf  to devinput or linux-input-layer  (this remote names are predefined in Kodi configuration)Copy codebegin codes
         KEY_0                    0x0100FF00000001
         KEY_1                    0x01000100000001
      end codes
 Especially record keys like:Copy codebegin remote
    name  devinput
KEY_DOWN, KEY_UP, KEY_LEF, KEY_ENTER, KEY_BACK
 13. Test
 run lirc daemon
 
 run irw and press some keys (recorded, definded in/etc/lircd/lircd.conf) on your remote:Copy code/system/bin/start_lirc.sh
 14. Enjoy - SUCCESS : LIRC is working fine !Copy code/system/bin/irw /dev/lircd
000100c300000001 00 KEY_OK myremote
000100c500000001 00 KEY_DOWN myremote
000100a800000001 00 KEY_KPPLUS myremote
000100a000000001 00 KEY_POWER myremote
0001000800000001 00 KEY_8 myremote
0001000100000001 00 KEY_1 myremote
0001000600000001 00 KEY_6 myremote
now you can control yout android apps and especially  Kodi with yout IR remote control
 15. to stop daemon:
 
 
 
 
 | 
 |