Template:Linux-IR-Receiver/zh

From FriendlyELEC WiKi
Revision as of 09:47, 8 October 2018 by Tzs (Talk | contribs) (updated by API)

Jump to: navigation, search

该板子需自行在GPIOL11引脚处接上红外接收器,

注意: 以下内容仅适用于带有红外接收的板子(如NanoPi M1 / NanoPi M1 Plus / NanoPi K1 Plus等), 其他板子(如NanoPi NEO / NanoPi NEO Air / NanoPi NEO2等)则需要自行在GPIOL11引脚处接上红外接收器。
红外接收功能默认是关闭的, 可以通过npi-config使能:

$ npi-config
    6 Advanced Options     Configure advanced settings
        A8 IR              Enable/Disable IR
            ir Enable/Disable ir[enabled]

重启系统, 然后使用下列命令测试红外接收:

$ apt-get install ir-keytable
$ echo "+rc-5 +nec +rc-6 +jvc +sony +rc-5-sz +sanyo +sharp +mce_kbd +xmp" > /sys/class/rc/rc0/protocols   # 使能紅外协议
$ ir-keytable -t
Testing events. Please, press CTRL-C to abort.

ir-keytable -t用于检查是否有接收到红外信号, 使用任意遥控器发送按键信息给红外接收器, 可以看到类似下列信息:

1522404275.767215: event type EV_MSC(0x04): scancode = 0xe0e43
1522404275.767215: event type EV_SYN(0x00).
1522404278.911267: event type EV_MSC(0x04): scancode = 0xe0e42
1522404278.911267: event type EV_SYN(0x00).