We're no longer updating This wiki!!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:c2_lirc [2016/07/14 10:08]
joy.cho
en:c2_lirc [2017/07/14 09:48] (current)
joy.cho [Registering own remote controller]
Line 1: Line 1:
-====== ​Suppport ​Custom Remote Controller ======+====== ​Support ​Custom Remote Controller ======
 <WRAP center round important>​ <WRAP center round important>​
 **To support custom remote controller with LIRC, your kernel version should be 3.14.29-56 (2016/​04/​20) or higher.** **To support custom remote controller with LIRC, your kernel version should be 3.14.29-56 (2016/​04/​20) or higher.**
Line 83: Line 83:
  
 ===== Registering own remote controller ===== ===== Registering own remote controller =====
 +
 +<WRAP center round important>​
 +Before runing irrecord, please make sure service lircd should release the node, /dev/lirc0.
 +<​code>​
 +root@odroid64:​~#​ sudo kill `pidof lircd`
 +</​code>​
 +https://​forum.odroid.com/​viewtopic.php?​f=141&​t=27593
 +</​WRAP>​
 +
 **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. **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.
 <​code>​ <​code>​
Line 171: Line 180:
 ===== GPIO based IR ===== ===== GPIO based IR =====
  
-If you want to use your extra IR receiver by connecting to GPIO port (ex. one of expantion ​connectors),​ gpio-ir-recv module with LIRC can be used.+If you want to use your extra IR receiver by connecting to GPIO port (ex. one of expansion ​connectors),​ gpio-ir-recv module with LIRC can be used.
  
 <WRAP center round important>​ <WRAP center round important>​
Line 181: Line 190:
  
 ^ IR Receiver ^ C2 Expansion Net ^ Description ^ ^ IR Receiver ^ C2 Expansion Net ^ Description ^
-|IR|Pin#GPIOX.BIT21|IR output ​ |+|IR|Pin#GPIOX.BIT21|IR output ​ |
 |GND|Pin#14 GND|Ground ​ | |GND|Pin#14 GND|Ground ​ |
 |3V3|Pin#17 3.3V Power| 3.3V Power| |3V3|Pin#17 3.3V Power| 3.3V Power|
Line 258: Line 267:
 connect: Connection refused connect: Connection refused
 </​code>​ </​code>​
 +
 +It seems lirc is stpped by systemd caused by an unknown reason and it causes abnormal termination of lirc process.
 +
 +We are trying to fix it and you can use one of the following workarounds until we've done it.
  
 === Workaround (1) === === Workaround (1) ===
 +
 +Add sleep count at the following point.
 +
 +**load_modules() of /​etc/​init.d/​lirc**
 +<​code>​
 +modprobe $mod 2> /dev/null || MODULES_MISSING=true**
 +sleep 1
 +</​code>​
 +
 +<​code>​
 +# vi /​etc/​init.d/​lirc
 +.....
 +.....
 +load_modules ()
 +{
 +        MODULES_MISSING=false
 +
 +        log_daemon_msg "​Loading LIRC modules"​
 +        for mod in $*; do
 +                if [ $mod = "​udev"​ ]; then
 +                        log_end_msg 0
 +                        log_success_msg "​Restarted via udev, don't reload modules"​
 +                        break
 +                else
 +                        modprobe $mod 2> /dev/null || MODULES_MISSING=true
 +                        sleep 1
 +                fi
 +        done
 +        log_end_msg $?
 +
 +        if $MODULES_MISSING;​ then
 +                log_failure_msg "​Unable to load LIRC kernel modules. Verify your"
 +                log_failure_msg "​selected kernel modules in /​etc/​lirc/​hardware.conf"​
 +                START_LIRCMD=false
 +                START_LIRCD=false
 +        fi
 +}
 +</​code>​
  
 === Workaround (2) === === Workaround (2) ===
 +Restart lirc service after booting makes LIRC normal.
 +
 +<​code>​
 +root@odroid64:/​home/​odroid#​ irw
 +connect: Connection refused
 +
 +root@odroid64:/​home/​odroid#​ service lirc restart
 +
 +root@odroid64:/​home/​odroid#​ irw
 +000000004db2738c 00 KEY_ENTER lircd.conf
 +000000004db29966 01 KEY_LEFT lircd.conf
 +000000004db2837c 01 KEY_RIGHT lircd.conf
 +</​code>​
 +
 +You can add auto start daemon as following.
 +
 +<​code>​
 +- auto execution "​service lirc restart"​
 +
 +odroid@odroid64:​~$ su
 +root@odroid64:/​home/​odroid#​ cd /etc/init.d
 +root@odroid64:/​etc/​init.d#​ vi restartlirc
 +
 +#!/bin/sh
 +service lirc restart
 +
 +root@odroid64:/​etc/​init.d#​ chmod 755 restartlirc
 +root@odroid64:/​etc/​init.d#​ cd ../rcS.d
 +root@odroid64:/​etc/​rcS.d#​ ln -s ../​init.d/​restartlirc S90restartlirc
 +root@odroid64:/​etc/​rcS.d#​ reboot
 +</​code>​
  
en/c2_lirc.1468460320.txt.gz ยท Last modified: 2016/07/14 10:08 by joy.cho
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0