출처 : https://www.hardkernel.com/ko/shop/ir-remote-controller/
하드커널에서 악세사리로 적외선 리모컨을 팔고 오드로이드N2에도 IR 센서가 달려있음.
이걸 사다 써도 되겠지만 난 이미 통합IR 리모컨이 있어서 그걸 활용하기로 했다.
이 제품인데 학습형이라 기본적으로 제공하는 여러모드를 굴려봐도 하나도 안먹혀서 삽질 예감이 들더군요.
그 삽질 여기에 정리해 둡니다.
일단 N2에 SSH 연결을 합니다.
CoreELEC 처음 세팅할때 SSH 활성화 하면 비번 적는게 있는데 그게 root 계정 비번 설정이었더군요. 그걸 활용합니다.
############################################## # CoreELEC # # https://coreelec.org # ############################################## CoreELEC (official): 9.2.0 (Amlogic-ng.arm) CoreELEC:~ #
접속하면 요렇게 나옵니다.
여기서 아래 명령을 내립니다.
systemctl stop kodi && systemctl stop eventlircd
실행하면 CoreELEC이 꺼지고 걍 검은 화면만 나옵니다.
ir-keytable -p NEC,RC-5,RC-6,JVC,SONY -t
그리고 위 명령을 내리고 N2를 향해 리모컨 버튼을 누르면 리모컨 버튼의 스캔코드를 읽을수 있습니다.
CoreELEC:~ # ir-keytable -p NEC,RC-5,RC-6,JVC,SONY -t Protocols changed to rc-5 jvc sony nec rc-6 Testing events. Please, press CTRL-C to abort. 494.336666: event type EV_MSC(0x04): scancode = 0x391513 494.336666: event type EV_SYN(0x00).
저는 이렇게 나옵니다. 여기서 저 스캔코드를 잘 적습니다.
# table linsoo, type: NEC 0x391518 KEY_MUTE 0x391540 KEY_VOLUMEDOWN 0x39151f KEY_VOLUMEUP 0x391512 KEY_LEFT 0x391511 KEY_UP 0x391514 KEY_RIGHT 0x391515 KEY_DOWN 0x391513 KEY_ENTER 0x391561 KEY_BACK 0x391562 KEY_HOME 0x391500 KEY_POWER 0x391541 KEY_MENU 0x391503 KEY_1 0x391504 KEY_2 0x391505 KEY_3 0x391506 KEY_4 0x391507 KEY_5 0x391508 KEY_6 0x391509 KEY_7 0x39150a KEY_8 0x39150b KEY_9 0x39150c KEY_0 0x391566 KEY_PREVIOUS 0x391560 KEY_PLAYPAUSE 0x391563 KEY_STOP 0x391567 KEY_NEXT 0x39154d KEY_SUBTITLE #자막 순환 0x39154f KEY_CONTEXT_MENU #마우스 우클릭
이건 제 리모컨에서 “올레KT” 모드일때 값입니다. 위 항목의 값은 다 구해서 잘 적어둡니다.
키코드 참고는 : http://ix.io/19sO
이걸 파일로 저장해서 CoreELEC에 업로드 합니다.
저는 파일명으로 “linsooIR이라고 했고 경로는 “/storage/.config/rc_keymaps/linsooIR” 입니다.
# Keymaps table # # This table creates an association between a keycode file and a kernel # driver. It can be used to automatically override a keycode definition. # # # Format: # driver - name of the driver provided via uevent - use * for any driver # table - RC keymap table, provided via uevent - use * for any table # file - file name. If directory is not specified, it is first looked up # in /storage/.config/rc_keymaps, then /usr/lib/udev/rc_keymaps # # For example: # # driver table file # # gpio-rc-recv rc-streamzap streamzap # gpio-rc-recv * justboom # * rc-rc6-mce rc6_mce_new # * * hauppauge_new meson-ir * /storage/.config/rc_keymaps/linsooIR
/storage/.config 경로에 보면 rc_maps.cfg.sample파일을 참고해서 /storage/.config/rc_maps.cfg 파일을 만듭니다.
다운로드 : rc_maps.cfg (위내용과 같습니다)
CoreELEC:~ # ir-keytable -a /storage/.config/rc_maps.cfg -s rc0 Old keytable cleared Wrote 24 keycode(s) to driver Protocols changed to nec CoreELEC:~ # systemctl start eventlircd && systemctl start kodi
이렇게 두개의 파일을 만들어 주고 위 명령을 실행해주면 화면에 다시 CoreELEC이 나오면서 리모컨이 작동합니다.
출처: https://discourse.coreelec.org/t/how-to-configure-ir-remote-control/31
답글 남기기