We're no longer updating This wiki!!

Suppport Custom Remote Controller

This is experimental feature, not supported officially yet. But it should work well with V1.4 or later Ubuntu release

Install package

Install Lirc package. While installing lirc, you will be asked the device type of IR receiver and transmitter. Since we will set up this later by manual, you can select None.

$ sudo apt-get install lirc

Registering own remote controller

Lirc package provide a tool, irrecord, to help registering the buttons of own remote controller. Once the tool is started, for example, you will be asked to press the buttons and it will analyse the signals of your remote controller like protocol type or headers. After this analysis you can start register the buttons one by one.

$ sudo irrecord --device /dev/lirc0 lircd.conf

Once signal analysis is done, you will be asked with the message below to enter the button name to register and press the applicable button. In this step, you can register many buttons as much as you expect to register. If you done, just press enter key on the prompt.

Please enter the name for the next button (press <ENTER> to finish recording)

The tool would ask you more steps to finalize and store the configuration file with the below message.

Successfully written config file.

For example, if you have done whole steps successfully with Hardkernel's stock remote controller, your will have the configuration file like below very similiary.

Now you must copy the configuration file, lircd.conf, to /etc/lirc/ so that lirc service can recognize the button.

$ sudo cp lircd.conf /etc/lirc/lircd.conf

Lirc configuration

Now you will need to modify /etc/lirc/hardware.conf to specify the configuration to run as a daemon.

$ sudo vi /etc/lirc/hardware.conf

Specify the kernel driver module and its node to read IR signal.

  5 REMOTE_MODULES="meson-ir"
  6 REMOTE_DRIVER="default"
  7 REMOTE_DEVICE="/dev/lirc0"

As well as below to make lircd start on boot.

 28 START_LIRCD="true"

In order to apply key event to whole system, enable Userspace Input Event while adding –uinput as a parameter of lircd.

 10 REMOTE_LIRCD_ARGS="--uinput"

All necessary configuration is done, you can simply start the service lirc by command line or reboot the device.

$ sudo service lirc start
 * Loading LIRC modules                                                            [ OK ] 
 * Starting remote control daemon(s) :                                             [ OK ]

Testing

If the Lirc daemon is running and drivers are loaded properly, you can test if your remote controller is accepted by the tool irw.

odroid@odroid:~$ irw
000000004db29966 00 KEY_LEFT myremote.conf
000000004db2837c 00 KEY_RIGHT myremote.conf
000000004db24bb4 01 KEY_DOWN myremote.conf
000000004db2738c 00 KEY_OK myremote.conf

You can check if the daemon is running properly.

root       849  0.0  0.0   4220   584 ?        Ss   10:30   0:00 /usr/sbin/lircd --output=/run/lirc/lircd --driver=default --device=/dev/lirc0

As well as necessary drivers are loaded.

$ lsmod
Module                  Size  Used by
ir_jvc_decoder          1664  0 
ir_lirc_codec           4147  0 
ir_mce_kbd_decoder      3100  0 
ir_nec_decoder          1760  0 
lirc_dev               10130  1 ir_lirc_codec
ir_sony_decoder         1643  0 
ir_sanyo_decoder        1638  0 
ir_rc6_decoder          2008  0 
ir_rc5_decoder          1528  0 
meson_ir                2906  0 

Default configuration

Hardkernel's Remote Configuration

The default button configuration for Hardkernel's stock remote controller.

lircd.conf
begin remote
 
  name  lircd.conf
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100
 
  header       8964  4507
  one           544  1692
  zero          544   561
  ptrail        544
  pre_data_bits   16
  pre_data       0x4DB2
  gap          107872
  toggle_bit_mask 0x0
 
      begin codes
          KEY_LEFT                 0x9966
          KEY_RIGHT                0x837C
          KEY_UP                   0x53AC
          KEY_DOWN                 0x4BB4
          KEY_ENTER                0x738C
          KEY_HOME                 0x41BE
          KEY_MUTE                 0x11EE
          KEY_MENU                 0xA35C
          KEY_BACK                 0x59A6
          KEY_VOLUMEDOWN           0x817E
          KEY_VOLUMEUP             0x01FE
          KEY_POWER                0x3BC4
      end codes
 
end remote

Default Lirc Configuration

hardware.conf
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="None"
REMOTE_MODULES="meson-ir"
REMOTE_DRIVER="default"
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS="--uinput"
 
#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""
 
#Disable kernel support.
#Typically, lirc will disable in-kernel support for ir devices in order to
#handle them internally.  Set to false to prevent lirc from disabling this
#in-kernel support. 
#DISABLE_KERNEL_SUPPORT="true"
 
#Enable lircd
START_LIRCD="true"
 
#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"
 
#Try to load appropriate kernel modules
LOAD_MODULES="true"
 
# Default configuration files for your hardware if any
LIRCMD_CONF=""
 
#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
en/c1_lirc.txt · Last modified: 2015/04/06 11:00 by odroid
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0