Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 14290|Reply: 7

IR receiver not working

[Copy link]

1

Threads

3

Posts

22

Credits

Novice

Rank: 1

Credits
22
Post time 2016-3-20 19:45:54 | Show all posts |Read mode
I am trying IR reciver but I can not get it working.
I've followed instructions on https://github.com/cubieplayer/Cubian/issues/75 and http://www.orangepi.org/orangepi ... &extra=page%3D1

I have not any response with evtest.

My system configuration is:


Sistema: Armbian Jessie Armbian_5.05_Orangepih3_Debian_jessie_3.4.110_desktop

lsmod

Module                  Size  Used by
sunxi_ir_rx             6206  0
mali_drm                2728  1
drm                   175264  2 mali_drm
mali                  123897  0
ump                    29339  3 mali
gpio_sunxi              8253  0
8189es                896688  0


cat < /proc/bus/input/devices

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-gpiokey"
P: Phys=sunxikbd/input0
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=kbd event1 cpufreq_interactive
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-ths"
P: Phys=sunxiths/input0
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=event2
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/input3
U: Uniq=
H: Handlers=sysrq rfkill kbd event3 cpufreq_interactive
B: PROP=0
B: EV=100003
B: KEY=ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe



cat < /etc/lirc/hardware.conf
# Cubietruck automatic lirc device detection by Igor Pecovnik
str=$(cat /proc/bus/input/devices | grep "H: Handlers=sysrq rfkill kbd event" | awk '{print $(NF)}')
sed -i 's/DEVICE="\/dev\/input.*/DEVICE="\/dev\/input\/'$str'"/g' /etc/lirc/hardware.conf
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Don't start irexec, even if a good config file seems to exist.
#START_IREXEC=false

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="devinput"
# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/input/event3"
MODULES=""

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""



Salida de evtest

evtest /dev/input/event3
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "sunxi-ir"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    Event code 4 (KEY_3) ........
    Event code 250 (?)
    Event code 251 (?)
    Event code 252 (?)
    Event code 253 (?)
    Event code 254 (?)
    Event code 255 (?)
Key repeat handling:
  Repeat type 20 (EV_REP)
    Repeat code 0 (REP_DELAY)
      Value    280
    Repeat code 1 (REP_PERIOD)
      Value     40
Properties:
Testing ... (interrupt to exit)
^C

3

Threads

165

Posts

1203

Credits

Gold member

Rank: 6Rank: 6

Credits
1203
Post time 2016-3-20 21:33:11 | Show all posts
Edited by Dima at 2016-3-20 21:37

Have you tried reloading the sunxi-ir driver?
Also: could be that the remote is incompatible. Don't know which driver is used in armbian. In first builds of OpenELEC (and Android, still now), only a few remotes actually worked. While most of the remotes didn't do anything! With new implementation almost every remote works though.

1

Threads

3

Posts

22

Credits

Novice

Rank: 1

Credits
22
 Author| Post time 2016-3-21 19:36:01 | Show all posts
Thanks.
Finally it's working. I've removed sunxi-ir-rx module and install sunxi-cir module as FranM suggests on http://www.orangepi.org/orangepi ... &extra=page%3D5.

1

Threads

7

Posts

41

Credits

Novice

Rank: 1

Credits
41
Post time 2016-4-5 17:20:47 | Show all posts
Hello, I'm using Armbian for Pi Plus H3 (on my OPi Plus 2) and when I use command lsmod I get:
Module: mali_drm, drm, mali, ump, 8189es. No sunxi-ir-rx. Why? How to fix it?

2

Threads

16

Posts

203

Credits

Intermediate member

Rank: 3Rank: 3

Credits
203
Post time 2016-4-5 18:07:45 | Show all posts
Use following command:
  1. sudo modprobe sunxi-cir
Copy the Code

Do not load sunxi-ir-rx, it's not working well.

1

Threads

7

Posts

41

Credits

Novice

Rank: 1

Credits
41
Post time 2016-4-5 20:39:47 | Show all posts
Edited by osator at 2016-4-6 15:49

Now it's working but how can I record the keys from remote?
After cat < /proc/bus/input/devices :
...
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="MCE IR Keyboard/Mouse (sunxi-ir)"
P: Phys=/input0
S: Sysfs=/devices/virtual/input/input7
U: Uniq=
H: Handlers=sysrq kbd mouse2 event7
B: PROP=0
B: EV=100017
B: KEY=30000 0 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: REL=3
B: MSC=10

after evtest /dev/input/event6:

orangepi@orangepiplus2:~$ sudo evtest /dev/input/event6
[sudo] password for orangepi:
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "sunxi-ir"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 152 (KEY_SCREENLOCK)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Key repeat handling:
  Repeat type 20 (EV_REP)
    Repeat code 0 (REP_DELAY)
      Value    500
    Repeat code 1 (REP_PERIOD)
      Value    125
Properties:
Testing ... (interrupt to exit)
Event: time 1459928696.216836, type 4 (EV_MSC), code 4 (MSC_SCAN), value 16
Event: time 1459928696.216843, -------------- EV_SYN ------------
Event: time 1459928697.517258, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1459928697.517265, -------------- EV_SYN ------------
Event: time 1459928698.013873, type 4 (EV_MSC), code 4 (MSC_SCAN), value 19
Event: time 1459928698.013880, -------------- EV_SYN ------------
^Corangepi@orangepiplus2:~$

remote send the code of buttons but when I tried to record it:

orangepi@orangepiplus2:~$ sudo irrecord -f -H devinput -d /dev/input/event6 my.conf

irrecord -  application for recording IR-codes for usage with lirc

Copyright (C) 1998,1999 Christoph Bartelmus(lirc@bartelmus.de)

irrecord: initializing '/dev/input/event6'
This program will record the signals from your remote control
and create a config file for lircd.


Usually it's not necessary to create a new config file for devinput
devices. A generic config file can be found at:
http://www.lirc.org/remotes/devinput/
You should try this config file before creating your own config file.

A proper config file for lircd is maybe the most vital part of this
package, so you should invest some time to create a working config
file. Although I put a good deal of effort in this program it is often
not possible to automatically recognize all features of a remote
control. Often short-comings of the receiver hardware make it nearly
impossible. If you have problems to create a config file READ THE
DOCUMENTATION of this package, especially section "Adding new remote
controls" for how to get help.

If there already is a remote control of the same brand available at
http://www.lirc.org/remotes/ you might also want to try using such a
remote as a template. The config files already contain all
parameters of the protocol used by remotes of a certain brand and
knowing these parameters makes the job of this program much
easier. There are also template files for the most common protocols
available in the remotes/generic/ directory of the source
distribution of this package. You can use a template files by
providing the path of the file as command line parameter.

Please send the finished config files to <lirc@bartelmus.de> so that I
can make them available to others. Don't forget to put all information
that you can get about the remote control in the header of the file.

Press RETURN to continue.


Hold down an arbitrary button.
.irrecord: gap not found, can't continue
irrecord: closing '/dev/input/event6'


2

Threads

16

Posts

203

Credits

Intermediate member

Rank: 3Rank: 3

Credits
203
Post time 2016-4-6 16:09:26 | Show all posts
Edited by rufik at 2016-4-6 09:12

What I've already tried after loading sunxi-ir module (and lirc installed) is:

  1. sudo mode2 -d /dev/lirc0
  2. sudo irrecord -f -d /dev/lirc0 output.conf
Copy the Code


First one is to be sure that IR is reciving signal from remote control, second one is just for creating lirc configuration file. Both command works well.

1

Threads

14

Posts

143

Credits

Registered member

Rank: 2

Credits
143
Post time 2016-4-13 01:24:01 | Show all posts
rufik replied at 2016-4-6 16:09
What I've already tried after loading sunxi-ir module (and lirc installed) is:

Have you tried irw command? I can configure the buttons with irrecord, but when I test Lirc with irw it doesn't give any output.

You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2022-5-28 17:45 GMT+8 , Processed in 0.034249 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list