LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-13-2008, 06:16 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Rep: Reputation: 30
lirc on ubuntu: can't get it going


Hello, I have a mceusb2 remote and dual blaster that has been working just nicely (except for one of the blaster ports), and so i recently got a serial blaster (to control my second cable box) for my ubuntu feisty setup. After following the ubuntu instructions page located here: https://help.ubuntu.com/community/InstallLirc/Feisty, i now am unable to use my remote at all. How great!

So basically, i can't use either of my cable boxes now. Also, we basically can't use the mythbox since the remote doesn't work.

Below are the following:
1. channel change script
2. /etc/lirc/hardware.conf file
3. /etc/init.d/lirc file

Code:
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd

LIRCD_ARGS="-d /dev/lirc1 --output=/dev/lircd1 --listen"
LIRCD2_ARGS="-d /dev/lirc0 --output=/dev/lircd --connect=localhost:8765 --pidfile=/var/run/lircd2.pid"

#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

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER=""
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
DEVICE="/dev/lirc0 /dev/lirc1"
MODULES="lirc_dev lirc_serial lirc_mceusb2"
###MODULES="lirc_mceusb2"

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""
Code:
#!/bin/sh
#irsend SET_TRANSMITTERS 1   # this line commented out only for serial blaster
REMOTE_NAME=SAE8000
#/dev/lircd0 is the serial blaster, /dev/lircd is the usb blaster...i think
irsend --device=/dev/lircd0 SEND_ONCE $REMOTE_NAME select
sleep 0.2
for digit in $(echo $1 | sed -e 's/./& /g'); do
irsend --device=/dev/lircd0 SEND_ONCE $REMOTE_NAME $digit
sleep 0.2
done
irsend --device=/dev/lircd0 SEND_ONCE $REMOTE_NAME select
Code:
#! /bin/sh
#
#

load_modules ()
{
	local MODULES_MISSING=false

	for mod in $*
	do
		modprobe -k $mod 2> /dev/null || MODULES_MISSING=true
	done

	if $MODULES_MISSING; then
		echo "#####################################################"
		echo "## I couldn't load the required kernel modules     ##"
		echo "## You should install lirc-modules-source to build ##"
		echo "## kernel support for your hardware.               ##"
		echo "#####################################################"
		echo "## If this message is not appropriate you may set  ##"
		echo "## LOAD_MODULES=false in /etc/lirc/hardware.conf   ##"
		echo "#####################################################"
		START_LIRCMD=false
		START_LIRCD=false
	fi

	if test -x /sbin/udevsettle
	then
		if ! /sbin/udevsettle; then
		  echo "timeout waiting for devices to be ready"
		fi
	fi
}

build_args ()
{
	local ARGS="$*"
	
    ## Try to find an lirc device.
    ## udev uses /dev/lirc0
    ## static dev uses /dev/lirc
    ## devfs uses /dev/lirc/0
    if [ -z "$DEVICE" ]; then
    	for dev in /dev/lirc0 /dev/lirc /dev/lirc/0; do
	    	if [ -c $dev ]; then
				DEVICE="$dev"
				break
			fi
		done
	fi
	
	if [ -n "$DEVICE" ] && [ "$DEVICE" != "none" ]; then
		ARGS="--device=$DEVICE $ARGS"
	fi
	if [ -n "$DRIVER" ] && [ "$DRIVER" != "none" ]; then
		ARGS="--driver=$DRIVER $ARGS"
	fi
	echo $ARGS
}

test -f /usr/sbin/lircd || exit 0
test -f /usr/sbin/lircmd || exit 0
#test -f /etc/lirc/lircd.conf || exit 0
#test -f /etc/lirc/lircmd.conf || exit 0

START_LIRCMD=true
START_LIRCD=true

if [ ! -f /etc/lirc/lircd.conf ] \
	|| grep -q "^#UNCONFIGURED"  /etc/lirc/lircd.conf;then
	if [ "$1" = "start" ]; then
          echo "##################################################"
          echo "## LIRC IS NOT CONFIGURED                       ##"
          echo "##                                              ##"
          echo "## read /usr/share/doc/lirc/html/configure.html ##"
          echo "##################################################"
	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

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


case "$1" in
  start)
    if [ "$LOAD_MODULES" = "true" ] && [ "$START_LIRCD" = "true" ]; then
	load_modules $MODULES
    fi
    echo -n "Starting lirc daemon:"
    if $START_LIRCD; then
      echo -n " lircd"



LIRCD_ARGS=`build_args $LIRCD_ARGS`
LIRCD2_ARGS=`build_args $LIRCD2_ARGS`
start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- $LIRCD_ARGS \
                < /dev/null
      /usr/sbin/lircd $LIRCD2_ARGS \
               < /dev/null  
               
               
               
               
    fi
    if $START_LIRCMD; then
      echo -n " lircmd"
      start-stop-daemon --start --quiet --exec /usr/sbin/lircmd \
      		< /dev/null
    fi
    echo "."
    ;;
  stop)
    echo -n "Stopping lirc daemon:"
    echo -n " lircmd"
    start-stop-daemon --stop --quiet --exec /usr/sbin/lircmd
    echo -n " lircd"
    start-stop-daemon --stop --quiet --exec /usr/sbin/lircd
    echo "."
    ;;
  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
    $0 start
    ;;
  *)
    echo "Usage: /etc/init.d/lircd {start|stop|reload|restart|force-reload}"
    exit 1
esac

exit 0

Please let me know what i'm doing wrong. I have been searching and searching and trying all sorts of stuff. Nothing seems to work. Why is lirc so difficult to get going?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ubuntu + mythtv + lirc - how easy it is? Carpo Ubuntu 2 08-27-2007 07:57 AM
Help with LIRC energiya Linux - Software 6 04-13-2007 02:50 AM
LIRC on an HP NC6000 Laptop on Ubuntu 6.06 vvarder Linux - Hardware 0 11-04-2006 10:53 PM
lirc in ubuntu lowebb Linux - Hardware 2 08-30-2006 01:41 PM
LIRC and 2.6.3 hoborocks Linux - Hardware 3 08-14-2004 10:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration