This functionality is available on Ubuntu.
This is a schematic example for connecting the IR LED to a GPIO output.
The components are not restricted to the parts and values but they can be different,
so please determine R1 and R2 values by checking the capability of IR LED and transistor specifications
based on your environment and component parts.
We use the following components for test.
For example, Pin #7 (GPIO #249) is used and following instructions will be described with the GPIO value.
LED side | Connector |
---|---|
VCC | Pin #1 - 3.3V Power |
GND | Pin #6 - Ground |
GPIO | Pin #7 - GPIOX.BIT21, GPIO #249 |
http://odroid.com/dokuwiki/doku.php?id=en:c2_hardware#expansion_connectors
For example, Pin #7 (GPIO #83) is used and following instructions will be described with the GPIO value.
LED side | Connector |
---|---|
VCC | Pin #1 - 3.3V Power |
GND | Pin #6 - Ground |
GPIO | Pin #7 - GPIO #83 |
http://odroid.com/dokuwiki/doku.php?id=en:c1_hardware#expansion_connectors
For example, Pin #26 (GPIO #24) is used and following instructions will be described with the GPIO value.
LED side | Connector |
---|---|
VCC | Pin #29 - 1.8V Power |
GND | Pin #28 - Ground |
GPIO | Pin #26 - GPIO #24 |
In case of XU4, voltage level of VDD_IO and GPIO output is 1.8V.
Supposing R2 is 10 Ohm, the actual forward current is around 40mA and voltage difference between P1 and P2 is around 400mV.
http://odroid.com/dokuwiki/doku.php?id=en:xu4_hardware#expansion_connectors
$ sudo apt-get install lirc
Install LIRC package. While installing lirc, you will be asked the device type of IR receiver and transmitter.
Since we will set up later by manual, you can select None.
And for further information, please refer to the following wiki page.
http://odroid.com/dokuwiki/doku.php?id=en:c2_lirc
lirc_odroid module driver is already included by default but, you need to set up hardware.conf and lircd.conf first and then probe the modules with some parameters.
# sudo vi /etc/lirc/hardware.conf
Specify the kernel driver module and its node.
#Chosen IR Transmitter TRANSMITTER="odroid blaster" TRANSMITTER_MODULES="lirc_odroid lirc_dev" TRANSMITTER_DRIVER="" TRANSMITTER_DEVICE="/dev/lirc0" TRANSMITTER_SOCKET="" TRANSMITTER_LIRCD_CONF="" TRANSMITTER_LIRCD_ARGS=""
About lircd.conf, you can refer to the following link.
http://odroid.com/dokuwiki/doku.php?id=en:c2_lirc
And the name in lircd.conf will be used to specify key codes using irsend.
begin remote name odroid bits 16 ..... .....
All necessary configuration is done, you need to install lirc_odroid module and set some parameters.
# The usage of lirc_odroid module lirc_odroid gpio_out_pin=${gpio_number} invert=[0 or 1] softcarrier=[0 or 1]
Supposing to use Pin#7 of ODROID-C2 (GPIO #249),
# service lirc stop # modprobe lirc_dev # modprobe lirc_odroid gpio_out_pin=249 softcarrier=1 invert=1 (automatically, service lirc will be started)
If lirc_odroid module has been loaded and lirc service is running normally, you can get the key list as following.
Please make sure the remote name is same with the description in /etc/lirc/lircd.conf.
#root@odroid64:~# irsend LIST odroid "" irsend: 0000000000009966 KEY_LEFT irsend: 000000000000837c KEY_RIGHT irsend: 00000000000053ac KEY_UP irsend: 0000000000004bb4 KEY_DOWN irsend: 000000000000738c KEY_ENTER irsend: 00000000000041be KEY_HOME irsend: 00000000000011ee KEY_MUTE irsend: 000000000000a35c KEY_MENU irsend: 00000000000059a6 KEY_BACK irsend: 000000000000817e KEY_VOLUMEDOWN irsend: 00000000000001fe KEY_VOLUMEUP irsend: 0000000000003bc4 KEY_POWER
irsend is basic LIRC program to send the key code.
# irsend SEND_ONCE odroid KEY_ENTER
# /etc/lirc/hardware.conf # #Chosen Remote Control REMOTE="None" REMOTE_MODULES="" REMOTE_DRIVER="" REMOTE_DEVICE="" REMOTE_SOCKET="" REMOTE_LIRCD_CONF="" REMOTE_LIRCD_ARGS="" #Chosen IR Transmitter TRANSMITTER="odroid blaster" TRANSMITTER_MODULES="lirc_odroid lirc_dev" TRANSMITTER_DRIVER="" TRANSMITTER_DEVICE="/dev/lirc0" 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=""
begin remote name odroid bits 16 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100 header 9000 4500 one 563 1688 zero 563 564 ptrail 563 pre_data_bits 16 pre_data 0x4DB2 repeat 9000 2250 gap 100000 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
#Chosen Remote Control REMOTE="None" REMOTE_MODULES="meson-ir" REMOTE_DRIVER="" REMOTE_DEVICE="/dev/lirc0" REMOTE_SOCKET="" REMOTE_LIRCD_CONF="" REMOTE_LIRCD_ARGS="--uinput" #Chosen IR Transmitter TRANSMITTER="Home-brew (odroid gpio)" TRANSMITTER_MODULES="lirc_odroid lirc_dev" TRANSMITTER_DRIVER="" TRANSMITTER_DEVICE="/dev/lirc1" TRANSMITTER_SOCKET="" TRANSMITTER_LIRCD_CONF="" TRANSMITTER_LIRCD_ARGS="" ... ...