1

On Unbuntu 20.04, I want to configure lirc for IR blasting over serial port. But it seems that the latest linux kernel is missing the necessary "lirc_serial.ko" module (missing since Linux 4.15, at least).

I've found a number of instructions on configuring lirc with serial port, but they all seem very outdated and depends on "lirc_serial.ko" to be present.

How do I add the necessary "lirc_serial.ko" module to my system? I have found a "serial_ir.ko" module, but I don't think it is the same. Do I have to build lirc myself?

2 Answers 2

0

Most of the functionality of lirc has been moved into the kernel on recent Ubuntu releases.

So, you need to uninstall lirc and make sure that ir-keytable is installed instead. Then, in terminal type man ir-keytable to get started.

Plug in your remote dongle, and in terminal, type ir-keytable and this will give you the basic information you'll need to get started. Then use ir-keytable -t to get/review your scan codes. You'll save a keymap in /etc/rc_keymaps (you can get a prebuilt keymap file from /lib/udev/rc_keymaps/), and edit /etc/rc_maps.cfg if you need to.

If you Google ir-keytable you'll get plenty of how-to articles to help you. See http://madaboutbrighton.net/articles/2015/remote-control-media-player-without-lirc-using-ir-keymap

2
  • Thanks for reply, but your response seems to be about receive IR signals (into PC). I'm looking for a solution to transmit IR signal using the UART serial port, something that was supported by default in linux driver until recently. Commented Jun 6, 2020 at 10:08
  • @codechimp The answer was mostly to inform you about lirc being missing since 18.04+, and although it may be primarily about receiving, it may give you enough clues to research the transmit side. Also note that lirc is still in the repos. Commented Jun 6, 2020 at 13:16
0

Thanks to the Arch Linux folks, I found that in the latest kernels (since 4.9), lirc_serial has been dropped in favor of serial_ir

I had to add the following file /etc/modprobe.conf/serial-ir.conf to configures serial_ir to use the desired port with the following content:

options serial_ir irq=4 io=0x3f8     #COM1 equivalent, /dev/ttyS0

install serial_ir /usr/bin/setserial /dev/ttyS0 uart none;/usr/sbin/modprobe --ignore-install serial_ir
  1. options line defines which port to use (e.g. COM1, /dev/ttyS0)
  2. install line instructs the kernel drop control of relevant port

The serial_ir module can be loaded simply creating /etc/module-load.d/serial_ir.conf with the following content:

serial_ir

OR

in lirc v10+, by adding the following to the lirc_options.conf file:

[modinit]
code = /usr/sbin/modprobe serial_ir

or in lirc v9, by extending the TRANSMITTER_MODULE variale in hardware.conf file as such:

TRANSMITTER_MODULES="...serial_ir"

where ... are the other modules already specified in the file.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.