首页 > 解决方案 > 如何创建 LIRC 配置文件?

问题描述

我正在尝试使用 Linux Infrared Remote Control LIRC 库来记录来自遥控器的自定义信号并将其保存在文件中。然后,当我运行 test ir rx 时,我将使用这些信号通过 ir tx 使用 raspberry pi 再次将其发送回来mode2 -d /dev/lirc1,输出看起来不错。

Using driver default on device /dev/lirc1
Trying device: /dev/lirc1
Using device: /dev/lirc1
space 16777215
pulse 9044
space 4463
pulse 601
space 1641
pulse 628
space 532
pulse 575
space 558
pulse 577
space 530
pulse 603

但是当我打开 /etc/lirc/lircd.conf文件时,会发生这种情况:

# Type of device controlled
#     (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:

begin remote

 name  fan
 bits            0
 flags CONST_LENGTH
 eps             0
 aeps            0

 one             0     0
 zero            0     0
 gap          50000
 toggle_bit_mask 0x0
 frequency    38000

     begin codes
         KEY_POWER                0x0
         KEY_0                    0x0
         KEY_1                    0x0
     end codes

end remote

所有保存的键都是零,那么我该如何解决这个问题呢?

标签: linuxraspbianlirc

解决方案


我建议您先声明发送器 GPIO 引脚,然后再声明接收器

像这样:dtoverlay=gpio-ir-tx,gpio_pin=17 dtoverlay=gpio-ir,gpio_pin=18

我会仔细检查 /etc/lirc/lirc_options.conf 因为 TeeJay 建议这解决了我在 raspberrypi 3+ 上的问题


推荐阅读