HugoOpenelec on Krausmueller.de2024-01-31T18:31:42+01:00https://www.krausmueller.de/en/tags/openelec/Infrared remote (e.g. Logitech Harmony) with Wetek OpenELEChttps://www.krausmueller.de/en/2016/07/27/infrared-remote-wetek-openelec/2016-07-27T00:00:00+00:002016-07-27T00:00:00+00:00
<p><a
class="gblog-markdown__link"
href="http://openelec.tv/openelec-box"
title="Wetek OpenELEC"
>Wetek OpenELEC</a> is a small box running <a
class="gblog-markdown__link"
href="http://openelec.tv/"
title="OpenELEC"
>OpenELEC</a>. OpenELEC is a media center based on <a
class="gblog-markdown__link"
href="https://kodi.tv/"
title="Kodi"
>Kodi</a>. In comparison to a Raspberry Pi running OpenELEC, Wetek OpenELEC includes a TV tuner (DVB-C/T, DVB-S oder ATSC). So you don’t have to find a compatible tuner by yourself and have everything integrated in a nice little box. Shipment includes an AirMouse. This is a remote which can be used as a mouse due to built-in motion sensors. Because I already use a Logitech Harmony as an universal remote I also wanted to control Wetek OpenELEC with this remote. Wetek OpenELEC is a special edition of Wetek Play (<a
class="gblog-markdown__link"
href="http://www.wetekforums.com/v/index.php?p=/discussion/12598/wetek-openelec"
title="Differences between WeTek Play and WeTek OpenELEC"
>differences</a> between these two). So getting an infrared remote to work with Wetek Play should be pretty similar.</p>
<p>The box has a built-in infrared receiver. But it is only used to power on and off the device. To actually control Kodi with an infrared remote unfortunately is a little complicated. I first describe how to simply use my configuration for a Logitech Harmony. Afterwards I show you the steps necessary for configuring another infrared remote. As a limitation your remote has to use the <a
class="gblog-markdown__link"
href="http://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol"
title="NEC Infrared Transmission Protocol"
>NEC protocol</a>.</p>
<div class="gblog-post__anchorwrap flex align-center">
<h3 id="control-with-logitech-harmony-configured-as-mutnt-hd2400">
Control with Logitech Harmony configured as Mut@nt HD2400
</h3>
<a data-clipboard-text="https://www.krausmueller.de/en/2016/07/27/infrared-remote-wetek-openelec/#control-with-logitech-harmony-configured-as-mutnt-hd2400" class="gblog-post__anchor gblog-post__anchor--right clip" aria-label="Anchor Control with Logitech Harmony configured as Mut@nt HD2400" href="#control-with-logitech-harmony-configured-as-mutnt-hd2400">
<svg class="gblog-icon gblog_link"><use xlink:href="#gblog_link"></use></svg>
</a>
</div>
<p>In order to control as many keys as possible from my Logitech Harmony remote I configured Mut@nt HD2400 as device. The Harmony configuration software also includes Wetek Play but then many keys of the Harmony do not work.</p>
<p><img
src="/images/harmony_mutant_hd2400.png"
alt="selection of &ldquo;Mut@nt HD2400&rdquo;"
/></p>
<p>Keys and the appropriate action in Kodi are defined in the file remote.conf on Wetek OpenELEC. If you do not want to configure everything yourself like described in the second part you can simply use my <a href="/downloads/remote.conf" target="_blank">file</a>. Connect to your Wetek OpenELEC via <em><strong><nobr>\<IP_of_Wetek>\Configfiles</nobr></strong></em> and make a copy of the original file (remote.conf). Afterwards you can replace the file with <a href="/downloads/remote.conf" target="_blank">my version</a>. When you added Muta@nt HD2400 to your Logitech Harmony configuration and rebootet Wetek OpenELEC you should be able to control Kodi.</p>
<p>In addition I configured some more keys:</p>
<p><img
src="/images/harmony_extra_keys.png"
alt="extra keys"
/></p>
<p>These are mapped to the Keys M, S, L, T and V in remote.conf. T and L are used to change subtitle and show teletext in Kodi default configuration. The other keys can be mapped to wanted actions with a own <a
class="gblog-markdown__link"
href="http://kodi.wiki/view/Keymap#Keyboards"
title="Keymap im Kodi Wiki"
>keymap</a> (file <a href="/downloads/keymap.xml" target="_blank">keymap.xml</a>). I configured M = “Movies”, S = “TV series”, L = “change language” and Z = “TV”. Furthermore the keymap includes keys for navigation in teletext (red, green, yellow, blue). The file <a href="/downloads/keymap.xml" target="_blank">keymap.xml</a> has to be copied to <em><strong><nobr>\<IP_of_Wetek>\Userdata\keymaps</nobr></strong></em>.</p>
<div class="gblog-post__anchorwrap flex align-center">
<h3 id="get-codes-for-other-nec-remotes">
Get codes for other (NEC) remotes
</h3>
<a data-clipboard-text="https://www.krausmueller.de/en/2016/07/27/infrared-remote-wetek-openelec/#get-codes-for-other-nec-remotes" class="gblog-post__anchor gblog-post__anchor--right clip" aria-label="Anchor Get codes for other (NEC) remotes" href="#get-codes-for-other-nec-remotes">
<svg class="gblog-icon gblog_link"><use xlink:href="#gblog_link"></use></svg>
</a>
</div>
<p>How is it psooible to configure another remote for Wetek OpenELEC? First you have to enable SSH access in the settings. The default password for the user <em><strong>root</strong></em> is <em><strong>openelec</strong></em>. Now you can press any key on the remote. With <em><strong>dmesg -c | grep custom</strong></em> you get the factory code of your remote:</p>
<pre class="shell">
OpenELEC:~ # <b>dmesg -c | grep custom</b>
[ 1657.693666@0] Wrong custom code is 0xe21d1f00
</pre>
<p>You have to change the factory code in the file remote.conf to match the code of your remote. You can either edit the file via SSH (e.g. <em><strong>vi /storage/.config/remote.conf</strong></em>) or use another editor on your remote computer with the help of the share <em><strong><nobr>\<IP_of_Wetek>\Configfiles</nobr></strong></em>. Edit the line beginning with “factory_code”. The 4 characters after “factory_code = 0x” have to be replaced with the last 4 characters from your output after “Wrong custom code”. So in this example 0xff000001 (value of the original remote) is changed to 0x1f000001.</p>
<pre class="shell">
OpenELEC:~ # <b>head -n 15 /storage/.config/remote.conf</b>
# WeTek Play NEC remote
factory_code = 0x1f000001
work_mode = 1
repeat_enable = 1
release_delay = 150
debug_enable = 1
reg_control = 0xfbe40
key_begin
; Code = IR keycode
; Linux = Linux keycode
; Android = Android keycode
; Button = Description button on Logitech remote
; KODI = Action in KODI (focus on video playback)
; Further info: http://kodi.wiki/view/Keyboard_controls
</pre>
<p>To activate the changes in remote.conf you either have to reboot Wetek OpenELEc or execute the command <em><strong>remotecfg /storage/.config/remote.conf</strong></em>. For every key on your remote you want to use you have to identify the right code. To do this press the key on the remote and display the received code afterwards:</p>
<pre class="shell">
OpenELEC:~ # <b>dmesg -c | grep scan</b>
[ 3135.540356@0] scancode is 0x002b, invalid key is 0x0000.
[ 3135.812065@0] scancode is 0x002b, invalid key is 0x0000.
OpenELEC:~ # <b>dmesg -c | grep scan</b>
[ 3163.433223@0] scancode is 0x0028, invalid key is 0x0000.
[ 3163.702069@0] scancode is 0x0028, invalid key is 0x0000.
</pre>
<p>Every received code (scancode) is mapped to a keycode whcih triggers an action in Kodi. My <a href="/downloads/remote.conf" target="_blank">remote.conf</a> already includes many important keycodes like 114 and 115 to change the sound level (see also description in column “Kodi”). Some valid keycodes can be found in <a
class="gblog-markdown__link"
href="http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hlkeycodes.html"
title="Linux Keycode Table"
>this list</a>.</p>
<p>The keys of your remote are defined between the lines beginning with “key_begin” and “key_end”. You can adjust the lines already in the file to your needs. Just change the value in the column “Code” to match you own remote codes. Comments are defined with ; or #. Entrires for the codes from the example might look like this:</p>
<pre class="shell">
key_begin
0x2b 114 # Vol -
0x28 115 # Vol +
key_end
</pre>
<p>After all keys are mapped in remote.conf run the command <em><strong>remotecfg /storage/.config/remote.conf</strong></em>.</p>
<p>The whole process is also described in a <a
class="gblog-markdown__link"
href="http://wetekforums.com/v/index.php?p=/discussion/12323/ir-remote-control"
title="article in WeTek Forum"
>forum article</a>.</p>