在前面已经成功驱动了WIFI,于是再来看一看红外线:
1 2 3 4 5 6 $ dmesg | grep meson-ir [ 5.140483] rc rc0: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0 [ 5.142659] rc rc0: lirc_dev: driver meson-ir registered at minor = 0, raw IR receiver, no transmitter [ 5.142827] input: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0/input4 [ 5.147424] meson-ir c8100580.ir: receiver initialized
看起来红外线模块已经被成功识别并驱动。
再来看一看遥控文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 $ ls /lib/udev/rc_keymaps/ adstech_dvb_t_pci.toml af9005.toml alink_dtu_m.toml allwinner_ba10_tv_box.toml allwinner_i12_a20_tv_box.toml anysee.toml apac_viewcomp.toml astrometa_t2hybrid.toml asus_pc39.toml asus_ps3_100.toml ati_tv_wonder_hd_600.toml ati_x10.toml avermedia.toml avermedia_a16d.toml avermedia_cardbus.toml avermedia_dvbt.toml avermedia_m135a.toml avermedia_m733a_rm_k6.toml avermedia_rm_ks.toml avertv_303.toml az6027.toml azurewave_ad_tu700.toml beelink_gs1.toml behold.toml behold_columbus.toml budget_ci_old.toml cec.toml cinergy.toml cinergy_1400.toml cinergyt2.toml d680_dmb.toml delock_61959.toml dib0700_nec.toml dib0700_rc5.toml dibusb.toml digitalnow_tinytwin.toml digittrade.toml digitv.toml dish_network.toml dm1105_nec.toml dntv_live_dvb_t.toml dntv_live_dvbt_pro.toml dtt200u.toml dvbsky.toml dvico_mce.toml dvico_portable.toml em_terratec.toml encore_enltv.toml encore_enltv2.toml encore_enltv_fm53.toml evga_indtube.toml eztv.toml flydvb.toml flyvideo.toml fusionhdtv_mce.toml gadmei_rm008z.toml geekbox.toml genius_tvgo_a11mce.toml gotview7135.toml haupp.toml hauppauge.toml hisi_poplar.toml hisi_tv_demo.toml imon_mce.toml imon_pad.toml imon_rsc.toml iodata_bctv7e.toml it913x_v1.toml it913x_v2.toml kaiomy.toml khadas.toml kii_pro.toml kworld_315u.toml kworld_pc150u.toml kworld_plus_tv_analog.toml leadtek_y04g0051.toml lme2510.toml manli.toml mce_keyboard.toml medion_x10.toml medion_x10_digitainer.toml medion_x10_or2x.toml megasky.toml msi_digivox_ii.toml msi_digivox_iii.toml msi_tvanywhere.toml msi_tvanywhere_plus.toml nebula.toml nec_terratec_cinergy_xs.toml norwood.toml npgtech.toml odroid.toml opera1.toml pctv_sedna.toml pinnacle310e.toml pinnacle_color.toml pinnacle_grey.toml pinnacle_pctv_hd.toml pixelview.toml pixelview_002t.toml pixelview_mk12.toml pixelview_new.toml powercolor_real_angel.toml proteus_2309.toml purpletv.toml pv951.toml rc6_mce.toml real_audio_220_32_keys.toml reddo.toml snapstream_firefly.toml streamzap.toml su3000.toml tango.toml tanix_tx3mini.toml tanix_tx5max.toml tbs_nec.toml technisat_ts35.toml technisat_usb2.toml terratec_cinergy_c_pci.toml terratec_cinergy_s2_hd.toml terratec_cinergy_xs.toml terratec_slim.toml terratec_slim_2.toml tevii_nec.toml tivo.toml total_media_in_hand.toml total_media_in_hand_02.toml trekstor.toml tt_1500.toml tvwalkertwin.toml twinhan_dtv_cab_ci.toml twinhan_vp1027_dvbs.toml vega_s9x.toml videomate_k100.toml videomate_s350.toml videomate_tv_pvr.toml vp702x.toml wetek_hub.toml wetek_play2.toml winfast.toml winfast_usbii_deluxe.toml wobo_i5.toml x96max.toml xbox_dvd.toml zx_irdec.toml
有很多,但显然没有我使用的遥控器。计划找出按键对应值,然后根据模板创建。寻找按键映射参照 https://discourse.coreelec.org/t/how-to-configure-ir-remote-control/31 ,我之前做过Coreelec的,不知道是否可以直接照抄。(此部分待补充)
创建遥控文件后,可以利用按键调用系统命令,比如执行某个脚本,或者重启等等。参考 https://forum.armbian.com/topic/11161-lirc-on-armbian-buster/ ,作者使用triggerhappy实现功能:
1 2 3 4 5 KEY_RED 1 /usr/local/bin/script.sh red KEY_GREEN 1 /usr/local/bin/script.sh green KEY_YELLOW 1 /usr/local/bin/script.sh yellow KEY_BLUE 1 /usr/local/bin/script.sh blue
triggerhappy使用yay可以安装,有空测试下。