LinHES Forums
http://forum.linhes.org/

LIRC issue with R8
http://forum.linhes.org/viewtopic.php?f=22&t=23906
Page 1 of 1

Author:  tama103 [ Mon Dec 23, 2013 9:50 pm ]
Post subject:  LIRC issue with R8

I have got R8.0 mostly working, just in time for R8.1, with the exception of one big annoyance with getting my IR serial receiver to initialize at boot. I searched the forums and couldnt find anyone else with the issue, so here it goes:

I have my remote configured correctly on ttyS1 on Service Menu > Linhes Configuration > Remotes. When rebooting the system, the remote is non-responsive. To get it to work again, I need to go back into the "remotes" section of the Linhes configuration, change my serial port to an unused port such as ttyS0 or ttyS2, and hit finish so it saves the config. Then I must go back in again and change it back to the correct config, ttyS1, and hit finish. After this config is saved, then the remote is working again.

I am running the One4All URC-6131, with a custom lircd.conf and lircrc file, but I do not think that remote or the custom files are the issue, since I have been using them for years with no problem. I think the issue lies with having lirc initialize correctly during the boot process, so perhaps there is something with the startup script?

Here is a copy of my /var/log/lirc

(FYI - frontend is named 'love')

Code:
Dec 23 21:01:51 love lircd: caught signal
Dec 23 21:02:24 love lircd: lircd(default) ready, using /var/run/lirc/lircd
Dec 23 21:02:34 love lircd: accepted new client on /var/run/lirc/lircd
Dec 23 21:02:34 love lircd: could not get file information for /dev/remotes/serial_lirc
Dec 23 21:02:34 love lircd: default_init(): No such file or directory
Dec 23 21:02:34 love lircd: WARNING: Failed to initialize hardware
Dec 23 21:02:39 love lircd: accepted new client on /var/run/lirc/lircd


Then, here is what my log displays immediately after these lines, once I re-configure the serial port through the service menu

Code:
Dec 23 21:05:41 love lircd: accepted new client on /var/run/lirc/lircd
Dec 23 21:05:50 love lircd: caught signal
Dec 23 21:06:04 love lircd: lircd(default) ready, using /var/run/lirc/lircd
Dec 23 21:06:04 love lircd: accepted new client on /var/run/lirc/lircd
Dec 23 21:06:04 love lircd: accepted new client on /var/run/lirc/lircd


As you can see, there is a Warning and failure to initialize hardware during the boot portion of the log, but no such warning when I set the port manually.

Everything looks good in the /etc/systemconfig file and the /etc/modules.mythvantage file. I can post those two if helpful.

Any help or suggestions would be great, as I am stumped by this. I am even ok with just creating a script to initialize things properly upon boot if someone might be able to help me figure out how to to that.

Thanks

Author:  jams [ Tue Dec 24, 2013 8:13 am ]
Post subject:  Re: LIRC issue with R8

There is supposed to be a udev rule that sets up a link for each specific receiver into /dev/remotes/
It looks like this isn't happening on boot, so I will have to look into it.

There is a way to setup lirc exactly like you want and thats by creating the file
"/etc/runit/lirc.sh" and putting all your startup commands in it. The remote start up script will use that file and skip everything else in the rest of the file. /etc/runit/lirc.sh MUST NOT TERMINATE with a normal condition, if it does it will continue to be run every couple secs and then be disabled.

Code:
if [ -x /etc/runit/lirc.sh ]
then
    #program must not terminate.
    stat_runit "Starting remotes from /etc/runit/lirc.sh"
    echo "Starting remotes from /etc/runit/lirc.sh" >>$LOG
    /etc/runit/lirc.sh
else


http://www.linhes.org/projects/linhes/w ... unitlircsh

Finally instead of entering and leaving the service menu to force the config to be rerun, it's possible to force the reconfig with. "systemconfig.py -m ir".


Please open a bug about this so I don't forget.

Author:  cahlfors [ Wed Dec 25, 2013 5:59 am ]
Post subject:  Re: LIRC issue with R8

Thanks for this!
I have been scratching my head over this issue as well!

Thanks,
/Chris

Author:  jams [ Thu Dec 26, 2013 3:58 pm ]
Post subject:  Re: LIRC issue with R8

Think I found the problem.

lirc_serial was being loaded at boot without parameters, so it defaults to com1. This of course doesn't work for anything but com1 so it would appear to fail.
That also explains why it worked from within the service menu, because it unloads and loads lirc_serial with the correct parameters.


A fix will be commited shortly.

Author:  tama103 [ Thu Dec 26, 2013 4:09 pm ]
Post subject:  Re: LIRC issue with R8

Thanks Jams. I tried to write a lirc.sh script to get things going correctly with no success (I am a noob), so I will wait for the update to hit the repo!

Author:  jams [ Thu Dec 26, 2013 4:22 pm ]
Post subject:  Re: LIRC issue with R8

for a quick test you could edit /etc/modules.mythvatnage and comment out lirc_serial . Either remove the line or place a # in front of it.

After rebooting it should work, that is if the values in /etc/systemconfig are correct for your com port.

Author:  tama103 [ Thu Dec 26, 2013 4:49 pm ]
Post subject:  Re: LIRC issue with R8

Cool, I will try that when I get home and report back. Thanks!

Author:  tama103 [ Thu Dec 26, 2013 10:25 pm ]
Post subject:  Re: LIRC issue with R8

Unfortunately, updating modules.mythvantage as suggested did not fix the issue. No change in outcome. Remote does not work after reboot, but changing to a different port, then changing back does fix it.

Author:  jams [ Fri Dec 27, 2013 11:01 am ]
Post subject:  Re: LIRC issue with R8

Pushed what might fix the problem, update the packages runit-scripts and optionally LinHES-config.
If LinHES-config is not updated that make sure that /etc/modules.mythvantage is removed each time after visiting the service menu.
Since your not on 8.1 I'm not for sure what else LinHES-config may drag in.

1) pacman -Sy runit-scripts
2) reboot
2.5) make note if the remote is working
3) cp /tmp/remotes.log /home/mythtv/remotes.log.boot
4) do whatever you normally do to get the remote to work
4.5) verify remote is working
5) cp /tmp/remotes.log /home/mythtv/remotes/log.works
6) email both logs to (jams @ linhes.org ) or attach them to ticket #950

The log file is overwritten every time remotes is started, so it's important to make copies for working and non-working.

Author:  tama103 [ Fri Dec 27, 2013 11:23 pm ]
Post subject:  Re: LIRC issue with R8

Updated the bug report.

Author:  tama103 [ Fri Jan 03, 2014 9:34 am ]
Post subject:  Re: LIRC issue with R8

Issue resolved thanks to the latest runit-scripts-8.1-7 created by Jams in the repo. Anyone else with this issue - see bug report for more info

http://linhes.org/issues/950

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/