Benutzer-Werkzeuge

Webseiten-Werkzeuge


raspberry_pi3b_plus:ir


GPIOMeineBild
3oswsw
6ortbl
1uwsrt

IR: TSOP4838

https://wiki.libreelec.tv/infrared_remotes

mount -o remount,rw /flash
vi /flash/config.txt

dtoverlay=gpio-ir,gpio_in_pin=18

mount -o remount,ro /flash

systemctl stop kodi
systemctl stop eventlircd
Zitat aus der Anleitung: https://wiki.libreelec.tv/infrared_remotes

Then, for each of the protocols (except lirc, which isn't a real protocol) 
run ir-keytable -p PROTOCOL -t, then press some buttons on your remote.
If you discovered the correct protocol you should see EV_MSC events together 
with the scancode of the button. eg: 

ir-keytable -p rc-5 -t

Protocols changed to rc-5
Testing events. Please, press CTRL-C to abort.
 .... HIER KAM DANN MAL NIX :D

Wenn hier nix kommt.. dann mal mit nec probieren, war für die Samsung-Fernbedienung notwendig.

ir-keytable -p nec -t

Protocols changed to nec
Testing events. Please, press CTRL-C to abort.
108.370058: lirc protocol(necx): scancode = 0x70760
108.370082: event type EV_MSC(0x04): scancode = 0x70760
108.370082: event type EV_SYN(0x00).
110.426722: lirc protocol(necx): scancode = 0x70761
110.426741: event type EV_MSC(0x04): scancode = 0x70761
110.426741: event type EV_SYN(0x00).
112.896724: lirc protocol(necx): scancode = 0x70761
112.896742: event type EV_MSC(0x04): scancode = 0x70761
112.896742: event type EV_SYN(0x00).
113.386722: lirc protocol(necx): scancode = 0x70761
113.386740: event type EV_MSC(0x04): scancode = 0x70761
113.386740: event type EV_SYN(0x00).
113.893379: lirc protocol(necx): scancode = 0x70761
113.893397: event type EV_MSC(0x04): scancode = 0x70761
113.893397: event type EV_SYN(0x00).
114.483382: lirc protocol(necx): scancode = 0x70761
114.483400: event type EV_MSC(0x04): scancode = 0x70761
114.483400: event type EV_SYN(0x00).
^C
vi /storage/.config/rc_keymaps/samsung

# table my_custom_remote, type: <TYPE>
# table samsung, type: nec
0x70760 KEY_UP
0x70761 KEY_DOWN
0x70765 KEY_LEFT
0x70762 KEY_RIGHT
0x70746 KEY_STOP
0x70748 KEY_FASTFORWARD
0x70747 KEY_PLAYPAUSE
0x70745 KEY_REWIND
0x7076c KEY_MENU
0x70714 KEY_HOME
0x70715 KEY_ENTER
0x70716 KEY_BACK
mv /storage/.config/rc_maps.cfg.sample /storage/.config/rc_maps.cfg
vi /storage/.config/rc_maps.cfg

* * samsung
ir-keytable -c -w /storage/.config/rc_keymaps/samsung
	Read samsung table
	Old keytable cleared
	Wrote 12 keycode(s) to driver
	Protocols changed to nec

Jetzt sollten nicht nur die scanncodes dastehen, sondern auch die übersetzten Tasten.

ir-keytable -t
Testing events. Please, press CTRL-C to abort.
305.373364: lirc protocol(necx): scancode = 0x70760
305.373402: event type EV_MSC(0x04): scancode = 0x70760
305.373402: event type EV_KEY(0x01) key_down: KEY_UP(0x0067)
305.373402: event type EV_SYN(0x00).
305.480026: lirc protocol(necx): scancode = 0x70760
305.480044: event type EV_MSC(0x04): scancode = 0x70760
305.480044: event type EV_SYN(0x00).
305.606673: event type EV_KEY(0x01) key_up: KEY_UP(0x0067)
305.606673: event type EV_SYN(0x00).
305.696692: lirc protocol(necx): scancode = 0x70760
305.696720: event type EV_MSC(0x04): scancode = 0x70760
305.696720: event type EV_KEY(0x01) key_down: KEY_UP(0x0067)
305.696720: event type EV_SYN(0x00).
305.823337: event type EV_KEY(0x01) key_up: KEY_UP(0x0067)
305.823337: event type EV_SYN(0x00).
306.626695: lirc protocol(necx): scancode = 0x70761
306.626722: event type EV_MSC(0x04): scancode = 0x70761
306.626722: event type EV_KEY(0x01) key_down: KEY_DOWN(0x006c)
306.626722: event type EV_SYN(0x00).
306.753339: event type EV_KEY(0x01) key_up: KEY_DOWN(0x006c)
306.753339: event type EV_SYN(0x00).
307.016693: lirc protocol(necx): scancode = 0x70761
307.016717: event type EV_MSC(0x04): scancode = 0x70761
307.016717: event type EV_KEY(0x01) key_down: KEY_DOWN(0x006c)
307.016717: event type EV_SYN(0x00).
307.143337: event type EV_KEY(0x01) key_up: KEY_DOWN(0x006c)
307.143337: event type EV_SYN(0x00).
systemctl start eventlircd
systemctl start kodi
mv /storage/.config/rc_maps.cfg /storage/.config/rc_maps.cfg.bak
mv /storage/.config/rc_maps.cfg.bak  /storage/.config/rc_maps.cfg
LibreELEC:~ # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event0) with:
        Name: gpio_ir_recv
        Driver: gpio_ir_recv, table: rc-rc6-mce
        lirc device: /dev/lirc0
        Supported protocols: lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp imon rc-mm
        Enabled protocols: lirc rc-6
        bus: 25, vendor/product: 0001:0001, version: 0x0100
        Repeat delay = 500 ms, repeat period = 125 ms

Mögliche tasten

table TABLENAME, type: IR_TYPE
0x KEY_MUTE
0x KEY_VOLUMEDOWN
0x KEY_VOLUMEUP
0x KEY_LEFT
0x KEY_UP
0x KEY_RIGHT
0x KEY_DOWN
0x KEY_ENTER
0x KEY_BACK
0x KEY_HOME
0x KEY_POWER
0x KEY_MENU
0x KEY_PLAYPAUSE
0x KEY_CONFIG
0x KEY_FAVORITES
0x KEY_ESC
0x KEY_REWIND
0x KEY_FASTFORWARD
0x KEY_EPG
0x KEY_0
0x KEY_1
0x KEY_2
0x KEY_3
0x KEY_4
0x KEY_5
0x KEY_6
0x KEY_7
0x KEY_8
0x KEY_9
0x KEY_BACKSPACE
0x KEY_STOP
0x KEY_INFO
0x KEY_CONTEXT_MENU
0x KEY_PAGEUP
0x KEY_PAGEDOWN
0x KEY_HOMEPAGE
0x KEY_GREEN
0x KEY_RED

Herausforderung SHARP IR 36.7kHz

Aber auch das geht… wenn man das Datenblatt genau studiert.

  1. Kondensator 47µF GND <> VCC
  2. GND auf Metallgehäuse legen…

Wenn man diese beiden Punkte beachtet, kommt auch kein Rauschen mehr mit `#mode2` an den Tag. Wenn man dies nicht tut: Naja - dann flattert permanent was am IR rum.. irgendwelche Signale halt.

Und zu guter letzt das Einrichten der Tasten.

Keymapping: siehe Bild

1	KEY_UP
2	KEY_RIGHT
3	KEY_DOWN
4	KEY_LEFT
5	KEY_OK
6	KEY_STOP
7	KEY_PLAY
8	KEY_PAUSE
9	KEY_FORWARD
10	KEY_REWIND
11	KEY_OPTION => KEY_MENU
12	KEY_INFO
13	KEY_BACK
14	KEY_HOME

Da sind kleine, grüne Zahlen auf dder Fernbedienung, also draufklicken für GROß ;)

Befehle

#mode2
#mode2 -d /dev/lirc0

# irrecord -f -k --loglevel=notice
# cat test.lircd.conf > /etc/lirc/lircd.conf
# reboot

# irw 
raspberry_pi3b_plus/ir.txt · Zuletzt geändert: 2020/12/18 01:15 von raiser