[mythtv-users] numerous attempts to find HDHR

Daryl McDonald darylangela at gmail.com
Tue Feb 22 23:27:13 UTC 2022


On Tue, Feb 22, 2022 at 6:16 PM Bill Meek <keemllib at gmail.com> wrote:

> On 2/22/22 16:58, Daryl McDonald wrote:
> >
> >
> > On Tue, Feb 22, 2022 at 5:36 PM Bill Meek <keemllib at gmail.com <mailto:
> keemllib at gmail.com>> wrote:
> >
> >     On 2/22/22 16:18, Daryl McDonald wrote:
> >     > According to the log:
> >     > cat /var/log/mythtv/hdhr_discovery.log
> >     > 2022-02-05 08:22:34 INFO Starting HD Homerun discovery
> >     > 2022-02-05 08:22:35 INFO Found HD Homerun. Seconds=0.429,
> attempts=1.
> >     > 2022-02-05 08:24:41 INFO Starting HD Homerun discovery
> >     > 2022-02-05 08:24:41 INFO Found HD Homerun. Seconds=0.424,
> attempts=1.
> >     > 2022-02-05 08:46:38 INFO Starting HD Homerun discovery
> >     > 2022-02-05 08:46:38 INFO Found HD Homerun. Seconds=0.426,
> attempts=1.
> >     > ...
> >     > 2022-02-18 17:40:32 INFO Starting HD Homerun discovery
> >     > 2022-02-18 17:40:32 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-18 17:40:34 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-18 17:40:36 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-18 17:40:38 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-18 17:40:40 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-18 17:40:42 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-18 17:40:44 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-18 17:40:46 INFO Found HD Homerun. Seconds=14.485,
> attempts=8.
> >     > 2022-02-19 17:41:32 INFO Starting HD Homerun discovery
> >     > 2022-02-19 17:41:32 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:34 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:36 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:38 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:40 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:42 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:44 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:46 WARNING hdhomerun_config discover failed,
> return code = 1.
> >     > 2022-02-19 17:41:49 INFO Found HD Homerun. Seconds=16.493,
> attempts=9.
> >     > 2022-02-20 09:24:47 INFO Starting HD Homerun discovery
> >     >
> >     >  The first attempt to find the HDHR fails, the second is
> successful. Today, however it failed 8 to 14 times before finding the HDHR
> but the BE
> >     > would not start because the script exited error code 1.
> >     > Is there an adjustment I can make to allow more than one failed
> attempt?
> >     > For now I've commented out the [Service] and set the scheduler
> value to 0  for the HDHR.
> >
> >     The script makes ATTEMPTS tries (20 if I recall) and tries:
> hdhomerun_config discover
> >     every DELAY seconds (2).
> >
> >     Run: hdhomerun_config discover from the command line to see what it
> says.
> >
> >  daryl at trieli:~$ hdhomerun_config discover
> > hdhomerun device 10426B6B found at 192.168.0.182
> >
> >
> >     Then, if the discover works, run the script from the command line.
> >
> >  2022-02-22 17:51:29 INFO Starting HD Homerun discovery
> > 2022-02-22 17:51:29 INFO Found HD Homerun. Seconds=0.424, attempts=1.
> >
> >
> >     --
> >     Bill
> >
> > According to the log the HDHR was found, but for some reason the BE
> would not start citing error code 1. the difference I see is that
> > previously it was found on the second attempt, but today it took 8 to 14
> attempts, so somewhere between 2 and 8 attempts the error code sticks
> > and prohibits the BE from starting. My thinking is that an adjustment
> should be made to allow for multiple failures, before accepting the
> > exiting error code.
> > TIA  Daryl
>
> Before error code 1 is returned, "Couldn't find HD Homerun. Seconds=n.n,
> attempts=n.n."
> should appear in the log.
>
> If not, then there's something else causing the response to systemctl.
> Again, what
> does the script return when run from the command line, preferably run as
> user
> mythtv.
>
 daryl at trieli:~$ /usr/local/bin/hdhomerun_check.py
daryl at trieli:~$ cat /var/log/mythtv/hdhr_discovery.log
but as mythtv
aryl at trieli:~$ sudo su mythtv
[sudo] password for daryl:
$ /usr/local/bin/hdhomerun_check.py
Traceback (most recent call last):
  File "/usr/local/bin/hdhomerun_check.py", line 64, in <module>
    main()
  File "/usr/local/bin/hdhomerun_check.py", line 31, in main
    logging.basicConfig(filename='/var/log/mythtv/hdhr_discovery.log',
  File "/usr/lib/python3.8/logging/__init__.py", line 1988, in basicConfig
    h = FileHandler(filename, mode)
  File "/usr/lib/python3.8/logging/__init__.py", line 1147, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.8/logging/__init__.py", line 1176, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied:
'/var/log/mythtv/hdhr_discovery.log'

>
> You can change the line: sys.exit(1) near the bottom of the script to
> sys.exit(123)
> just to prove the the error code 1 is coming from something else.
>
> You could also see if there's anything in the systemd log with: journalctl
> --boot=0 --unit=mythtv-backend
>
> --
> Bill
> Of course, you're right, so where do I go from here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20220222/8fae4a33/attachment.htm>


More information about the mythtv-users mailing list