[mythtv-users] Delaying until HDHR tuners are up before starting mythtv-backend

Bill Meek keemllib at gmail.com
Tue Jan 3 00:30:12 UTC 2023


On 1/2/23 18:18, James Abernathy wrote:
> 
> 
> On Mon, Jan 2, 2023 at 7:05 PM Bill Meek <keemllib at gmail.com <mailto:keemllib at gmail.com>> wrote:
> 
>     On 1/2/23 17:51, James Abernathy wrote:
>      >
>      >
>      > On Mon, Jan 2, 2023 at 6:44 PM Bill Meek <keemllib at gmail.com <mailto:keemllib at gmail.com> <mailto:keemllib at gmail.com
>     <mailto:keemllib at gmail.com>>> wrote:
>      >
>      >     On 1/2/23 16:55, James Abernathy wrote:
>      >      >
>      >      >
>      >      > On Mon, Jan 2, 2023 at 5:42 PM James <jam at tigger.ws <mailto:jam at tigger.ws> <mailto:jam at tigger.ws <mailto:jam at tigger.ws>>
>     <mailto:jam at tigger.ws <mailto:jam at tigger.ws> <mailto:jam at tigger.ws <mailto:jam at tigger.ws>>>> wrote:
>      >      >
>      >      >
>      >      >
>      >      >      > On 3 Jan 2023, at 6:27 am, James Abernathy <jfabernathy at gmail.com <mailto:jfabernathy at gmail.com>
>     <mailto:jfabernathy at gmail.com <mailto:jfabernathy at gmail.com>> <mailto:jfabernathy at gmail.com <mailto:jfabernathy at gmail.com>
>      >     <mailto:jfabernathy at gmail.com <mailto:jfabernathy at gmail.com>>>> wrote:
>      >      >      >
>      >      >      > When I have my HDHR Quatro tuner connected to my router I'd just use a local-network-pingable service to wait until the
>     tuners were
>      >      >     pingable.
>      >      >      > That works, but to reduce a lot of the network errors I was getting with the HDHR tuners I've been directly connecting them.
>      >     That's been
>      >      >     working great with no errors due to the connection. But I've been restarting the backend manually to make sure the tuners were up.
>      >      >      >
>      >      >      > You can't use the pingable method of delaying the backend because the 169.254.x.x IP of the HDHR changes every boot. This
>     doesn't
>      >     affect
>      >      >     mythtv-backend because it uses the tuner ID so I need a new method of waiting on the tuners.
>      >      >
>      >      >     Jim I don't know how you do DNS. I use dnsmasq but every router/modem I've seen also allows you to assign a mac address to an
>     IP so you
>      >      >     always get the same IP on the same device
>      >      >     James
>      >      >
>      >      > If I was connected to a router that is what I do.  In this case I'm directly connecting the HDHR tuner to a 2nd port on my NUC PC. In
>      >     that case
>      >      > the HDHR will assign itself an IP of 169.254.x.x randomly on the x's. I just set up my PC port to a static IP of 169.254.0.1 with a
>      >     subnet mask
>      >      > of 255.255.0.0. That all works, it is just the delaying function that is killing me. I guess I could do a delay on the
>     mythtv-backend to
>      >     wait
>      >      > for a mythtv-backend.timer to start 1 minute after boot. But who wants to introduce a race condition.
>      >     IPv4 Link Local on the host shouldn't have an address assigned either.
>      >     The two ends will figure their addresses out. Link Local should be an
>      >     option if you're setting the NIC up with some tool.
>      >
>      >     I DON'T think this is the issue, but it's the right thing to do.
>      >
>      >     Try:
>      >
>      >         hdhomerun_config 1074C841 get /tuner0/status
>      >
>      >     the above after a restart and successful MANUAL discover command.
>      >
>      >     I'd disable backend startup to test ideas that prove tuners are
>      >     available (which is what the backend log is complaining about:
>      >
>      >         ... Added 0 devices from 1074C841 ...
>      >
>      >
>      >
>      >     Bill
>      >
>      >
>      > Thanks, that will give me some stuff to try.  I did play with the hdhomerun_check.py program.  After it had a successful "hdhomefun_config
>      > discover" command I tried different sleep delays until I found what worked.  10 seconds allowed the backend to connect with 2 tuners and 20
>      > seconds found all 4.
>      >
>      > I'll try working on some of your suggestions.
> 
>     The additional delay is interesting. I'd start with the Link Local fix.
>     Here's what NIC's settings look like:
> 
>     [802-3-ethernet]
>     duplex=full
>     mac-address=00:AB:CD:EF:00:11
> 
>     [connection]
>     id=eth1
>     uuid=very long hex string here
>     type=802-3-ethernet
>     timestamp=1386355229
> 
>     [ipv6]
>     method=ignore
> 
>     [ipv4]
>     method=link-local
>     dhcp-send-hostname=false
> 
>     -- 
>     Bill
> 
> 
> Thanks, the Direct connection is set to local-link and works.
> 
> With the mythtv-backend disabled at boot, I logged in and opened a terminal then did:
> [jim at den-pc ~]$ hdhomerun_config 1074c841 get /tuner0/status
> unable to connect to device
> [jim at den-pc ~]$ hdhomerun_config 1074c841 get /tuner0/status
> unable to connect to device
> [jim at den-pc ~]$ hdhomerun_config 1074c841 get /tuner0/status
> unable to connect to device
> [jim at den-pc ~]$ hdhomerun_config 1074c841 get /tuner0/status
> ch=none lock=none ss=0 snq=0 seq=0 bps=0 pps=0
> [jim at den-pc ~]$ hdhomerun_config discover
> hdhomerun device 1074C841 found at fe80::218:ddff:fe07:4c84%2
> hdhomerun device 1074C841 found at 169.254.208.100
> 
> As you can see even after all that time it still has problems getting status. Maybe I should use the get status command in the 
> hdhomerun_check.py command as a test?
> 
> Jim A

In the configuration for the NIC, can you set IPv6 to off?
I've never used mine with it. An IPv6 address starting with
fe80:: is also for Link Local.

If you added the get /tuner/status to the script, you'd need to
capture the 1074C841 from its output. Or [ugh!] hard code it.

IPv6 can be turned off for eth0 with sysctl. Yours must be on

   sysctl --all --pattern net.ipv6.conf.eth0.disable_ipv6


-- 
Bill



More information about the mythtv-users mailing list