You are not logged in.

#26 2013-04-01 13:39:58

karolp1993
Member
Registered: 2013-04-01
Posts: 2

Re: Getting LIRC to work under systemd [SOLVED]

Hello everybody. I've some problems with lirc running correctly. I'm using X10 receiver and transmitter from Medion. My problem is that lirc0 is not created.
I used lirc.service from this topic.

[karolp1993@Karol-PC multi-user.target.wants]$ cat lirc.service
[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/lircd.conf
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc
ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC

[Install]
WantedBy=multi-user.target

lirc.service seems to running correctly

[karolp1993@Karol-PC ~]$ systemctl status lirc.service
lirc.service - LIRC Daemon
	  Loaded: loaded (/usr/lib/systemd/system/lirc.service; enabled)
	  Active: active (running) since pon 2013-04-01 15:19:27 CEST; 11min ago
	 Process: 387 ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC (code=exited, status=0/SUCCESS)
	 Process: 385 ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE (code=exited, status=0/SUCCESS)
	 Process: 381 ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 378 ExecStartPre=/bin/rm -f /run/lirc/lircd (code=exited, status=0/SUCCESS)
	 Process: 375 ExecStartPre=/bin/rm -f /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 372 ExecStartPre=/bin/mkdir -p /run/lirc (code=exited, status=0/SUCCESS)
	Main PID: 386 (lircd)
	  CGroup: name=systemd:/system/lirc.service
		  └─386 /usr/sbin/lircd -d /dev/lirc0 -P /run/lirc/lircd.pid ...

[karolp1993@Karol-PC ~]$ ls /dev |grep lirc
lircd
[karolp1993@Karol-PC ~]$ cat /etc/conf.d/lircd.conf
LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER="atilibusb"
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"

And my lircd.conf

[karolp1993@Karol-PC ~]$ cat /etc/lirc/lircd.conf
#
# this config file was automatically generated
# using lirc-0.8.4a(atilibusb) on Thu Jan  1 22:00:59 2009
#
# contributed by Tomas Aronsson, d0malaga|gmail.com
#
# brand: X10 WTI MCE Remote control
# url: http://www.x10europe.com/pdf/OR22E-23E.pdf
# model no. of remote control: OR22V 
# devices being controlled by this remote: mythtv
#

begin remote

  name          X10_OR22V
  bits           16
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   8
  pre_data       0x14
  post_data_bits  16
  post_data      0x0
  gap          139984
  min_repeat      2
  toggle_bit_mask 0x80800000

      begin codes
          KEY_POWER                0xD702
          KEY_RED                  0x0732
          KEY_YELLOW               0x89B4
          KEY_GREEN                0x0833
          KEY_TEXT                 0x6B96
          KEY_BLUE                 0x0A35
          KEY_BACK                 0x75A0
          KEY_INFO                 0x042F
          KEY_UP                   0x6F9A
          KEY_LEFT                 0xF21D
          KEY_OK                   0x739E
          KEY_RIGHT                0xF41F
          KEY_DOWN                 0x77A2
          KEY_TIMESHIFTING         0xED18
          KEY_EPG                  0x86B1
          KEY_DVDMENU              0xD904
          KEY_LIVETV               0x719C
          KEY_VOLUMEUP             0xDE09
          KEY_WINDOWS              0x709B
          KEY_CHANNELUP            0xE00B
          KEY_VOLUMEDOWN           0x5D88
          KEY_CHANNELDOWN          0xE10C
          KEY_MUTE                 0x5580
          KEY_PREVIOUS             0xF621
          KEY_NEXT                 0x78A3
          KEY_REWIND               0xF924
          KEY_PLAY                 0x7AA5
          KEY_FASTFORWARD          0xFB26
          KEY_RECORD               0x7CA7
          KEY_STOP                 0xFD28
          KEY_PAUSE                0x7EA9
          KEY_1                    0xE20D
          KEY_2                    0x638E
          KEY_3                    0x648F
          KEY_4                    0xE510
          KEY_5                    0x6691
          KEY_6                    0xE712
          KEY_7                    0x6893
          KEY_8                    0xE914
          KEY_9                    0x6A95
          KEY_*                    0x0C37
          KEY_0                    0x6C97
          KEY_#                    0x0D38
          KEY_CLEAR                0x85B0
          KEY_ENTER                0x0B36
      end codes

end remote

I'm not sure if remote control works, few months ago works fine, now i don't know - is it possible to check it somehow?

EDIT:

Solved, remote works wink

Last edited by karolp1993 (2013-04-03 20:29:49)

Offline

#27 2013-04-03 20:24:17

karolp1993
Member
Registered: 2013-04-01
Posts: 2

Re: Getting LIRC to work under systemd [SOLVED]

My happiness was too soon sad My remote doesn't work after reboot, worked once, i don't know why.
My lirc.service:

[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/lircd.conf
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc
ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC

[Install]
WantedBy=multi-user.target

And status:

lirc.service - LIRC Daemon
	  Loaded: loaded (/usr/lib/systemd/system/lirc.service; enabled)
	  Active: active (running) since śro 2013-04-03 22:14:14 CEST; 4min 5s ago
	 Process: 1453 ExecStopPost=/bin/rm -fR /run/lirc (code=exited, status=0/SUCCESS)
	 Process: 1450 ExecStopPost=/bin/rm -f /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 1473 ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC (code=exited, status=0/SUCCESS)
	 Process: 1471 ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE (code=exited, status=0/SUCCESS)
	 Process: 1468 ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 1465 ExecStartPre=/bin/rm -f /run/lirc/lircd (code=exited, status=0/SUCCESS)
	 Process: 1462 ExecStartPre=/bin/rm -f /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 1459 ExecStartPre=/bin/mkdir -p /run/lirc (code=exited, status=0/SUCCESS)
	Main PID: 1472 (lircd)
	  CGroup: name=systemd:/system/lirc.service
		  └─1472 /usr/sbin/lircd -d /dev/lirc0 -P /run/lirc/lircd.pid...

kwi 03 22:14:14 Karol-PC systemd[1]: Starting LIRC Daemon...
kwi 03 22:14:14 Karol-PC ir-keytable[1473]: /sys/class/rc/rc0//protocols: In...t
kwi 03 22:14:14 Karol-PC ir-keytable[1473]: Couldn't change the IR protocols
kwi 03 22:14:14 Karol-PC systemd[1]: Started LIRC Daemon.

And, there is a problem:
When i run "irw" nothing is happened.

[karolp1993@Karol-PC ~]$ irw
[karolp1993@Karol-PC ~]$ irw
[karolp1993@Karol-PC ~]$ irw
connect: No such file or directory

After third try, lirc go to inactive..

lirc.service - LIRC Daemon
	  Loaded: loaded (/usr/lib/systemd/system/lirc.service; enabled)
	  Active: inactive (dead) since śro 2013-04-03 22:19:05 CEST; 1min 31s ago
	 Process: 1635 ExecStopPost=/bin/rm -fR /run/lirc (code=exited, status=0/SUCCESS)
	 Process: 1632 ExecStopPost=/bin/rm -f /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 1473 ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC (code=exited, status=0/SUCCESS)
	 Process: 1471 ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE (code=exited, status=0/SUCCESS)
	 Process: 1468 ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 1465 ExecStartPre=/bin/rm -f /run/lirc/lircd (code=exited, status=0/SUCCESS)
	 Process: 1462 ExecStartPre=/bin/rm -f /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 1459 ExecStartPre=/bin/mkdir -p /run/lirc (code=exited, status=0/SUCCESS)
	Main PID: 1472 (code=killed, signal=TERM)
	  CGroup: name=systemd:/system/lirc.service

Lircd.conf is that as above.

Somebody know what is the problem?

Last edited by karolp1993 (2013-04-03 20:25:03)

Offline

#28 2013-04-08 14:16:30

archbawks
Banned
Registered: 2013-03-17
Posts: 75

Re: Getting LIRC to work under systemd [SOLVED]

Stop the lirc service:

sudo systemctl stop lirc.service

Remove your hardware and plug it back in.

Determine the actual address of the IR hardware as the system sees it:

ls /dev/input/by-path

or

ls /dev/input/by-path | grep ir

Insert the address of into file

/etc/conf.d/lircd.conf

for

LIRC_DEVICE=".."

When you reboot the device is remapped to another eventX location based on the order in which other peripherals in the system respond. It's possible to make the IR stationary but first try the above plug and we'll debug thereafter.

Offline

#29 2013-04-09 20:39:54

archbawks
Banned
Registered: 2013-03-17
Posts: 75

Re: Getting LIRC to work under systemd [SOLVED]

@wdirksen:..

Are you still having problems or did you manage to sort/abandon it?

/var/run/lirc/lircd points to /run/lirc/lircd and are effectively the same object. This is a UNIX-type socket.

MythTV works differently to XBMC for input from RC/keybd. MythTV reads keymaps through LIRC, To get any functionality beyond basic alphanumeric/Up/Down, you have to route "extended keys" through dreadful LIRC I'm afraid to say.
XBMC on the other hand reads the key maps directly from those maps bundled with the Linux kernel. I've found more and better functionality in this feature than having to manually setup key maps not once but twice through LIRC. Once for the general collection of keys, and second for those keys specific to each application.

Offline

Board footer

Powered by FluxBB