LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2007, 06:09 PM   #1
Chiefl
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Rep: Reputation: 0
Starting lirc with MythTV Frontend at Bootup


I have installed MythTV frontend and when it boots, lirc does not load and my remote does not function. If I quit the frontend, use a terminal and enter:
sudo lircd -H udp -d 5000
and then run MythTV from the applications menu, the remote works fine. Is there a way to load lirc at the same time as MythTV?
I have Ubuntu Feisty installed on both my frontend and backend computers along with a HDHomerun TV tuner.
I tried to use:
update-rc.d /usr/sbin/lircd defaults
to get lircd to run at startup but I get a result that says the file does not exist.
I am new to Linux and am a little south of lost. Any assistance would be appreciated.
 
Old 09-07-2007, 07:03 PM   #2
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
I had a bit of trouble with this and what I did in the end was put the lirc commands I needed to start it up into the boot.local (or whatever it's called in your distro) file. In SuSE it's in /etc/init.d directory.
 
Old 09-10-2007, 08:19 PM   #3
Chiefl
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks! I found the file in Ubuntu, rc.local. I have no idea on how to add the lirc commands to the file. Any suggestions would be appreciated.
 
Old 09-11-2007, 03:07 AM   #4
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
I just put the command needed to run lircd (without sudo because it gets run by system at startup) in my boot.local. Therefore looking at your command it should probably be

Quote:
lircd -H udp -d 5000 &
Not sure whether you need the trailing & but that's similar to what I put in mine.
 
Old 09-12-2007, 10:45 PM   #5
Chiefl
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the help. I tried every way I could think of to enter the command into my rc.local and nothing worked. My file is pasted below. Where would I place the lircd -H udp 5000 & ? I did read someplace that the "&" indicates the process will run in the background. Any assistance would be appreciated.

[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions

do_start() {

if [ -x /etc/rc.local ]; then
log_begin_msg "Running local boot scripts (/etc/rc.local)"
/etc/rc.local
log_end_msg $?
fi
}

case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;

exit 0
esac
 
Old 09-13-2007, 04:07 AM   #6
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
I don't think the file you posted is /etc/rc.local because the do_start() function is testing for the presence of /etc/rc.local and then running it if present. It looks to be the script that calls rc.local.

Quote:
Originally Posted by Chiefl View Post

do_start() {

if [ -x /etc/rc.local ]; then
log_begin_msg "Running local boot scripts (/etc/rc.local)"
/etc/rc.local
log_end_msg $?
fi
}
 
Old 09-13-2007, 09:35 PM   #7
Chiefl
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
You are absolutely correct. The rc.local file in the etc directory is pasted below. The file in the previous post was in the /etc/init.d/ directory. How would I add the lircd -H udp 5000 command to this file? That is if it is the correct file to do what I set out to accomplish. Thank you for the assistance.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.

exit 0
 
Old 09-14-2007, 03:41 AM   #8
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
Just put it into the file before the exit statement - like so:
Quote:
Originally Posted by Chiefl View Post

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
lircd -H udp 5000 &
exit 0
 
Old 09-16-2007, 02:45 PM   #9
Chiefl
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks. I placed the command in the file and then rebooted and get the following from the daemon log:

lircd-0.8.2-CVS[4903]: accepted new client on /dev/lircd
lircd-0.8.2-CVS[4903]: could not get file information for /dev/lirc
lircd-0.8.2-CVS[4903]: default_init(): No such file or directory
lircd-0.8.2-CVS[4903]: caught signal

I did some searching and found several references to a lirc0 file and the only file I have in the dev folder is lirc.

I am at loss as to where to go from here.
 
Old 09-19-2007, 02:25 PM   #10
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
My lircd command is a bit different from yours, but once I went through the mythtv and lirc docs I managed to get it going and was able once I'd done the initial lircd command to use irw to be able to see what codes were generated by pressing buttons. Once I'd then set up the conf files so that the right codes were mapped to Mythtv all I then had to do was put the lircd command in my boot.local file. Therefore I'm a bit puzzled why your lircd command doesn't work in your boot file if it works on its own in a shell.
 
Old 09-22-2007, 11:39 AM   #11
Chiefl
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks. I have been out of town for the week and after reading your reply I have decided to start over. I tried several suggestions and think I may have entered something along the way that has created a problem of my own making. I shall run killdisk to be sure I get rid of everything and start over. I shall post the results this weekend.
 
Old 09-23-2007, 09:02 PM   #12
paradox101
Member
 
Registered: Nov 2005
Distribution: SUSE 10.x
Posts: 39

Rep: Reputation: 15
Quote:
Originally Posted by andrewdodsworth View Post
My lircd command is a bit different from yours, but once I went through the mythtv and lirc docs I managed to get it going and was able once I'd done the initial lircd command to use irw to be able to see what codes were generated by pressing buttons. Once I'd then set up the conf files so that the right codes were mapped to Mythtv all I then had to do was put the lircd command in my boot.local file. Therefore I'm a bit puzzled why your lircd command doesn't work in your boot file if it works on its own in a shell.
I am running OpenSuSe 10.2 and I am having the same problem. IRW shows the codes. I have the 3 lirc* files in /dev. but the remote does not work in Mythtv.

I added to /etc/init.d/boot.local
/sbin/modprobe lirc_dev
/sbin/modprobe imon_pad <-- doesn't work
/sbin/modprobe lirc_imon <-- works

Still, Mythtv doesn't seem to want to let the remote work.

I have lircd_conf in /etc
I have lircrc in /home../../.mythtv

ideas?
 
Old 09-23-2007, 09:14 PM   #13
paradox101
Member
 
Registered: Nov 2005
Distribution: SUSE 10.x
Posts: 39

Rep: Reputation: 15
Update

Update..

Looking at the MythFrontend startup revealed:

:Bad file format: Unable to read /home/../../.mythtv/lircrc

I chmod' lircrc 777

Ideas?
 
Old 09-26-2007, 08:12 AM   #14
Chiefl
LQ Newbie
 
Registered: Sep 2007
Posts: 10

Original Poster
Rep: Reputation: 0
I started from scratch and have now changed my problem. First off to get lirc to run at start up I added a line to my etc/rc.local file.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Lirc run at start up
lircd -H udp -d 5000 &

exit 0

I also changed the /etc/lirc/hardware.conf file

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=""

#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.
# I ADDED THIS UDP
DRIVER="udp"
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
# I ALSO ADDED THE /DEV/LIRCD TO THIS ENTRY
DEVICE="/dev/lircd"
MODULES=""

# Default configuration files for your hardware if any
# I ADDED THE FILE LOCATION FOR MY LIRCD.CONF FILE
LIRCD_CONF="/etc/lirc/lircd.conf"
LIRCMD_CONF=""

After all of that I now have lirc running at boot up but I cannot get mythtv to respond at any time. I also do not get any response running irw. The cursor stays in the irw mode until I press Ctrl c.

I think closer but still no cigar.[/FONT]
 
Old 09-26-2007, 07:04 PM   #15
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
My hardware lirc file looks like:

Code:
## Path:           Hardware/Lirc
## Description:    lirc (infrared remote control) configuration
## ServiceRestart: lirc

## Type:           string
## Default:        "660"
#
# permissions for /dev/lircd
#
LIRCD_DEV_PERMISSIONS="660"

## Type:        string
## Default:     "root:video"
#
# owner and group for /dev/lircd
#
LIRCD_DEV_OWNER="root:video"

## Type:        string
## Default:     ""
#
# use given driver
#
LIRCD_DRIVER=""

## Type:        string
## Default:     ""
#
# read from given device
#
LIRCD_DEVICE="/dev/lirc"

## Type:        string(lirc_bt829,lirc_gpio,lirc_i2c,lirc_it87,lirc_parallel,lirc_sir,ir-kbd-i2c,ir-kbd-gpio)
## Default:     ""
#
# load given lirc driver module
#
LIRC_MODULE=""

## Type:        string
## Default:     ""
#
# listen for network connections on specified port.
# WARNING: don't use this on a machine with an internet
# connection as lircd is running as root!
# 
LIRCD_LISTENPORT=""

## Type:        string
## Default:     ""
#
# connect lircd to specified host
#
LIRCD_CONNECT=""
The command I need to run either from shell or in boot.local is:

Code:
lircd -H dev/input -d /dev/input/event3 -n &
And this is what I get running irw and pressing a few keys:

Code:
# irw
00000000800100d0 00 Skip hauppauge_nova_t_uk
0000000080010006 00 5 hauppauge_nova_t_uk
000000008001000b 00 0 hauppauge_nova_t_uk
0000000080010073 00 VolumeUp hauppauge_nova_t_uk
00000000800100ae 00 Back hauppauge_nova_t_uk
000000008001019c 00 PreviousChannel hauppauge_nova_t_uk
I found out I needed /dev/input/event3 from reading the MythTV lirc stuff - can't quite remember where but somewhere it says how to determine which event number to use.

Still sometimes a bit erratic on startup - something to do with my audio card I think - but I found that if irw doesn't work then the remote doesn't work so that's a good test.

There's also a lircd.conf file that contains the mappings, mine looks like :

Code:
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.7.1pre2(any) on Sat Sep 17 01:00:56 2005
#
# contributed by 
#
# brand:                       lircd.conf.kernel-2.6.13.1.conf
# model no. of remote control: 
# devices being controlled by this remote:
#

begin remote

  name  hauppauge_nova_t_uk
  bits           16
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   16
  pre_data       0x8001
  gap          135803
  toggle_bit      0


      begin codes
          Power                    0x0074
          Go                       0x0161
          TV                       0x0179
          Videos                   0x0189
          Music                    0x0188
          Pictures                 0x016F
          Guide                    0x016D
          Radio                    0x0181
          Up                       0x0067
          Left                     0x0069
          Right                    0x006A
          Down                     0x006C
          OK                       0x001C
          Back                     0x00AE
          Menu                     0x008B
          VolumeUp                 0x0073
          VolumeDown               0x0072
          PreviousChannel          0x019C
          Mute                     0x0071
          ChannelUp                0x0192
          ChannelDown              0x0193
          Record                   0x00A7
          Stop                     0x0080
          Replay                   0x00A8
          Play                     0x00CF
          Skip                     0x00D0
          PreviousTrack            0x00A5
          Pause                    0x0077
          NextTrack                0x00A3
          1                        0x0002
          2                        0x0003
          3                        0x0004
          4                        0x0005
          5                        0x0006
          6                        0x0007
          7                        0x0008
          8                        0x0009
          9                        0x000A
          0                        0x000B
          Text                     0x0184
          Subtitles                0x0172
          Red                      0x018E
          Green                    0x018F
          Yellow                   0x0190
          Blue                     0x0191
      end codes

end remote
 
  


Reply

Tags
lirc, mythtv


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:57 AM
MythTv: Frontend can not properly open recordings: File path error to the master jwstric2 Linux - Software 3 06-03-2007 04:18 PM
lirc and mythtv scales Linux - Hardware 1 06-15-2006 05:25 PM
Remote mythtv frontend can't connect to backend raytheyounger Linux - Software 2 05-27-2006 10:09 PM
mythtv frontend can't play recorded shows from main computer LiquidSlumber Linux - Software 2 02-12-2006 12:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:36 PM.

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