Results 1 to 1 of 1

Thread: Focal how-to Infra-Red using systemd udev not lirc

  1. #1
    Join Date
    Jan 2011
    Location
    Bournemouth UK
    Beans
    335
    Distro
    Kubuntu 18.04 Bionic Beaver

    Focal how-to Infra-Red using systemd udev not lirc

    Now lirc is almost defunct it is time to get to grips with the systemd way of handling ir remotes.

    It turns out to be remarkably easy.

    For a bog standard mce clone remote these are the steps:

    1) locate your remote file template it is in /lib/udev/rc_keymaps it is rc6_mce.toml

    2) copy it from /lib/udev/rc_keymaps to /etc/rc_keymaps #
    Code:
    sudo cp /lib/udev/rc_keymaps/rc6_mce.toml /etc/keymaps
    3) for ease of use I remove the suffix so it becomes rc6_mce only.
    Code:
    sudo mv /etc/rc_keymaps/rc6_mce.toml /etc/rc_keymaps/rc6_mce
    4) Install ir-keytable

    Code:
    sudo apt install ir-keytable
    5) check it works by pressing a few keys on your remote:

    Code:
    sudo ir-keytable -t
    You should see scancodes appear on the screen like this:
    Code:
    root@linuxmint:/home/tony# ir-keytable -t
    Testing events. Please, press CTRL-C to abort.
    35910.869695: lirc protocol(rc6_mce): scancode = 0x800f0422
    35910.869728: event type EV_MSC(0x04): scancode = 0x800f0422
    35910.869728: event type EV_KEY(0x01) key_down: KEY_ENTER(0x001c)
    35910.869728: event type EV_SYN(0x00).
    
    35910.973709: lirc protocol(rc6_mce): scancode = 0x800f0422
    35910.973740: event type EV_MSC(0x04): scancode = 0x800f0422
    35910.973740: event type EV_SYN(0x00).
    35911.085677: lirc protocol(rc6_mce): scancode = 0x800f0422
    35911.085708: event type EV_MSC(0x04): scancode = 0x800f0422
    35911.085708: event type EV_SYN(0x00).
    35911.261904: event type EV_KEY(0x01) key_up: KEY_ENTER(0x001c)
    35911.261904: event type EV_SYN(0x00).
    35915.101985: lirc protocol(rc6_mce): scancode = 0x800f0426
    35915.102017: event type EV_MSC(0x04): scancode = 0x800f0426
    35915.102017: event type EV_KEY(0x01) key_down: KEY_S(0x001f)
    35915.102017: event type EV_SYN(0x00).
    s35915.205961: lirc protocol(rc6_mce): scancode = 0x800f0426
    35915.205996: event type EV_MSC(0x04): scancode = 0x800f0426
    35915.205996: event type EV_SYN(0x00).
    35915.309934: lirc protocol(rc6_mce): scancode = 0x800f0426
    35915.309953: event type EV_MSC(0x04): scancode = 0x800f0426
    35915.309953: event type EV_SYN(0x00).
    35915.489891: event type EV_KEY(0x01) key_up: KEY_S(0x001f)
    35915.489891: event type EV_SYN(0x00).
    35918.462170: lirc protocol(rc6_mce): scancode = 0x800f0416 toggle=1
    35918.462209: event type EV_MSC(0x04): scancode = 0x800f0416
    35918.462209: event type EV_KEY(0x01) key_down: KEY_P(0x0019)
    35918.462209: event type EV_SYN(0x00).
    p35918.566214: lirc protocol(rc6_mce): scancode = 0x800f0416 toggle=1
    35918.566243: event type EV_MSC(0x04): scancode = 0x800f0416
    35918.566243: event type EV_SYN(0x00).
    35918.678191: lirc protocol(rc6_mce): scancode = 0x800f0416 toggle=1
    35918.678220: event type EV_MSC(0x04): scancode = 0x800f0416
    35918.678220: event type EV_SYN(0x00).
    35918.857917: event type EV_KEY(0x01) key_up: KEY_P(0x0019)
    35918.857917: event type EV_SYN(0x00).
    6) run this command to activate the new configuration (must be done after every change)

    Code:
    sudo ir-keytable -c -w /etc/rc_keymaps/rc6_mce

    7) set up your favourite text editor in a window on the right of the screen and have that file open at the same time as running an instance of mythtv in a window on the left with the key editor open.

    Code:
    mythfrontend -geometry 1280x900
    8) modify ONLY the text next to KEY_??? to reflect what mythtv has mapped to the key you want.

    eg. the existing line:- scancode 0x800f040a = KEY_DELETE (0x6f)

    change to scancode 0x800f040a = KEY_D (0x6f) #was DELETE

    I always make a note of the original so I don't get too confused when I need to change things.

    9) After making your changes, save the rc6_mce file open in the text editor, save any changes to your mythtv keymappings and
    run the command in (no 6) and logoff to close the x system. I just reboot - it is easier.

    In my humble opinion this is far superior to the dogs breakfast that lirc has become.

    Cheers, Tony

    EDIT-2nd July 2020-----I have found when starting the udev rule does not always kick in at boot

    There is an excellent fix here from BT Guru over at Gentoo Forums https://forums.gentoo.org/viewtopic-...6-start-0.html

    Code:
    #!/bin/sh
    
    /usr/bin/ir-keytable -c -w /etc/rc_keymaps/rc6_mce
    Place this in your startup in kubuntu as a script file it's easiest to use the system-settings startup menu.

    Tony.
    Last edited by vidtek; 1 Week Ago at 04:23 PM. Reason: extra info
    Asus Z270 i7 16gb ram 8.25tb GT960 TSB6205 Quad tuner 64-bit Kubuntu 20.04 Focal & win 10 Be/FE mythtv 0.31Homerun dual netwk tuner 55¨ Samsung ES8000 Laptop Samsung NP R580 i5 nvidia linux Mint & win 10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •