|
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
- mount -o remount,rw /system
Copy code 3. download files from mega to location /sdcard/Download/
4 create dir
5. copy files download from mega to to /etc/lircd/- cp /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
Copy code 6. add execute attributes
- chmod 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
Copy code 7. check is module loaded
result
- sunxi_ir_rx 9154 0 - Live 0x00000000
Copy code 8. find IR event driver
- cat /proc/bus/input/devices
Copy code result
- I: 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
Copy code 9. test driver
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):
- ...
- Event code 254 (?)
- Event code 255 (?)
- Event type 20 (Repeat)
- Testing ... (interrupt to exit)
- Event: time 1444933051.375784, -------------- Report Sync ------------
Copy code
9. reload sunxi_ir_rx module- rmmod sunxi_ir_rx
- insmod /system/vendor/modules/sunxi-ir-rx.ko
Copy code
again check again is module loaded
result
- sunxi_ir_rx 9154 0 - Live 0x00000000
Copy code 10. check again driver,
- cat /proc/bus/input/devices
Copy code result, ensure it still event3
- I: 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
Copy code 11. test event again
result (pressing any key on yout IR remote, should add line with Event)
- ...
- 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 ------------
Copy code it works, but still need some configurations ...
12. now record your IR remote,
- /system/bin/irrecord -H devinput -d name=sunxi-ir /etc/lircd/lircd.conf
Copy code You can see allowed key names with
Check /etc/lircd/lircd.conf, if your key codes are doubled like
- begin codes
- KEY_0 0x0100FF00000001 0x00000000000000
- KEY_1 0x01000100000001 0x00000000000000
- end codes
Copy code edit /etc/lircd/lircd.confand manually remove the second code part (0x00000000000000)
result:
- begin codes
- KEY_0 0x0100FF00000001
- KEY_1 0x01000100000001
- end codes
Copy code 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)
- begin remote
- name devinput
Copy code Especially record keys like:
KEY_DOWN, KEY_UP, KEY_LEF, KEY_ENTER, KEY_BACK
13. Test
run lirc daemon
- /system/bin/start_lirc.sh
Copy code run irw and press some keys (recorded, definded in/etc/lircd/lircd.conf) on your remote:
- /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
Copy code 14. Enjoy - SUCCESS : LIRC is working fine !
now you can control yout android apps and especially Kodi with yout IR remote control
15. to stop daemon:
|
|