What you do when it won't
Ok, so it doesn't work... Don't send me email unless you are willing
to pay my hourly rate (I do accept PayPal ;-), otherwise you will be
ignored! Just how do you find out what is wrong to find what it is
that needs fixing? This is where some basic skills at problem solving
are needed. First we have to know how it is supposed to work, then we
need to verify that each part is working (or not). The chain of events
is as follows:
IR_diode->lirc_serial->lirc_dev->lircd->lirc_keybd->uinput
If anything breaks in that chain, it won't work.
Your problem is probably that nothing is being "heard" by the lirc_serial
driver, assuming of course you did read someplace here that
no other
lirc driver is to be loaded along with the lirc_serial driver?
TopTesting the lirc_serial driver
Check that, get to text console, type in 'lsmod | grep lirc'.
You should only see something like this:
lirc_serial 12736 0
lirc_dev 13324 1 lirc_serial
This shows that the kernel modules are loaded. Next see if you have
a /dev/lirc0 with "ls /dev/lirc0". This should be there, if not, you
had either not done the "setserial /dev/ttyS? uart none" (replace '?'
with serial port number) or the 8250 module was loaded. In either
case, you will get some error being reported when you attempted to
modprobe lirc_serial, check your system logs (/var/log/message &
/var/log/kernel/{info,warnings,errors}).
Next check to make sure that batteries are, in fact, in the keyboard.
Sounds stupid, but I've done it myself. :-P A real simple test to
see if the lirc_serial is working is to run mode2 (mode2 -d /dev/lirc0)
and plug / unplug the IR phone plug repeatedly. You will see activity
being reported from mode2, if not, you need to look carefully at your
electronics, or throw that one away and build another?
Seeing output from mode2 when pressing keys tells us a lot! We now know:
1. electronics interface is working.
2. lirc_serial has been properly built.
3. we have selected the correct /dev/lircX device.
TopTesting the lircd daemon
Let us now try to see if lircd is working properly. Load lircd
(maybe first kill the first instance of the daemon with "killall lircd")
with "lircd -d /dev/lirc0". Interesting that lircd insists upon using
/dev/lirc instead of /dev/lirc0, even if /dev/lirc doesn't exist,
it won't look for /dev/lirc0. This is likely your problem, lircd
will load if you give it the wrong device name to use, it will sit
in the process stack (ps ax | grep lircd), but when you try to run
irw, lircd will suddenly bail out and terminate. This can be
frustrating if you don't know this behavior (what is more frustrating
is attempting to read the docs on the lirc.sourceforge.net site! grrr!).
Before running lircd, ensure that the proper decoder file is in
place. Check the contents of /etc/lircd.conf. This must have
the contents of the lircd-webpal.conf file in there as one of the
remotes listed. Yes, you can list more than one remote control in
/etc/lircd.conf, dig very very deeply into the lircd docs and it
may tell you this (ok, enough of bashing the lirc docs).
Run irw now, press some keys on the WebPal keyboard, you should
see something like this:
0000000000000059 00 KBD_ENTER WebPal_Keyboard
0000000000000059 00 KBD_ENTER WebPal_Keyboard
000000000000005a 00 BRK_ENTER WebPal_Keyboard
00000000000000ad 00 ALL_UP WebPal_Keyboard
0000000000000059 00 KBD_ENTER WebPal_Keyboard
000000000000005a 00 BRK_ENTER WebPal_Keyboard
00000000000000ad 00 ALL_UP WebPal_Keyboard
0000000000000073 00 KBD_SPACE WebPal_Keyboard
0000000000000073 00 KBD_SPACE WebPal_Keyboard
0000000000000074 00 BRK_SPACE WebPal_Keyboard
00000000000000ad 00 ALL_UP WebPal_Keyboard
TopTom, your lirc_keybd is broken!
Ok, so far so good. Really we should have fixed things by now!
But, ok, so my code is broken... I did add a debug feature to the
code to try to see what is going on. Let's goto the source,
assuming that you haven't changed anything before you compiled it,
edit lirc_keybd.c and where it says "#define DEBUG 0", change that
to "#define DEBUG 1", save the file and re-run 'make'. This will
build code that will run as an application, not as a daemon, and
print out lots of annoying lines of debugging information.
Pressing on the ENTER key will print this:
0000000000000059 00 KBD_ENTER WebPal_Keyboard
keycode: 59
0000000000000059 00 KBD_ENTER WebPal_Keyboard
000000000000005a 00 BRK_ENTER WebPal_Keyboard
00000000000000ad 00 ALL_UP WebPal_Keyboard
FuncAllKeysUp (void)
0000000000000059 00 KBD_ENTER WebPal_Keyboard
keycode: 59
000000000000005a 00 BRK_ENTER WebPal_Keyboard
00000000000000ad 00 ALL_UP WebPal_Keyboard
FuncAllKeysUp (void)
Your most likely problem is that you had edited the /etc/lircd.conf
file and changed the name of the remote control from
"
WebPal_Keyboard" to something else. You cannot do this
without changing the definition within lirc_keybd.c. The lirc_keybd
looks for, and only processes, the remote control it was told to
recognize. This is a bit of a safety feature to avoid confusion
when multiple remote controls are defined. Another thing, not a
feature, but part of how lirc_keybd works is that it looks for
the "
KBD_xxxx", "
BRK_xxxx", and "
ALL_UP"
strings. These are keywords that tell lirc_keybd what is happening
on the IR keyboard side. Don't change these strings unless you
change the lirc_keybd source as well. You can change the text
following the "
KBD_" & "
BRK_" text to whatever
you wish, lirc_keybd doesn't look at that portion of those strings.
Don't change "
ALL_UP".