LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-14-2007, 05:03 PM   #1
rhauff
LQ Newbie
 
Registered: Nov 2003
Location: Minnesota, USA
Distribution: VectorLinux, Xubuntu
Posts: 25

Rep: Reputation: 15
LIRC (linux remote control) isn't setting up /dev properly, udev problem?


I've been tearing my hair out for days, and Googled for hours on this one! Apparently that's par for the course with LIRC.
(This is very long and the LIRC stuff probably of no interest/comprehension unless you have used it.) My MAIN question here is about the udev part, which I've never touched before, and why the /dev files aren't getting created. This is on Vector Linux 5.8 (Slackware 11 based)

Anyway, I just got an ATI Remote Wonder RF/USB remote. I plugged it in, and right off it's detected as:
input: ATI/X10 RF USB Remote Control(0bc7,0004) as /class/input/input4

and the module "ati_remote" is automatically loaded. It works as a mouse replacement (up to 60' away!) immediately, no configuration required whatsoever, and the a-c letters and 0-9 characters type in a terminal!

My goal however, is to run XMMS from another room. I've read I can use xmodmap and map some of the keys to run xmms, but the way I understand it, I would have to make sure that xmms was the selected window before I left the computer for this to work, and I don't want to worry about that. What I'm trying now is to setup LIRC and the lirc-xmms plugin. I've compiled them both from source, lirc-0.8.2 and lirc-xmms-plugin-1.4. Next I
1. Installed a proper /etc/lircd.conf for my ATI remote (part#5000015900A)
2. Copied
### lirc dev entries
KERNEL=="lirc[0-9]*", NAME="lirc/%n", MODE="0666", SYMLINK+="%k"
to the end of /etc/udev/rules.d/udev.rules
3. Edited an /etc/rc.d/rc.lircd file which starts the daemon lircd:
#!/bin/sh
# Start/stop/restart the LIRC daemon:

#
# To use this daemon, you need to create a file called /etc/lircd.conf
# which shows the mapping of IR signals to buttons on your remote. Many
# remote controls have already been mapped and can be found in
# /usr/share/lirc/remotes. Just copy the file for your remote to
# /etc/lircd.conf. Install the lirc-remotes packages to get config files
# for remotes not covered by the base lirc package. If your remote isn't
# in lirc-remotes, you can create a new config using the 'irrecord' tool.
# See the man page for more info.
#
# You will also need a file mapping IR signals from your remote control to
# applications. This file can be located at /etc/lircrc or $HOME/.lircrc.
# A simple one has been included at /etc/lircrc for xine and xmms to get
# you started. You'll need a xine package that's been compiled with the
# --enable-lirc option (not the default Slackware package) and for xmms
# you'll need the lirc-xmms-plugin which works with the default Slackware
# xmms.
#
# I've only worked with xmms and xine on a laptop IrDA port, so there
# are probably many areas for improvement in this package. I had
# problems compiling under 2.4 so this package is 2.6 only (from /extra).
# If you have suggestions for improving this package, send me a note,
# thanks!
#
# cjm <cj@meidlinger.org> 28 Nov 2006 initial version
#
#

make_devices ()
{
if [ ! -e /dev/lirc ]; then
mknod /dev/lirc c 61 0
chown root.root /dev/lirc
chmod 660 /dev/lirc
fi
if [ ! -e /dev/lirc0 ]; then
mknod /dev/lirc0 c 61 0
chown root.root /dev/lirc0
chmod 660 /dev/lirc0
fi
if [ ! -e /dev/lirc/0 ]; then
mknod /dev/lirc/0 c 61 0
chown root.root /dev/lirc/0
chmod 660 /dev/lirc/0
fi
if [ ! -e /dev/lircd ]; then
mknod /dev/lircd p
chown root.root /dev/lircd
chmod 666 /dev/lircd
fi
if [ ! -e /dev/lircm ]; then
mknod /dev/lircm p
chown root.root /dev/lircm
chmod 666 /dev/lircm
fi
}

lircd_start() {
# clear serial port if necessary
#
# COM1
# setserial /dev/ttyS0 uart none
#
# COM2
# setserial /dev/ttyS1 uart none

# since this service conflicts with IrDA services, we'll load and
# unload modules here in the rc script. If you have a dedicated IR
# receiver, you can load modules in /etc/rc.d/rc.modules and not
# worry about loading/unloading here.

# standard laptop IrDA port
#
# COM1
# /sbin/modprobe lirc_sir io=0x03f8 irq=4
#
# COM2
# /sbin/modprobe lirc_sir io=0x02f8 irq=3

# homebrew serial port receiver
# /sbin/modprobe lirc_serial

# check for loaded modules before starting the daemon
lircmod=`lsmod | grep lirc_dev`
if [ -z "$lircmod" ] ; then
echo " "
echo "You need to load lirc modules before starting this"
echo "daemon. Please edit either"
echo " /etc/rc.d/rc.lircd"
echo " or"
echo " /etc/rc.d/rc.modules"
echo " "
else
/usr/sbin/lircd --device=/dev/lirc/0
fi
}

lircd_stop() {
killall lircd
rm /dev/lircd

# remove modules if needed for IrDA operations
#
# laptop IrDA port
# /sbin/rmmod lirc_sir lirc_dev
#
# homebrew serial port
# /sbin/rmmod lirc_serial lirc_dev
}

lircd_restart() {
lircd_stop
sleep 2
lircd_start
}

lircd_nodaemon() {
lircmod=`lsmod | grep lirc_dev`
if [ -z "$lircmod" ] ; then
echo " "
echo "You need to load lirc modules before starting this"
echo "daemon. Please edit either"
echo " /etc/rc.d/rc.lircd"
echo " or"
echo " /etc/rc.d/rc.modules"
echo " "
else
/usr/local/sbin/lircd --nodaemon --device=/dev/lirc/0
fi
}

case "$1" in
'start')
lircd_start
;;
'stop')
lircd_stop
;;
'restart')
lircd_restart
;;
'nodaemon')
lircd_nodaemon
;;
*)
echo "usage $0 start|stop|restart|nodaemon"
esac

End of rc.lircd

End of configuration & setup.

Now I tried both
# /etc/rc.d/rc.udev restart
and rebooting. I am starting lircd with # /etc/rc.d/rc.lircd nodaemon (I guess it should start on it's own during bootup if the remote is plugged in). I get the message:

lircd: lircd(atiusb) ready

However, the device files /dev/lirc0 and /dev/lirc/0 aren't getting made. So, when I start irw, a test app. which calls lircd, I get the following message from lircd, which then dies:

lircd: accepted new client on /dev/lircd
lircd: could not get file information for /dev/lirc/0
lircd: default_init(): Not a directory
lircd: caught signal
/etc/rc.d/rc.lircd: line 120: 4386 Terminated /usr/local/sbin/lircd --nodaemon --device=/dev/lirc/0

If I start mode2, another test app. mode2 gives me this message before dieing:

mode2: error opening /dev/lirc/0
mode2: Not a directory

Sooooo, after all that, any ideas why /dev/lirc/0 doesn't get created? Thanks!
 
Old 11-19-2007, 09:48 PM   #2
rhauff
LQ Newbie
 
Registered: Nov 2003
Location: Minnesota, USA
Distribution: VectorLinux, Xubuntu
Posts: 25

Original Poster
Rep: Reputation: 15
Solution:

1. Fix incorrect udev.rules, added to /etc/udev/rules.d/udev.rules should have been:

### lirc dev entries
KERNEL=="lirc[0-9]*", NAME="lirc/%n"
KERNEL="lirc0", SYMLINK="lirc"

2. udev needs to restarted after modifying the rules!

3. Needed to disable kernel module which conflicts with lirc, ati_remote.ko. I just renamed it so it couldn't autmatically load when I plugged in the USB receiver.

4. Setup a correct .lircrc in my home directory to match with xmms codes.

I also ended up having to record a new /etc/lircd.conf for my remote, even though the serial # on mine matched what was shown in the file included in the source package, it had different keycodes.

It's working great now!
 
  


Reply

Tags
slackware, udev rules


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
Using LIRC, Remote Control from Dvico FusionHDTV5 RT Gold is not discovered samstar Linux - Hardware 8 09-24-2007 06:39 AM
streamzap remote control - lirc & controlling the desktop lowebb Linux - Software 0 01-22-2007 04:28 PM
Remote control and lirc? Japi Linux - Hardware 1 03-22-2006 05:39 AM
LIRC with USB remote control: how? enrico123 Linux - Hardware 0 11-23-2005 02:49 PM
Lirc remote control SchwipSchwap Linux - Newbie 6 09-23-2003 04:39 PM


All times are GMT -5. The time now is 06:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration