Difference between revisions of "Repeater LIRC Configuration"

From BATC Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
Back to [[Repeater Controller|repeater controller]] main page
 
===Setting Up the Key Codes===
 
===Setting Up the Key Codes===
  
Use your Ryde receiver to record the key codes from the IR sender for your HDMI switch.  To do this you will need to install additional software, but it will not affect future operation of your Ryde.
+
Use your Ryde receiver to record the key codes from the IR sender for your HDMI switch.   
  
====Install and edit lirc====
+
To do this you will need to go to log in to the Ryde by ssh, and type "menu" and press enter.  This should bring up the Console Menu.  Go to Select option 7, IR Check.
  
1.   Log in to the Ryde by ssh and type "stop" and press enter. The Ryde should stop receiving.
+
See this page for more details: https://wiki.batc.org.uk/Ryde_remote_controls#Using_a_custom_remote_control
  
2.  Type "sudo apt-get -y install lirc" and press enter.
+
===Recording the Codes===
  
3.  Type "sudo nano /etc/lirc/lirc_options.conf" and press enterEdit the following 2 lines:
+
You will need to make a list of the key codes that you want to use, and also check the protocol usedPress a key and you should see a response on the screen like this:
  
  driver          = devinput
+
  8950.350025: lirc protocol(nec): scancode = 0x17
  device          = auto
+
  8950.350035: event type EV_MSC(0x04): scancode = 0x17
 +
8950.350035: event type EV_SYN(0x00).
  
to read:
+
The information required is the protocol (nec in this case) and the scancode (0x17 in this case).
 
+
Here are 2 example lists of keycodes:
driver          = default
 
device          = /dev/lirc0
 
 
 
press ctrl-x, then y and enter to exit from the editor.
 
 
 
====Check IR commands are being read====
 
 
 
4.  Enter "systemctl stop lircd.service" and press enter.  The Ryde will ask for authentication with your password.  By default this is raspberry.
 
 
 
5.  Now enter "mode2 -d /dev/lirc0" and press enter.  Try pressing the buttons on your HDMI switch remote and you should see a stream of "pulse", "space" and "timeout" messages.  This shows that the configuration is correct.  press ctrl-c to exit.
 
 
 
6.  Enter "systemctl start lircd.service" and press enter.  The Ryde will again ask for authentication with your password.  By default this is raspberry.
 
 
 
====Create config file for your remote====
 
 
 
7.  Now you can create a configuration file for your remote.  This is a complex process and you might need a couple of attenpts to get it right.  Enter "irrecord" and press enter.
 
 
 
Read the message (if you want) and then press RETURN (enter)
 
 
 
Once the app has checked for ambient light, enter the name of the remote in the format "brand_name_hdmi" and press enter.
 
 
 
Then read the message about pressing buttons, grab your remote and press enter.  Start recording buttons - this may take a minute or 2.
 
 
 
The next step will be to enter names for each key and then press the key.  Use the approved names in the table below.  You only need to enter the keys that you are going to use.
 
 
 
Lastly, the app will ask you to press an arbitary button "for the toggle mask", and will then tell you the filename and exit.
 
 
 
8.  Open the "xxxxx_hdmi.lircd.conf" file with a text editor (nano?) and check that there are non-zero entries against the keys.  If it looks like they are all zero, you will need to repeat the process (just Step 7).
 
 
 
9.  You need to copy the "xxxxx_hdmi.lircd.conf" file from your Ryde to your repeater RPi, and then use the command
 
 
 
sudo cp /etc/lirc/lircd.conf.d /etc/lirc/lircd.conf.d//etc/lirc/lircd.conf.d
 
 
 
to copy it to the right place.
 
 
 
10.  After that, on your Repeater RPi, either reboot or enter "systemctl restart lircd.service" and enter your password.
 
 
 
To set up the repeater to use the codes, you need to set the remote control name and the actual key names in the repeater config file.  More info to follow.
 
 
 
 
 
 
 
 
 
The recommended list of key names is as follows:
 
  
 +
Portta 4-port HDMI Switch.  Protocol nec.
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Key Name !! Function
+
! Key !! scancode
 
|-
 
|-
| KEY_POWER || HDMI Switch on/off
+
| Input 1 || 0x17
 
|-
 
|-
| KEY_MUTE || Mute/unmute HDMI Switch Audio
+
| Input 2 || 0x12
 
|-
 
|-
| KEY_MODE || Toggle between 720 and 1080 Output
+
| Input 3 || 0x59
 
|-
 
|-
| KEY_1 || Select Input 1
+
| Input 4 || 0x08
 
|-
 
|-
| KEY_2 || Select Input 2
+
| Quad View || 0x18
|-
+
|}
| KEY_3 || Select Input 3
+
 
|-
+
Generic eBay 4-port HDMI Switch.  Protocol nec.
| KEY_4 || Select Input 4
+
 
|-
+
{| class="wikitable"
| KEY_5 || Select Input 5
 
|-
 
| KEY_6 || Select Input 6
 
|-
 
| KEY_7 || Select Input 7
 
|-
 
| KEY_8 || Select Input 8
 
|-
 
| KEY_Q || Select Quad View
 
|-
 
| KEY_F1 || Select Audio Input 1 (override)
 
|-
 
| KEY_F2 || Select Audio Input 2 (override)
 
|-
 
| KEY_F3 || Select Audio Input 3 (override)
 
 
|-
 
|-
| KEY_F4 || Select Audio Input 4 (override)
+
! Key !! scancode
 
|-
 
|-
| KEY_F5 || Select Audio Input 5 (override)
+
| Input 1 || 0x19
 
|-
 
|-
| KEY_F6 || Select Audio Input 6 (override)
+
| Input 2 || 0x1b
 
|-
 
|-
| KEY_F7 || Select Audio Input 7 (override)
+
| Input 3 || 0x11
 
|-
 
|-
| KEY_F8 || Select Audio Input 8 (override)
+
| Input 4 || 0x15
 
|-
 
|-
 +
| Quad View || 0x04
 
|}
 
|}
 +
 +
Note that only the following protocols are supported: nec, necx, nec32, sanyo, rc6_0, rc6_6a_20, rc6_6a_24, rc6_6a_32, rc6_mce, rc5, rc5x_20, rc5_sz, jvc, sony12, sony15, sony20, sharp.
 +
 +
===Formatting the Codes for the Configuration File===
 +
 +
The configuration file includes a number of lines for IR codes.  This is how they should be configured for the Portta 4-way HDMI switch described above:
 +
 +
outputswitchcontrol=ir
 +
outputhdmiresetcode=nec:0x17
 +
output2ndhdmicode=nec:0x08
 +
output0code=nec:0x17
 +
output1code=nec:0x12
 +
output2code=nec:0x59
 +
output3code=nec:0x08
 +
 +
If a second identical switch were to be daisy-chained in front of input 4 (to give 7 available inputs including the controller), the codes would be:
 +
 +
outputswitchcontrol=ir
 +
outputhdmiresetcode=nec:0x17
 +
output2ndhdmicode=nec:0x08
 +
output0code=nec:0x17
 +
output1code=nec:0x12
 +
output2code=nec:0x59
 +
output3code=2nec:0x17
 +
output4code=2nec:0x12
 +
output5code=2nec:0x59
 +
output6code=2nec:0x08
 +
 +
So, the format for the codes is protocol:scancode.  If the desired input is daisy-chained, the format is 2protocol:scancode, and the "output2ndhdmicode" must refrence the code to select the second controller.

Latest revision as of 18:26, 13 February 2022

Back to repeater controller main page

Setting Up the Key Codes

Use your Ryde receiver to record the key codes from the IR sender for your HDMI switch.

To do this you will need to go to log in to the Ryde by ssh, and type "menu" and press enter. This should bring up the Console Menu. Go to Select option 7, IR Check.

See this page for more details: https://wiki.batc.org.uk/Ryde_remote_controls#Using_a_custom_remote_control

Recording the Codes

You will need to make a list of the key codes that you want to use, and also check the protocol used. Press a key and you should see a response on the screen like this:

8950.350025: lirc protocol(nec): scancode = 0x17
8950.350035: event type EV_MSC(0x04): scancode = 0x17
8950.350035: event type EV_SYN(0x00).

The information required is the protocol (nec in this case) and the scancode (0x17 in this case). Here are 2 example lists of keycodes:

Portta 4-port HDMI Switch. Protocol nec.

Key scancode
Input 1 0x17
Input 2 0x12
Input 3 0x59
Input 4 0x08
Quad View 0x18

Generic eBay 4-port HDMI Switch. Protocol nec.

Key scancode
Input 1 0x19
Input 2 0x1b
Input 3 0x11
Input 4 0x15
Quad View 0x04

Note that only the following protocols are supported: nec, necx, nec32, sanyo, rc6_0, rc6_6a_20, rc6_6a_24, rc6_6a_32, rc6_mce, rc5, rc5x_20, rc5_sz, jvc, sony12, sony15, sony20, sharp.

Formatting the Codes for the Configuration File

The configuration file includes a number of lines for IR codes. This is how they should be configured for the Portta 4-way HDMI switch described above:

outputswitchcontrol=ir
outputhdmiresetcode=nec:0x17
output2ndhdmicode=nec:0x08
output0code=nec:0x17
output1code=nec:0x12
output2code=nec:0x59
output3code=nec:0x08

If a second identical switch were to be daisy-chained in front of input 4 (to give 7 available inputs including the controller), the codes would be:

outputswitchcontrol=ir
outputhdmiresetcode=nec:0x17
output2ndhdmicode=nec:0x08
output0code=nec:0x17
output1code=nec:0x12
output2code=nec:0x59
output3code=2nec:0x17
output4code=2nec:0x12
output5code=2nec:0x59
output6code=2nec:0x08

So, the format for the codes is protocol:scancode. If the desired input is daisy-chained, the format is 2protocol:scancode, and the "output2ndhdmicode" must refrence the code to select the second controller.