l
volumio@volumio:~$ ps auxw | grep lirc root 1592 0.0 0.1 3896 1484 ? Ss 02:24 0:00 /usr/sbin/lircd --driver=default --device=/dev/lirc0 --uinput root 1595 0.0 0.0 1804 68 ? Ss 02:24 0:00 /usr/bin/irexec -d /etc/lirc/lircrc volumio 2691 0.0 0.0 2588 528 pts/0 S+ 02:33 0:00 grep lirc動作している
tartsWith('ir-receiver'); }) === undefined) { self.logger.info('HAT did not load /proc/device-tree/ir_receiver!'); exec('/usr/bin/sudo /usr/bin/dtoverlay gpio-ir gpio_pin=25', { uid: 1000, gid: 1000 }, ↑で25番に設定されている。接続GPIO端子を変えたい場合は、ここを修正する。
volumio@volumio:~$ ps auxw | grep lirc volumio 8345 0.0 0.0 2588 500 pts/0 S+ 03:18 0:00 grep lirc停止している。次に受光していることを確認するために mode2 -d /dev/lirc0 を入力
volumio@volumio:~$ mode2 -d /dev/lirc0 space 16777215 space 4184481 pulse 10521 space 4490 pulse 736 space 492 pulse 682 space 558動いているのでラズパイにリモコン信号を学習させる。
volumio@volumio:~$ irrecord -n -d /dev/lirc0 test.conf irrecord - application for recording IR-codes for usage with lirc Copyright (C) 1998,1999 Christoph Bartelmus(lirc@bartelmus.de) This program will record the signals from your remote control and create a config file for lircd. A proper config file for lircd is maybe the most vital part of this package, so you should invest some time to create a working config file. Although I put a good deal of effort in this program it is often not possible to automatically recognize all features of a remote control. Often short-comings of the receiver hardware make it nearly impossible. If you have problems to create a config file READ THE DOCUMENTATION of this package, especially section "Adding new remote controls" for how to get help. If there already is a remote control of the same brand available at http://www.lirc.org/remotes/ you might also want to try using such a remote as a template. The config files already contain all parameters of the protocol used by remotes of a certain brand and knowing these parameters makes the job of this program much easier. There are also template files for the most common protocols available in the remotes/generic/ directory of the source distribution of this package. You can use a template files by providing the path of the file as command line parameter. Please send the finished config files to上手く出来なかった時は、パラメータが3個あった。原因は良く分からないが、失敗例で使ったリモコンはこの方法でも失敗so that I can make them available to others. Don't forget to put all information that you can get about the remote control in the header of the file. Press RETURN to continue. (エンターを押す) Now start pressing buttons on your remote control. It is very important that you press many different buttons and hold them down for approximately one second. Each button should generate at least one dot but in no case more than ten dots of output. Don't stop pressing buttons until two lines of dots (2x80) have been generated. Press RETURN now to start recording. (エンターを押すとともリモコンのキーをランダムに押す。一押しで1ドット点が増え80個まで続ける。) ................................................................................ Found const length: 107382 Please keep on pressing buttons like described above. さらに同じ方法で80個続ける。 ................................................................................ Space/pulse encoded remote control found. Signal length is 65. Found possible header: 628 503 Found trail pulse: 603 No repeat code found. Signals are space encoded. Removed header. Signal length is 32 Now enter the names for the buttons. Please enter the name for the next button (press to finish recording) キーの名前を入力後エンター KEY_PLAY Now hold down button "KEY_PLAY". 該当キーを長押しする Please enter the name for the next button (press to finish recording) KEY_UP Now hold down button "KEY_UP". Please enter the name for the next button (press to finish recording) KEY_DOWN Now hold down button "KEY_DOWN". Please enter the name for the next button (press to finish recording) エンターのみで終了 Checking for toggle bit mask. Please press an arbitrary button repeatedly as fast as possible. Make sure you keep pressing the SAME button and that you DON'T HOLD the button down!. If you can't see any dots appear, then wait a bit between button presses. Press RETURN to continue. エンターを押し、適当なキーを連続入力。 No toggle bit mask found. Successfully written config file. 学習状況を確認 volumio@volumio:~$ cat test.conf # Please make this file available to others # by sending it to # # this config file was automatically generated # using lirc-0.9.0-pre1(default) on Mon Feb 10 05:29:22 2020 # # contributed by # # brand: test.conf # model no. of remote control: # devices being controlled by this remote: # begin remote name test.conf bits 16 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100 one 605 1627 zero 605 506 ptrail 603 pre_data_bits 16 pre_data 0x2FD gap 107382 toggle_bit_mask 0x0 begin codes KEY_PLAY 0x48B7 KEY_UP 0x58A7 KEY_DOWN 0x7887 end codes end remote
Please enter the name for the next button (press以上でtest.confに学習結果が作成されたのでこれで動作確認する。to finish recording) KEY_PLAY Now hold down button "KEY_PLAY". Something went wrong. Please try again. (9 retries left) Something went wrong. Please try again. (8 retries left) Something went wrong. Please try again. (7 retries left)