IR remote controller for PC. Still possible?

  • Hi. For my pc i have made a little DIY IR receiver with some components (tsop1838, capacitor, resistor...)

    On oscilloscope it seams working, i think my problem is a libreelec config problem.

    I seen config file but in libreelec but they are for xbox / raspberry ?

    Is there a tutorial for pc version? LIRC is fully installed?

    On my old NUC openelec (v6) works great but with libreelec on pc i can't find any tutorial.

    Cant someone help me? Thanks.

  • How is this IR receiver connected to your PC,?

    Lirc is fully supported and in current testbuilds and in the upcoming 8.2 version it can be configured and used for all devices like on standard Linux installation. In the current 8.0.2 version it's a bit limited as it uses the same configuration methods as older OpenELEC versions.

    But, unless you have a really awkward remote I'd recommend configuring the remote via ir-keytable. This already works like on standard Linux installations, only the configuration files (rc_maps.cfg, rc_keymaps) are in the /storage/.config directory instead of /etc.

    Read more about ir-keytable configuration in this thread: WD TV Live remote

    so long,

    Hias

  • Thanks for reply.

    Ir receiver is connected to the DCD pin of serial connector on the motherboard. If i remember, all commands i tried return this error "/sys/class/rc/: No such file or directory" In net tutorials they talk about hardware.conf but i don't seen it.

    My ir receiver is not seen / declared. (serial : 3f8 irq4 / ttys0)

    Libreelec is in v 8.0.2. I take a look on it and i repost exact error message for ir-keytable

  • I guess you have been using the lirc_serial module before, probably loaded via an autostart.sh script - is that correct?

    lirc_serial has been replaced by serial_ir (the latter can be configured via ir-keytable, so you don't have to run userspace lircd - but you still can if you want).

    The module parameters are the same as for lirc_serial, so just changing the modprobe line to use serial_ir should be enough to get you going.

    If that doesn't work, please post the commands you use to load the driver and the output of ir-keytable.

    so long,

    Hias

  • 2 cheap China IR receivers here on my PC's that work without any settings (linux) on USB

    I just have a tiny customization in remote.xml but that's not needed

  • On console i entered

    Code
    setserial /dev/ttyS0 uart 16550a [none return an error message]
    modprobe serial_ir

    Now ir-keytable return something:

    Code
    ir-keytable
    Found /sys/class/rc/rc0/ (/dev/input/event16) with:
        Driver serial_ir, table rc-rc6-mce
        Supported protocols: unknown other lirc rc-5 rc-5-sz jvc sony nec sanyo mce-kbd rc-6 sharp xmp 
        Enabled protocols: lirc rc-6 
        Name: Serial IR type home-brew
        bus: 25, vendor/product: 0001:0001, version: 0x0100
        Repeat delay = 500 ms, repeat period = 125 ms

    No irc_options.conf , tried to create one but can't save it (read only)

    Ir-keytable as irw don't return anything. Protocols changed, same issue. Stucked. ( 0/3,5 V pulses sent to DSD pin (1) on motherboard )

    Edited once, last by T0t0r0 fr: adding inf (July 11, 2017 at 6:25 PM).

  • You have to use setserial /dev/ttyS0 uart unknown - otherwise serial_ir probably won't work (I'm puzzled why loading it seemed to work, I'd expected to see an error).

    Also make sure you have disabled lirc in LE settings.

    Then, stop kodi and eventlircd

    Code
    systemctl stop kodi
    systemctl stop eventlircd

    Now you should be able to test if the IR receiver works:

    Code
    ir-keytable -p all -t
    mode2

    The former will print scancodes and decoded keys, the latter will test raw receiption (you should see pulse and space messages printed on the console) - use that if you can't get any output from ir-keytable.

    so long,

    Hias

  • Thanks for your reply, it's a lot better ...

    Code
    LibreELEC (official) Version: 8.0.2
    LibreELEC:~ # setserial /dev/ttyS0 uart unknown
    LibreELEC:~ # modprobe serial_ir
    LibreELEC:~ # systemctl stop kodi
    LibreELEC:~ # systemctl stop eventlircd
    Code
    LibreELEC:~ # ir-keytable -p all -t
    /sys/class/rc/rc0//protocols: Invalid argument
    Couldn't change the IR protocols

    edit, protocol nec:

    Code
    LibreELEC:~ # ir-keytable -p nec -t
    Protocols changed to nec 
    Testing events. Please, press CTRL-C to abort.
    1499799167.047156: event type EV_MSC(0x04): scancode = 0x23451c
    1499799167.047156: event type EV_SYN(0x00).
    1499799168.925887: event type EV_MSC(0x04): scancode = 0x23451d

    Ok, works with setserial /dev/ttyS0 uart unknown.

    But what to do with "Warning: cannot open /etc/lirc/lirc_options.conf". error?

    With libreelec i need to create a autorun.sh too?

  • OK...

    made a keymap file in /storage/.config/rc_keymaps/

    made a rc_maps.cfg in /storage/.config/

    Code
    serial_ir        rc-rc6-mce        my_remote

    made a autorun.sh in /storage/.config/ like this :

    Code
    setserial /dev/ttyS0 uart unknown
    modprobe serial_ir
    ir-keytable -c -p NEC -w /storage/.config/rc_keymaps/my_remote

    Remote works but the last key pressed is repeated when pressing an other button (this other one take place of next etc)

    ex: left right up enter enter > left left right up enter.

    EDIT

    By modifying remote repeats and delay, this is what really appends: (irw running for test)

    -Press one remote key, this key is seen 5~28 seconds later

    -Press an other key before that 5~28s , the precedent key seen immediately AND this new pressed key is seen after this 5~28 sec delay.

    The delay seem to be aleatory.

    What's wrong? Thanks

    Edited 2 times, last by T0t0r0 fr: More precisions. (July 12, 2017 at 1:37 PM).

  • Could you test if you also see this behaviour with irw (while kodi and eventlircd are running) and with ir-keytable -t (kodi and eventlircd need to be stopped, watch for the KEY_xxx events)?

    BTW: You can ignore the lirc_options.conf warning, it is harmless and already fixed in the upcoming 8.2 version.

    Instead of running ir-keytable -c -w ... from autostart.sh I'd recommend creating a .config/rc_maps.cfg file with the content * * my_remote - otherwise the udev rule which sets up the keytable (via /etc/rc_maps.cfg, loading the libreelec-combined keymap) could race with your manual ir-keytable setup.

    so long,

    Hias

  • irw (kodi and eventlircd running)

    Key pressed immediately appear when an other key is pressed OR after 4 ~18 seconds.

    ir-keytable -t

    Key pressed appear only when a new key is pressed. This new key appear only when an other is pressed etc. (kodi and eventlircd stopped).

    New install.

    No autorun.sh , just these 2 files added "/storage/.config/rc_keymaps/my_remote" and "/storage/.config/rc_maps.cfg"

    Code
    serial_ir        rc-rc6-mce           my_remote

    after start

    some key repeats if key pressed most than 0,5 seconds

  • You have to use setserial /dev/ttyS0 uart unknown - otherwise serial_ir probably won't work (I'm puzzled why loading it seemed to work, I'd expected to see an error).

    I'm so glad I finally found this post! In the past (10 years ago or so) you had to use setserial /dev/ttyS0 uart none, but now the correct parameter is unknown. The annoying thing is that the systemlog will tell you the wrong parameter when trying to load serial_ir. And the module still will load without prior correct setserial!

  • I'm so glad I finally found this post! In the past (10 years ago or so) you had to use setserial /dev/ttyS0 uart none, but now the correct parameter is unknown. The annoying thing is that the systemlog will tell you the wrong parameter when trying to load serial_ir. And the module still will load without prior correct setserial!

    The kernel message in the log isn't wrong, with the setserial program you typically find on Linux installations you have to use the parameter "none".

    LibreELEC doesn't use this setserial program but the setserial implementation from busybox and there you have to use "unknown".

    so long,

    Hias

  • The kernel message in the log isn't wrong, with the setserial program you typically find on Linux installations you have to use the parameter "none".

    LibreELEC doesn't use this setserial program but the setserial implementation from busybox and there you have to use "unknown".

    so long,

    Hias

    Thanks for the explanation! Did cost me about two hours to learn this :/