Discussion

How to use IR in Linux

21 13856
The sunxi-3.4 IR is exposed as a a keyboard on the Linux input device interface. For example, the following simple keybinder application might be used to run arbitrary commands when receiving a specific keycode via IR. You can install it by :

$ git clone https://bitbucket.org/emiliolopez/keybinder.git
$ cd keybinder
$ sudo make install

Configuration is handled on /etc/keybinder.conf, as a "keycode,command" pair per line. The application prints every keycode received, so you may as well use it to figure out the keycodes you want to use.
To execute the application, run :

$ sudo keybinder /dev/input/event0
fbordeu  
Hi I trying to use the IR sensor with bananian but it does not work.

my dmesg show this :

...
[    2.347570] try to request ir_para gpio failed
[    2.352464] input: sunxi-ir as /devices/virtual/input/input0
[    2.359659] IR Initial OK
...
I think the installation is ok but the keybinder program does not do anything.

Any ideas???
So what kind of remote control I use (I'm trying with my TV remote control)???  

thanks,

hello~~
i have the same problem here

my dmsg shown:
input: sunxi-ir as /devices/virtual/input/input0
IR Initial OK

I think the driver is loaded
(but not shown in lsmod )

and when I run keybinder /dev/input/event0 using root
then press my control button
there not do anything

what step I missing?

You must first verify whether "/dev/input/event0" actually refers to the ir character device.
  1. ls /sys/devices/virtual/input/input0
Copy the Code
see which char device is listed by the above command...is it "event0" or some other?

fbordeu  
hi, this is the output

fbordeu@bpi1:~$ ls -l /dev/input/event0
crw------- 1 root root 13, 64 août  25 20:33 /dev/input/event0

fbordeu@bpi1:~$ ls /sys/devices/virtual/input/input0
capabilities  event0  id  modalias  name  phys  power  properties  subsystem  uevent  uniq

any ideas

Post Last Edited by sashijoseph at 2014-8-26 09:01

Post Last Edited by sashijoseph at 2014-8-26 08:56

so the event0 char device is ok.

the script.bin entry [ir_para] has a mistake.
If you haven't already,change the line
ir_rx = port:PB04<2><default><default><default>
to
ir0_rx = port:PB04<2><default><default><default>

or else use the attached script.bin
(I was using a custom script.bin from an earlier distro...don't know if the current script,bin also has the error )

then you could do a "sudo cat /dev/input/event0" to see if key-presses are detected.
or else use the keybinder application.

script.tar.gz

8.57 KB, Downloads: 208

which infrared remotes does the driver support? (ie which remote control code set)

fbordeu  
ok, I have the script.bin but where do I put it.

Post Last Edited by sashijoseph at 2014-8-27 00:29

@Mikronauts
afaik it decodes only NEC.

Reply 8# fbordeu

The first partition of your sdcard contains the script.bin

You have to log in before you can reply Login | Sign Up

Points Rules