如何使用2毫秒计时而不是默认5毫秒的irrecord? [英] How to use irrecord with 2ms timing instead of the default 5ms?
问题描述
我正在尝试在Raspberry Pi上教lirc我的热泵的远程代码-三菱电机MSZ-GE60VA(远程为SG10A 1833)
我按以下方式运行irrecord:
sudo /etc/init.d/lirc stop
irrecord -d /dev/lirc0 heatpump
我对按钮等一无所知,并且应该这样做.
在几个点(并非总是相同的数字)之后,irrecord失败并显示以下错误消息:
irrecord: could not find gap.
irrecord: gap not found, can't continue
现在,我在其他地方发现采样率可能是错误的,并且已经使用xmode2查看波形了.我很确定,如果能像xmode2一样更快地使irrecord采样,我会更幸运.
有什么想法吗? (注意:我也使用了force选项,没有区别)
这是我使用xmode2的结果-您可以看到5ms采样不能真正使信号产生波折,但是2ms采样可以.
5毫秒示例http://jnawk.net.nz/5ms.png 5毫秒示例(默认)
2毫秒示例http://jnawk.net.nz/2ms.png 2毫秒示例
首先,尝试使用
irrecord -f -d /dev/lirc0 ~/lirc.conf
-f 将强制使用原始模式.如果幸运的话,将生成配置文件或列出差距.
否则,请启动下面的命令并按ctrl ^ c以停止转义/停止记录.
mode2 -m -d /dev/lirc0 > ~/lirc.conf
-m 选项应生成格式化的原始文件. 删除第一个值,即按下远程按钮之前的延迟.
如果不使用-m选项,则可以使用VI来实现.
vim ~/lirc.conf
:%s/^.\{5}
:%s!^! !
:%s/\n/
完成〜/lirc.conf文件以获得类似的内容:
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,文件中只有空格.
备份原始lircd.conf文件
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指示灯是否亮起.
这对某些人有用...
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
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)
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 sample http://jnawk.net.nz/5ms.png 5ms sample (default)
2ms sample http://jnawk.net.nz/2ms.png 2ms sample
First,try to use
irrecord -f -d /dev/lirc0 ~/lirc.conf
-f will force the raw mode. If you're lucky that will generate the config file or at list the gap.
Otherwise, launch the command below and ctrl^c to stop escape / stop recording.
mode2 -m -d /dev/lirc0 > ~/lirc.conf
the -m option should generate formated raws. remove the first value which is the delay before you pressed the remote button.
if you don't use the -m option you can do it with VI.
vim ~/lirc.conf
:%s/^.\{5}
:%s!^! !
:%s/\n/
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
No TAB, only spaces in the file.
Make a backup of the original lircd.conf file
sudo mv /etc/lirc/lircd.conf /etc/lirc/lircd_original.conf
Copy over your new configuration file
sudo cp ~/lircd.conf /etc/lirc/lircd.conf
Start up lirc again
sudo /etc/init.d/lirc start
and try it
irsend SEND_ONCE MY_REMOTE MY_TEST
check with your phone camera the led is lighting.
This works for some people...
这篇关于如何使用2毫秒计时而不是默认5毫秒的irrecord?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!