如何使用 2ms 计时而不是默认 5ms 的不记录? [英] How to use irrecord with 2ms timing instead of the default 5ms?
问题描述
我正在尝试在我的 Raspberry Pi 上教我的热泵远程代码 - 三菱电机 MSZ-GE60VA(远程是 SG10A 1833)
I'm trying to teach lirc on my Raspberry Pi the remote-codes for my heat pump - a Mitsubishi Electric MSZ-GE60VA (remote is SG10A 1833)
我按如下方式运行记录:
I run irrecord as follows:
sudo /etc/init.d/lirc stop
irrecord -d /dev/lirc0 heatpump
我习惯于按按钮等操作,并适时地这样做.
I get the usual cruft about pushing buttons, etc, and duly do so.
在几个点(并不总是相同的数字)之后,记录错误信息如下:
After several dots (not always the same number), irrecord bails with the following error message:
irrecord: could not find gap.
irrecord: gap not found, can't continue
现在,我在其他地方发现采样率可能是错误的,并使用 xmode2 查看波形 - 我已经这样做了.我敢肯定,如果我能像 xmode2 那样更快地获得不记录的采样,我会更幸运.
Now, I've found elsewhere that the sample rate might be wrong, and to look at the waveform using xmode2 - which I've done. I'm pretty sure I'd have more luck if I could get irrecord to sample faster, as xmode2 can.
有什么想法吗?(注意:我也使用了强制选项,没有区别)
Any ideas? (NB: I've run with the force option too, and no difference)
这是我使用 xmode2 的结果 - 您可以看到 5 毫秒的样本无法真正使信号出现正面或反面,但 2 毫秒的样本可以.
Here are my results using xmode2 - you can see the 5ms sample can't really make heads or tails of the signal, but the 2ms sample can.
5ms 示例 http://jnawk.net.nz/5ms.png 5ms 示例(默认)
5ms sample http://jnawk.net.nz/5ms.png 5ms sample (default)
2ms 示例 http://jnawk.net.nz/2ms.png 2ms 示例
推荐答案
首先尝试使用
irrecord -f -d /dev/lirc0 ~/lirc.conf
-f 将强制使用原始模式.如果你很幸运,会生成配置文件或列出差距.
-f will force the raw mode. If you're lucky that will generate the config file or at list the gap.
否则,启动下面的命令并 ctrl^c 停止转义/停止录制.
Otherwise, launch the command below and ctrl^c to stop escape / stop recording.
mode2 -m -d /dev/lirc0 > ~/lirc.conf
-m 选项应生成格式化的原始数据.删除第一个值,即按下远程按钮之前的延迟.
the -m option should generate formated raws. remove the first value which is the delay before you pressed the remote button.
如果您不使用 -m 选项,您可以使用 VI 来实现.
if you don't use the -m option you can do it with VI.
vim ~/lirc.conf
:%s/^.{5}
:%s!^! !
:%s/
/
完成 ~/lirc.conf 文件以获得如下内容:
complete the ~/lirc.conf file to obtain something like :
begin remote
name MY_REMOTE
flags RAW_CODES
eps 30
aeps 100
frequency 38000
# note ensure the modulation frequency above correctly matches your remote, default is set to 38kHz
# you can also try other common frequencies (36000,40000,56000) if you are unsure
begin raw_codes
name MY_TEST
...<<PUT THE RAW CODE HERE >>...
end raw_codes
end remote
没有 TAB,文件中只有空格.
No TAB, only spaces in the file.
备份原始的 lircd.conf 文件
Make a backup of the original lircd.conf file
sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd_original.conf
复制您的新配置文件
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
再次启动lirc
sudo /etc/init.d/lirc start
试试看
irsend SEND_ONCE MY_REMOTE MY_TEST
使用手机摄像头检查 LED 是否亮起.
check with your phone camera the led is lighting.
这对某些人有效...
这篇关于如何使用 2ms 计时而不是默认 5ms 的不记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!