Lircd (need help)

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read this

Lircd (need help)

Postby RickMura on Fri Oct 02, 2009 1:52 pm

Hi all,

I've a TVCard ENLTV-FM and trying to configure IR Control.
The Lirc (Lircd) is installed and running but I don't know how to do more.
In a test I used the inputlircd and the control is sending commands (VolUp, VolDown, Ch+ and Ch-), but in Lircd I don't get any commands. (I uninstall inputlircd after tests).

This is my configuration files:
## /etc/lirc/lircd.conf
#This configuration has been automatically generated via
#the Ubuntu LIRC package maintainer scripts.
#
#It includes the default configuration for the remote and/or
#transmitter that you have selected during package installation.
#
#Feel free to add any custom remotes to the configuration
#via additional include directives or below the existing
#Ubuntu include directives from your selected remote and/or
#transmitter.

#Configuration for the Encore ELTV-FM remote:
include "/usr/share/lirc/remotes/encore/enltv.conf"

#Configuration for the Command IR : Direct TV Receiver transmitter:
include "/usr/share/lirc/transmitters/directtv/general.conf"


## / etc/init.d/lirc
#! /bin/sh
### BEGIN INIT INFO
# Provides: lirc
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts LIRC daemon.
# Description: LIRC is used to control different
# infrared receivers and transceivers.
### END INIT INFO

load_modules ()
{
local 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
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
}

build_remote_args ()
{
local REMOTE_ARGS="$*"

#For remote only detection support, we need
#both REMOTE_DEVICE and TRANSMITTER_DEVICE undefined
if [ -z "$REMOTE_DEVICE" ] && [ -z "$TRANSMITTER_DEVICE" ]; then
for dev in /dev/lirc0; do
if [ -c $dev ]; then
REMOTE_DEVICE="$dev"
break
fi
done
fi

#If we have a REMOTE_DEVICE or REMOTE_DRIVER defined (either because no devices
#were defined, OR if we explicitly did), then populate REMOTE_ARGS
if [ ! -z "$REMOTE_DEVICE" ] || [ ! -z "$REMOTE_DRIVER" ]; then
if [ -n "$REMOTE_DEVICE" ] && [ "$REMOTE_DEVICE" != "none" ]; then
REMOTE_ARGS="--device=$REMOTE_DEVICE $REMOTE_ARGS"
fi
if [ -n "$REMOTE_DRIVER" ] && [ "$REMOTE_DRIVER" != "none" ]; then
REMOTE_ARGS="--driver=$REMOTE_DRIVER $REMOTE_ARGS"
fi

#Now, if we ALSO have a transmitter defined, add some args
#To make the first lircd listen up
if [ ! -z "$TRANSMITTER_DEVICE" ] || [ ! -z "$TRANSMITTER_DRIVER" ]; then
REMOTE_ARGS="$REMOTE_ARGS --output=/dev/lircd --listen"
fi
fi
echo $REMOTE_ARGS
}

build_transmitter_args ()
{
local TRANSMITTER_ARGS="$*"

#Transmitters must be explicitly be defined
if [ ! -z "$TRANSMITTER_DEVICE" ] || [ ! -z "$TRANSMITTER_DRIVER" ]; then
if [ -n "$TRANSMITTER_DEVICE" ] && [ "$TRANSMITTER_DEVICE" != "none" ]; then
TRANSMITTER_ARGS="--device=$TRANSMITTER_DEVICE $TRANSMITTER_ARGS"
fi
if [ -n "$TRANSMITTER_DRIVER" ] && [ "$TRANSMITTER_DRIVER" != "none" ]; then
TRANSMITTER_ARGS="--driver=$TRANSMITTER_DRIVER $TRANSMITTER_ARGS"
fi

#Now, if we ALSO have a remote defined, add some args
#To make the second lircd connect
if [ ! -z "$REMOTE_DEVICE" ] || [ ! -z "$REMOTE_DRIVER" ]; then
TRANSMITTER_ARGS="$TRANSMITTER_ARGS --output=/dev/lircd1 --connect=localhost:8765 --pidfile=/var/run/lircd1.pid"
fi
fi
echo $TRANSMITTER_ARGS
}

. /lib/lsb/init-functions

test -f /usr/sbin/lircd || exit 0
test -f /usr/sbin/lircmd || exit 0

START_LIRCMD=true
START_LIRCD=true

if [ -f /etc/lirc/hardware.conf ];then
. /etc/lirc/hardware.conf
fi

if [ ! -f /etc/lirc/lircd.conf ] \
|| grep -q "^#UNCONFIGURED" /etc/lirc/lircd.conf;then
if [ "$1" = "start" ]; then
log_success_msg "No valid /etc/lirc/lircd.conf has been found."
log_success_msg "Remote control support has been disabled."
log_success_msg "Reconfigure LIRC or manually replace /etc/lirc/lircd.conf to enable."
fi
START_LIRCD=false
START_LIRCMD=false
fi
if [ ! -f /etc/lirc/lircmd.conf ] \
|| grep -q "^#UNCONFIGURED" /etc/lirc/lircmd.conf;then
START_LIRCMD=false
fi

case "$1" in
start)
if [ "$LOAD_MODULES" = "true" ] && [ "$START_LIRCD" = "true" ]; then
load_modules $2 $REMOTE_MODULES $TRANSMITTER_MODULES $MODULES
fi
if $START_LIRCD; then
log_daemon_msg "Starting remote control daemon(s) : LIRC "
REMOTE_LIRCD_ARGS=`build_remote_args $REMOTE_LIRCD_ARGS`
TRANSMITTER_LIRCD_ARGS=`build_transmitter_args $TRANSMITTER_LIRCD_ARGS`

#if we have a remote defined, it is primary process
if [ ! -z "$REMOTE_LIRCD_ARGS" ]; then
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- $REMOTE_LIRCD_ARGS < /dev/null
log_end_msg $?

#now if we additionally have a transmitter defined, it is secondary process
if [ ! -z "$TRANSMITTER_LIRCD_ARGS" ]; then
/usr/sbin/lircd $TRANSMITTER_LIRCD_ARGS < /dev/null
fi
elif [ ! -z "$TRANSMITTER_LIRCD_ARGS" ]; then
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- $TRANSMITTER_LIRCD_ARGS < /dev/null
else
log_end_msg 1
fi
fi
if $START_LIRCMD; then
log_daemon_msg "Starting remote control mouse daemon : LIRCMD "
start-stop-daemon --start --quiet --exec /usr/sbin/lircmd < /dev/null
log_end_msg $?
fi
;;
stop)
if $START_LIRCMD; then
log_daemon_msg "Stopping remote control mouse daemon: LIRCMD"
start-stop-daemon --stop --quiet --exec /usr/sbin/lircmd
log_end_msg $?
fi
if $START_LIRCD; then
log_daemon_msg "Stopping remote control daemon(s): LIRC"
start-stop-daemon --stop --quiet --exec /usr/sbin/lircd
log_end_msg $?
fi
;;
reload|force-reload)
if $START_LIRCD; then
start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/lircd
fi
if $START_LIRCMD; then
start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/lircmd
fi
;;
restart)
$0 stop
#passes parameter $2 which is possibly our udev paramater
$0 start $2
;;
*)
echo "Usage: /etc/init.d/lircd {start|stop|reload|restart|force-reload}"
exit 1
esac

exit 0


# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Encore ELTV-FM"
REMOTE_MODULES="lirc_dev lirc_i2c"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_LIRCD_CONF="encore/enltv.conf"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="Command IR : Direct TV Receiver"
TRANSMITTER_MODULES="lirc_dev lirc_cmdir"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE="/dev/lirc1"
TRANSMITTER_LIRCD_CONF="directtv/general.conf"
TRANSMITTER_LIRCD_ARGS=""

#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=""


## //usr/share/lirc/remotes/encore/enltv.conf
begin remote
name enltv
bits 16
eps 30
aeps 100
one 0 0
zero 0 0
gap 195847
pre_data_bits 16
pre_data 0x8001

begin codes
next 0x0197
ok 0x001C
vol_down 0x00AE
09 0x0067
08 0x006C
07 0x0069
hide 0x006A
winstart 0x0066
recall 0x0175
v_set 0x0179
ch_down 0x0189
music 0x0188
tv/av 0x016F
<-- 0x0001
desktop 0x0020
06 0x000F
04 0x00E3
--> 0x008B
05 0x0174
timeshift 0x0167
record 0x00A7
pause_c 0x00CF
stop 0x0080
next2stop 0x00D4
00 0x00A8
fastforward 0x00D0
menu 0x019C
skipforward 0x0197
ch_up 0x016C
pause 0x00D5
dvdlang 0x0170
dvdtext 0x0184
shut 0x0190
main 0x0175
sap 0x0161
teletext 0x0094
ap1 0x018E
ap2 0x018F
ap4 0x0191
03 0x0002
2 0x0003
-/-- 0x0004
snap 0x0005
5 0x0006
mute 0x0007
7 0x0008
8 0x0009
9 0x0004
02 0x000A
v_def 0x000B
01 0x018B

end codes
end remote


# /usr/share/lirc/transmitters/directtv/general.conf
#
# this config file was automatically generated
# using lirc-0.8.1-CVS-pvr150(default) on Thu Nov 23 11:12:04 2006
#
# contributed by Chris Jacobs
#
# brand: DirecTV HD20-100
# model no. of remote control: HD20-100
# devices being controlled by this remote: DirecTV HD20-100
#

begin remote

name directtv
flags RAW_CODES
eps 30
aeps 100

ptrail 613
repeat 0 0
gap 29767

begin raw_codes

name 1
6000 1150 1250 1100 650 550
650 550 650 550 650 500
650 1150 650 550 650 1150
600

name 2
6000 1100 1250 1150 650 550
650 550 600 550 650 550
1250 550 650 550 1200 550
650

name 3
6000 1150 1250 1100 650 550
650 550 650 550 650 550
1200 1150 650 550 1250 1150
600

name 4
6000 1150 1250 1150 650 500
650 550 650 550 650 1150
650 500 650 550 1250 1150
650

name 5
6000 1150 1250 1100 650 550
650 550 650 500 650 1150
650 1150 650 1150 600 550
650

name 6
6000 1150 1250 1150 650 500
650 550 650 550 650 1150
1200 550 650 1150 650 1150
600

name 7
6000 1100 1250 1150 650 550
650 500 650 550 650 1150
1250 1100 650 1150 1250 550
650

name 8
6000 1150 1250 1100 650 550
650 550 650 550 1200 550
650 550 650 1150 1200 550
650

name 9
6000 1100 1300 1100 650 550
650 550 650 500 1250 550
650 1150 650 1150 1200 1150
650

name 0
6000 1150 1250 1150 650 500
650 550 650 1150 650 550
650 1100 650 1150 1250 550
650

name dash
6000 1100 1300 1100 650 550
650 550 650 1100 650 550
1250 550 650 1100 1250 1150
650

name last
6000 1100 1300 1100 650 550
650 550 650 500 1250 1150
1250 1150 1200 1150 650 550
650

name guide
6000 1100 1300 1100 650 550
650 550 1250 500 1250 550
650 550 650 550 600 550
650

name up
6000 1100 1300 1100 650 550
650 550 1250 500 650 550
650 1150 1250 500 1250 1150
650

name down
6000 1150 1250 1100 650 550
650 550 1250 500 650 550
1250 550 1250 1150 600 550
650

name left
6000 1150 1250 1150 650 500
700 500 1250 550 650 550
1250 1100 1250 1150 650 1150
600

name right
6000 1150 1250 1100 650 550
650 550 1250 500 650 1150
650 550 1250 1100 650 1150
650

name select
6000 1150 1250 1100 700 500
650 550 1250 550 650 1100
650 1150 1250 1150 1200 550
650

name action
6000 1150 1250 1150 650 500
650 550 1250 550 1250 550
600 1150 650 550 650 1150
650

name list
6050 1100 1250 1150 650 500
650 550 1250 550 1250 550
1200 550 650 550 1250 550
650

name info
6000 1100 1250 1150 650 550
650 500 1250 550 1250 1150
1250 500 650 1150 650 1150
650

name back
6000 1150 1250 1150 650 500
700 500 1250 550 650 1150
1200 1150 650 550 650 550
650

name power
6000 1150 1250 1100 650 550
1250 550 650 550 650 500
650 550 1250 1150 1250 500
650

name exit
6000 1150 1250 1150 650 500
650 550 1250 550 650 1150
1200 550 1250 1150 1250 1100
650

name ch-
6000 1100 1250 1150 650 550
650 500 650 550 1250 1150
1250 550 1200 550 1250 1150
650

name ch+
6000 1100 1300 1100 650 550
650 500 700 500 1250 1150
650 1150 1200 550 1250 550
650

end raw_codes

end remote
RickMura
Level 1
Level 1
 
Posts: 6
Joined: Mon Feb 18, 2008 8:54 am

Linux Mint is funded by ads and donations.
 

Re: Lircd (need help)

Postby Husse on Wed Oct 07, 2009 7:11 am

I don't know much about this and I don't have a remote used with my computer
Have you checked this topic?
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19714
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden


Return to Hardware Support

Who is online

Users browsing this forum: Google [Bot] and 7 guests