How to use irrecord with 2ms timing instead of the default 5ms?

故事扮演 提交于 2019-12-03 21:19:49

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...

LIRC actually samples as fast as 13 microseconds in raspberry pi which is the speed infrared lights pulse for IR signals (38kHZ), the timing you specify in xmode2 is just used in order to plot the image, each 2 ms it draws either a pulse or space on the graph.

The problem probably is in LIRC not detecting your remote IR code, have you tried running irrecord with the -f option? to force raw mode instead?

If this does not work you can use mode2 to actually try building your raw code manually and create the code like so: pulse time, space time, pulse time, space time and so on, expressed in microseconds.

From your graph it would be something like 6000 4000 1000 2000 1000 and so on...


Option 2- If you can find the pronto remote codes for your heat pump online then you can also convert them to lirc using pronto2lirc http://www.lirc.org/html/pronto2lirc.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!