Difference between revisions of "Repeater LIRC Configuration"

From BATC Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
===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.  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.
  
====Install and edit lirc====
+
===Recording the Codes===
  
1.  Log in to the Ryde by ssh and type "stop" and press enterThe Ryde should stop receiving.
+
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:
  
2.   Type "sudo apt-get -y install lirc" and press enter.
+
8950.350025: lirc protocol(nec): scancode = 0x17
 +
8950.350035: event type EV_MSC(0x04): scancode = 0x17
 +
8950.350035: event type EV_SYN(0x00).
  
3.  Type "sudo nano /etc/lirc/lirc_options.conf" and press enter.  Edit the following 2 lines:
+
The information required here is the protocol (nec in this case) and the scancode (0x17 in this case).
 
+
Here are 2 example lists of keycodes:
driver          = devinput
 
device          = auto
 
 
 
to read:
 
 
 
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.
 
 
 
====Record the data from 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.
 
 
 
====Create config file for your remote====
 
 
 
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
 
|-
 
| KEY_MUTE || Mute/unmute HDMI Switch Audio
 
|-
 
| KEY_MODE || Toggle between 720 and 1080 Output
 
|-
 
| KEY_1 || Select Input 1
 
|-
 
| KEY_2 || Select Input 2
 
|-
 
| KEY_3 || Select Input 3
 
|-
 
| KEY_4 || Select Input 4
 
|-
 
| 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_F5 || Select Audio Input 5 (override)
+
| Input 1 || 0x17
 
|-
 
|-
| KEY_F6 || Select Audio Input 6 (override)
+
| Input 2 || 0x12
 
|-
 
|-
| KEY_F7 || Select Audio Input 7 (override)
+
| Input 3 || 0x59
 
|-
 
|-
| KEY_F8 || Select Audio Input 8 (override)
+
| Input 4 || 0x08
 
|-
 
|-
 +
| Quad View || 0x18
 
|}
 
|}

Revision as of 18:00, 14 January 2022

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.

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 here 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