lirc

package
v3.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package lirc implements InfraRed receiver support through native linux app lirc.

Configuration

lircd MUST be configured via TWO files: /etc/lirc/hardware.conf and /etc/lirc/lircd.conf.

See http://www.lirc.org/ for more details about daemon configuration.

/etc/lirc/hardware.conf

This file contains the interaction between the lircd process and the kernel driver, if any. This is the link between the physical signal and decoding pulses.

/etc/lirc/lircd.conf

This file contains all the known IR codes for the remotes you plan to use and convert into key codes. This means you need to "train" lircd with the remotes you plan to use.

Keys are listed at http://www.lirc.org/api-docs/html/input__map_8inc_source.html

Debugging

Here's a quick recipe to train a remote:

# Detect your remote
irrecord -a -d /var/run/lirc/lircd ~/lircd.conf
# Grep for key names you found to find the remote in the remotes library
grep -R '<hex value>' /usr/share/lirc/remotes/
# Listen and send command to the server
nc -U /var/run/lirc/lircd
# List all valid key names
irrecord -l
grep -hoER '(BTN|KEY)_\w+' /usr/share/lirc/remotes | sort | uniq | less

Raspbian

Please see documentation of package periph/host/rpi for details on how to set it up.

Hardware

A good device is the VS1838. Then you need device driver for hardware accelerated signal decoding, that lircd will then leverage to decode the keypresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is an open port to lirc.

func New

func New() (*Conn, error)

New returns a IR receiver / emitter handle.

func (*Conn) Channel

func (c *Conn) Channel() <-chan ir.Message

Channel implements ir.IR.

func (*Conn) Close

func (c *Conn) Close() error

Close closes the socket to lirc. It is not a requirement to close before process termination.

func (*Conn) Codes

func (c *Conn) Codes() map[string][]string

Codes returns all the known codes.

Empty if the list was not retrieved yet.

func (*Conn) Emit

func (c *Conn) Emit(remote string, key ir.Key) error

Emit implements ir.IR.

func (*Conn) String

func (c *Conn) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL