Serial IR Receiver Not Working
#1
Hi all,

I have a home-made serial receiver, which is known to work (proven on GeeXboX, kernel 2.6.25). When I do "cat /dev/lirc0" on GeeXboX and press a key on any remote control, I get some characters on screen.

When I do the same in XBMC Live CD, I get nothing.

The kernel of XBMC sees the serial port at boot time:

[ 68.955468] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 68.955982] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

I tried manually loading and unloading lirc_serial driver - the driver loads cleanly, /var/log/messages says the device is initialized, /dev/lirc0 appears - but nothing comes out of it:

XBMCLive kernel: [ 285.569563] lirc_dev: IR Remote Control driver registered, major 61
XBMCLive kernel: [ 285.579925] lirc_serial: no version for "lirc_unregister_plugin" found: kernel tainted.
XBMCLive kernel: [ 286.079122] lirc_serial: auto-detected active low receiver

I tried the "magic" with "setserial /dev/ttyS0 uart none" and then re-loading the module - again, nothing.

It seems to be some kernel-related stuff, as until I get the /dev/lirc0 working there's no point to try and configure lircd at all. In /lib/modules/2.6.24-19-generic I have two different lirc_serial drivers:

root@XBMCLive:/lib/modules/2.6.24-19-generic# find | grep lirc_serial.ko
./ubuntu/media/lirc/lirc_serial/lirc_serial.ko
./updates/dkms/lirc_serial.ko

Any idea which one is used -- and why there are two different modules at all?

Anybody had similar problems? Anybody got a serial IR receiver working on XBMC Live?

WWell,
Reply
#2
For the record: here is how the receiver was made working:

1. In /etc/lirc/hardware.conf, disable module loading.

2. In /etc/rc.local, add these lines:

modprobe lirc_dev
setserial /dev/ttyS0 uart none
insmod /lib/modules/2.6.24-19-generic/ubuntu/media/lirc/lirc_serial/lirc_serial.ko

Note: the module lirc_serial that is insmod'ed is not the default that modprobe will load; modprobe will load the one from "updates/dkms" directory.

If anybody knows a smarter way to fix the problem, please, let me know.

Side note: in my vanilla 2.5.25 kernel for GeeXboX it all works with a simple "modprobe lirc_serial" without any other effort... Why cannot Ubuntu be like this?

WWell,
Reply
#3
Thank's for the solution, it worked brilliantly. Also for the (google) record, here's how I came across this:

When troubleshooting my homebrew serial receiver, I noticed that it wasn't getting power because the RTS line was still negative. I thought maybe that lirc_serial module needed an argument, but from everything I'd read it should have done this by default.

The alternative module above worked a treat, but I implemented the workaround slightly differently:
1) Leave the module loading in hardware.conf, but change the remote modules line to REMOTE_MODULES="lirc_dev setserial"
2) In /etc/init.d/lirc, modify the "loading modules" section at the top. There was already a special handler for udev, so I changed the logic a bit and added an extra one for setserial

Code:
if [ $mod = "udev" ]; then
      UDEV=true
   elif [ $mod = "[b]setserial[/b]" ]; then
      # workaround for wrong modules / setserial not being configured.
      setserial /dev/ttyS0 uart none > /dev/null            
      insmod /lib/modules/2.6.24-19-generic/ubuntu/media/lirc/lirc_serial/lirc_serial.ko >/dev/null
   else
      modprobe -k $mod 2> /dev/null || MODULES_MISSING=true
   fi
Reply

Logout Mark Read Team Forum Stats Members Help
Serial IR Receiver Not Working0