IR receiver Orange Pi PC
System
Debian_wheezy_mini I draw your attention, I execute all commands from
root 'but.
Initially, after installing the system, the IR device is not available, since the corresponding modules are not loaded, in the case of the Orange Pi PC it is a module
sunxi_ir_rx Come on / etc / edit the "modules" file
add lines:
gpio-sunxi
sunxi-ir-rxapt-get update && sudo apt-get upgrade reboot
reboot Checking module loading
sunxi-ir-rx by team
lsmod root @ OrangePI: ~ # lsmod
Module Size Used by
sunxi_ir_rx 6793 0
gpio_sunxi 8233 0
8189es 887631 0
rt2800usb 13648 0
rt2x00usb 8311 1 rt2800usb
rt2800lib 42390 1 rt2800usb
rt2x00lib 32107 3 rt2x00usb, rt2800lib, rt2800usb
mac80211 331125 3 rt2x00lib, rt2x00usb, rt2800lib
root @ OrangePI: ~ #
Also an important factor to make sure that everything worked, you need to check whether the input device appeared:
cat / proc / bus / input / devices root @ OrangePI: ~ # cat / proc / bus / input / devices
I: Bus = 0019 Vendor = 0002 Product = 0001 Version = 0100
N: Name = "vmouse"
P: Phys = vmouse / input0
S: Sysfs = / devices / virtual / input / input0
U: Uniq =
H: Handlers = mouse0 event0
B: PROP = 0
B: EV = 7
B: KEY = 70400 0 0 0 0 0 0 0 0
B: REL = 143
I: Bus = 0019 Vendor = 0001 Product = 0001 Version = 0100
N: Name = "sunxi-ths"
P: Phys = sunxiths / input0
S: Sysfs = / devices / virtual / input / input1
U: Uniq =
H: Handlers = event1
B: PROP = 0
B: EV = 9
B: ABS = 100 0
I: Bus = 0019 Vendor = 0001 Product = 0001 Version = 0100
N: Name = "sunxi-ir"
P: Phys = RemoteIR / input1
S: Sysfs = / devices / virtual / input / input2
U: Uniq =
H: Handlers = sysrq kbd event2 cpufreq_interactive
B: PROP = 0
B: EV = 100003
B: KEY ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
root @ OrangePI: ~ #
Name = "sunxi-ir" - / dev / input / event2 in my case this is event2
the surest way to check whether this device is to do it
cat / dev / input / event2 | hexdump When you click on the remote control buttons in the terminal we see
root @ OrangePI: ~ # cat / dev / input / event2 | hexdump
0000000 0349 5618 2b44 0004 0001 0040 0001 0000
0000010 0349 5618 2b53 0004 0000 0000 0000 0000
0000020 0349 5618 dc05 0007 0001 0040 0000 0000
0000030 0349 5618 dc0c 0007 0000 0000 0000 0000
0000040 034c 5618 026e 0009 0001 0043 0001 0000
0000050 034c 5618 027c 0009 0000 0000 0000 0000
0000060 034c 5618 be07 000c 0001 0043 0000 0000
0000070 034c 5618 be0d 000c 0000 0000 0000 0000
^ C
root @ OrangePI: ~ #
(Stop the process can be [Ctrl] + [C])
Compile a daemon that will monitor clicks.
apt-get install build-essential git -y
git clonehttps://github.com/elopez/keybinder.git
cd keybinder
make install check
run
keybinder / dev / input / event2 and click on the remote buttons
root @ OrangePI: ~ / keybinder # keybinder / dev / input / event2
Reading key input from / dev / input / event2 (sunxi-ir)
Loaded config items
Keycode 69 pressed
Keycode 64 pressed
Keycode 67 pressed
...............................................
Let's go / etc / rule keybinder.conf
69, reboot
64, echo 0>/ sys / class / gpio_sw / normal_led / data
67, echo 1>/ sys / class / gpio_sw / normal_led / data
.....................................................................When you press the button of the remote control with the code 67, the red LED on the board turns on
For autorun after reboot
Let's go / etc / rule rc.local ...................
to the exit line
add row
/ usr / local / bin / keybinder / dev / input / event2>/ dev / null &reboot
reboot tested with similar remotes
Post has been editedIlya Putilo - 16.02.17, 18:57