[mythtvnz] hdhomerun doesn't connect on restart when connected directly to the lan port

Paulgir paulgir at gmail.com
Thu Apr 25 01:13:39 BST 2013


On Wed, 24 Apr 2013 19:50:02 +1200, Stephen Worthington  
<stephen_agent at jsw.gen.nz> wrote:

> On Wed, 24 Apr 2013 16:51:19 +1200, you wrote:
>
>>
>>>
>>> I have never liked link-local addresses - I always use manually
>>> assigned static addresses instead if at all possible, as nothing can
>>> go wrong with them.  Does the HDHomerun do static addresses?
>>>
>>> It is also possible that there is a timing issue.  After the problem
>>> happens, if you restart mythbackend ("restart mythbackend" from a root
>>> prompt), does the HDHomerun start working?  If so, it may be that
>>> mythbackend is starting before the HDHomerun has had its ethernet
>>> connection come up.  If that is the case, a simplistic fix is just to
>>> add some delay before mythbackend starts.  In
>>> /etc/init/mythtv-backend.conf, find the line where it runs
>>> /usr/bin/mythbackend and add a line before that with say "sleep 10" to
>>> give a 10 second delay.  A better solution would make changes to the
>>> "start on" line to make the startup wait for the HDHomerun being
>>> visible, but that gets quite complicated and way above my skill level
>>> with Upstart.
>>>
>>
>> I carried out Stephen's suggestion: adding a waiting period to
>> mythtv-backend.conf:
>>
>> # MythTV Backend service
>>
>> description     "MythTV Backend"
>> author          "Mario Limonciello <superm1 at ubuntu.com>"
>>
>> start on (local-filesystems and net-device-up IFACE!=lo and started
>> udev-finish)
>> stop on runlevel [016]
>>
>> #expect fork
>> respawn
>> respawn limit 2 3600
>>
>> pre-start script
>>     [ -x /usr/sbin/mysqld ] || exit 0
>>     for i in `seq 1 30` ; do
>>        /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping &&
>> exit 0
>>        sleep .5
>>     done
>> end script
>>
>> script
>>         test -f /etc/default/locale && . /etc/default/locale || true
>> sleep 10
>>         LANG=$LANG /usr/bin/mythbackend --syslog local7 --user mythtv
>> end script
>>
>>
>>
>>
>> Seems to work ok
>> Paul
>
> Ok, that verifies what the problem is.  With timing problems like
> this, just adding a delay is not always entirely reliable.  It may
> work most of the time, but if something happens that upsets the
> timing, then the problem may occur again, occasionally.  And remember
> that you will get the extra delay every time you start or restart
> mythbackend, which may get annoying (eg after running mythtv-setup).
>
> I think the best solution long term would be to make both your eth0
> port and the HDHomerun use static IP addresses, if the HDHomerun can
> do that.  Static IP addresses prevent most timing problems.  Or run a
> DHCP server on the Myth box configured to serve addresses to eth0.
>
> _______________________________________________
You said it.Last night the delay worked fine,today - not at all.

Paul



More information about the mythtvnz mailing list