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/05/13 12:03]
joy.cho [GPIO based IR]
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 170: Line 179:
  
 ===== GPIO based IR ===== ===== GPIO based IR =====
 +
 +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>​
-**GPIO based IR is not supported ​yet with the latest ​Ubuntu version. ​After this function is released, the version ​info will be specified here. **+** IR functionality based on GPIO is supported ​on Ubuntu version ​3.14.29-58 (2016/​05/​18) or higher ​version. **
 </​WRAP>​ </​WRAP>​
 +
 +=== Hardware Example ===
 +The below picture is a sample test environment using a IR receiver module, ROM-WT138LM that is the same module built in ODROID-C2 board.
 +
 +^ IR Receiver ^ C2 Expansion Net ^ Description ^
 +|IR|Pin#7 GPIOX.BIT21|IR output ​ |
 +|GND|Pin#14 GND|Ground ​ |
 +|3V3|Pin#17 3.3V Power| 3.3V Power|
 +
 +{{:​en:​c2_gpiobasedir_part_wiki.png?​130|}}
 +
 +{{:​en:​c2_gpiobasedir_wiki.png?​350|}}
 +
  
 === hardware.conf for GPIO based IR === === hardware.conf for GPIO based IR ===
Line 232: Line 256:
 === lircd.conf with Hardkernel IR remote controller === === lircd.conf with Hardkernel IR remote controller ===
 If you use Hardkernel IR remote controller, no modification is needed with the aforementioned default lircd.conf file for ODROID-C2. If you use Hardkernel IR remote controller, no modification is needed with the aforementioned default lircd.conf file for ODROID-C2.
 +
 +
 +===== Known Issue of LIRC on ODROID-C2 =====
 +During booting, the operation of loading LIRC modules fails frequently, so you can see IR operation doesn'​t work.
 +
 +Under this situation, the following message comes and there is no input event from IR.
 +
 +<​code>​
 +# irw
 +connect: Connection refused
 +</​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) ===
 +
 +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) ===
 +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.1463110382.txt.gz ยท Last modified: 2016/05/13 12:03 by joy.cho
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0