That works! Thanks for all your help. Back up in post #3 I mentioned that I had removed the KEY_ prefix from the codes downloaded from lirc-remotes download | SourceForge.net. I did this because I thought I should send and receive codes via Microsoft_Xbox and those codes in the /usr/share/kodi/system/Lircmap.xml just have UP,DOWN,LEFT,RIGHT ,etc...
I didn't realize that if I left eventlircd running then the codes would get transferred to "devinput" rather than Xbox, and the devinput codes do have the KEY prefix.
It is a bit confusing
Thanks!
Posts by johnsmallberries
-
-
Hi Hias, the problem that I have with Millhouse is that /usr/lib/kodi/kodi-config has the hardcoded line:
KODI_ARGS="--lircdev /run/lirc/lircd"
So Kodi is always listending to /run/lirc/lircd.Systemd is managing lircd and creating /run/lirc/lircd.socket. All the IR codes from lircd are getting sent to /run/lirc/lircd.socket and not /run/lirc/lircd (where kodi is listening) so kodi never receives any codes. If you do irw /run/lirc/lircd nothing ever comes out. I do see eventlircd running in the background configured to use /run/lirc/lircd but again nothing is seen by kodi and irw /run/lirc/lircd gives no output.
Changing "output" in lirc_options.conf to /run/lirc/lircd instead of lircd.socket does not work either, because systemd keeps creating /run/lirc/lircd.socket.
You should be able to reproduce this with a remote that is not supported by the kernel, such as the USB UIRT.
Possibly remove the hardcoding of KODI_ARGS and allow it to be set in ./config/systemd/kodi.service, or change whatever is making systemd create/require the lircd.socket, or let me know how I should troubleshoot eventlircd because it does not seem to be sending anything to /run/lirc/lircd when the codes are being received by lircd.
LibreELEC:/run/lirc # ps -aef | grep lirc
269 root 0:00 /usr/sbin/eventlircd -f --evmap=/etc/eventlircd.d --socket=/run/lirc/lircd
294 root 0:00 /usr/sbin/lircd -O /storage/.config/lirc_options.conf --nodaemon --release /storage/.config/lircd.conf
298 root 0:00 /usr/sbin/lircd-uinput -O /storage/.config/lirc_options.conf
637 root 0:00 {kodi.sh} /bin/sh /usr/lib/kodi/kodi.sh --standalone -fs --lircdev /run/lirc/lircd
642 root 0:42 /usr/lib/kodi/kodi.bin --standalone -fs --lircdev /run/lirc/lircdLibreELEC:~/.config # cat lirc_options.conf
[lircd]
nodaemon = False
driver = uirt2_raw
device = /dev/ttyUSB0
output = /run/lirc/lircd.socket
pidfile = /run/lirc/lircd.pid
plugindir = /usr/lib/lirc/plugins
permission = 666
allow-simulate = No
repeat-max = 600
#effective-user =
#listen = [address:]port
#connect = host[:port]
#loglevel = 6
#uinput = ...
#release = ...
logfile = /var/log/lircd.logLibreELEC:~/.config # irw /run/lirc/lircd.socket
0000000000559aa6 00 UP Microsoft_Xbox
0000000000559aa6 00 UP_EVUP Microsoft_Xbox
0000000000558aa7 00 DOWN Microsoft_Xbox
0000000000558aa7 00 DOWN_EVUP Microsoft_Xbox
0000000000557aa8 00 RIGHT Microsoft_Xbox
0000000000557aa8 00 RIGHT_EVUP Microsoft_Xbox
0000000000556aa9 00 LEFT Microsoft_Xbox
0000000000556aa9 00 LEFT_EVUP Microsoft_XboxLibreELEC:~/.config # irw /run/lirc/lircd
[ no output] -
First, thanks again Hias for all your help. I was able to get it to work and learn a lot about how libreelec and kodi work. I had to change the kodi startup to listen on /run/lirc/lircd.socket rather than /run/lircd/lircd.
My problem was that since lircd is managed by systemd it always creates this socket even if you tell the lircd.conf to use a different socket. Kodi unfortunately always listens to /run/lirc/lircd and it does not appear to have a simple configuration file to change this, so I had to change its startup script. Here is the complete procedure that I followed in Millhouse.1. Enabled lirc in Settings->libreelect->services->Enable lirc
2. Create ./config/lircd.conf with the configuration for the non-ev remote, possibly downloading the configration from lirc-remotes
3. Create ./config/lirc_options with the configuration needed for the remote. In my case I had to change device and driver.
4. Copy /usr/lib/kodi/kodi-config to /storage/.config/ and modify this file making KODI_ARGS="--lircdev /run/lirc/lircd.socket" Make sure the execute bit is set.
5. and copy /usr/lib/systemd/system/kodi.service to /storage/.config/system.d/kodi.service and modify this file so that the script in step 4 is executed, by making ExecStartPre=-/storage/.config/kodi-configI hope this is the right way to do it. My concern with this method over just having an autostart.sh is that I have to make copies of kodi-config and kodi.service, and therefore may not maintain currency with future changes. If there was a supported way to change KODI_ARGS I suppose thatmight be better. Maybe remove it entirely from the kodi-config and just let the systemd startup set it -- that way I only have to do Environment=KODI_ARGS="--lircdev /run/lirc/lircd.socket", but right now the kodi-startup will override it.
Also deleting /run/lirc/lircd and making a hardlink to /run/lirc/lircd.socket also works to avoid copying the startup files, but then I have to go back to using autostart.sh -- maybe not be so bad anyway since I think I still need to use autostart to change the wakeup-power options so I can resume kodi from S3 sleep using the remote.Thanks again.
-
I don't see lircd-uinput running. I changed back to the default and now I have.
Code
Display More[lircd] nodaemon = False [b]driver [/b]= uirt2_raw [b]device [/b]= /dev/ttyUSB0 output = /run/lirc/lircd.socket pidfile = /run/lirc/lircd.pid plugindir = /usr/lib/lirc/plugins permission = 666 allow-simulate = No repeat-max = 600 #effective-user = #listen = [address:]port #connect = host[:port] #loglevel = 6 #uinput = ... #release = ... [b]logfile [/b]= /var/log/lircd.log
But nothing works. irw just shows nothing when I press remote keys, and the log file is not created. There is no pid file and lircd itself is not running.
├─kodi.service
│ ├─626 /bin/sh /usr/lib/kodi/kodi.sh --standalone -fs --lircdev /run/lirc/lircd
│ └─631 /usr/lib/kodi/kodi.bin --standalone -fs --lircdev /run/lirc/lircd
├─eventlircd.service
│ └─263 /usr/sbin/eventlircd -f --evmap=/etc/eventlircd.d --socket=/run/lirc/lircdLibreELEC:/run/lirc # pidof lircd
LibreELEC:/run/lirc # pidof lircd-uinputRemoving both lircd.conf and lirc_options.conf from ./config does not change anything.
Again,what I am trying to emulate is
lircd -d /dev/ttyUSB0 --driver=uirt2_raw /storage/.config/lircd.confWhich works fine if I start it from autostart.sh , and stop eventlircd beforehand. I can keep it that way, just trying to see if there was a more supportable way to do it.
-
Hi I tried the latest Milhouse build May 8th (for x86 not pi) and it does not seem to work for overriding lircd parameters -- well at least for the startup which is what I need to do. To debug I created a ./config/lirc_options.conf which was identical to the one in /etc/lirc
but changing
output = /run/lirc/lircd.socket2and only /run/lirc/lircd.socket was created (no "2").
If I try connecting to ircd.socket it just gives a connection reset error.
/run/lirc/lircd is there as well and I can connect to it (and that is what kodi is configured for), but there is no output when I press buttons on the remote.lircd itself doesn;t seem to run, as in v8.0.1. eventlircd is running instead . I'm not familiar with how to debug that.
If I stop eventlircd and run
lircd -n -d /dev/ttyUSB0 --driver=uirt2_raw /storage/.config/lircd.confThen I see all my codes if I use " irw //run/lirc/lircd.socket "(btw I think the old default was /run/lirc/lircd (without the .socket).
If anyone wants me to do any more tests I'll stay on this build for a few days. Just let me know. I would be nice to get it to work without an autostart.
-
Can you do a test with the latest Milhouse build?
LibreELEC Testbuilds for RaspberryPi (Kodi 18.0)LE9 adds support for setting lircd options via /storage/.config/lirc_options.conf and thus make it a lot easier to configure the driver and device (just copy /etc/lircd/lirc_options.conf to the .config dir and change driver= and device=).
You might also need to create a /storage/.config/lircd.conf file, by default lircd is configured to support MCE and xbox remote codes.
BTW: with userspace lirc you won't use ir-keytable, configuration is handled by lircd.conf and lirc_options.conf.
so long,
Hias
@Hias: that support would be helpful. I will test it soon. In the meantime I was able to get it to work in Krypton. I'm not sure if this is the proper way to get one of these old non-event devices working but here's what I did in case it is helpful to somebody else.
Get aremote profile that matches what you are using. I used the one below since it most closely resembled the default kodi default config. In my URC-R50 remote I just use one of the Windows remote profiles.
Codewget https://sourceforge.net/p/lirc-remotes/code/ci/master/tree/remotes/microsoft/Xbox.lircd.conf?format=raw -O lircd.conf.orig
Oddly this did not match the one for Xbox in /etc/lircd. Anyway to avoid modifying the kodi configuration I removed the KEY prefix from this lircd file because the default Lircmap.xml in Kodi refers to the Xbox codes without KEY.
I also added a "suppress_repeat 5" at the begininng of my lircd.conf because autorepeat was going too fast.
Then I just set it to autostart automatically.
Codecd .config cat > autostart.sh <<xxEOFxx #!/bin/sh ( systemctl stop eventlircd ; \ lircd -n -d /dev/ttyUSB0 --driver=uirt2_raw /storage/lircd.conf ; \ ) & xxEOFxx chmod +x autostart.sh
Not sure if that's the best way to do things in the current version but it works for me, and I saved $20 by not having to buy a flirc
-
Hi, has anyone configured the USB-UIRT with LibreELEC?
It seems to be found by the kernel:
[ 25.789146] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
And I can get lirc to work with :
LIRCD_OPTIONS="-H uirt2_raw -d /dev/ttyUSB0"
And I do see data coming from it:
mode2 --driver=uirt2_raw --device=/dev/ttyUSB0
space 1312950
pulse 8900
space 4300
pulse 600However irkeytable fails with a /sys/class/rc/: No such file or directory.
I'm thinking this is because the USBUIRT does not have a evdev driver, but was wondering if there was any other way to get it to work within the LibreELEC system?Thanks.
--- Bill