[mythtv-users] HDHomeRun, 2nd NIC and dhcpd bootup issue

JS Boyd mythtv at futures.com
Thu Aug 14 06:24:24 UTC 2008


Been there, done all that......

The reason it takes up to 60 seconds for an HDHomerun to connect via 
DHCP is that the HDHomerun only polls for a new DHCP address if it does 
not already have one every 60 seconds.

So you have to wait some time period between 0 and 60 seconds before the 
HDHomerun will poll your DHCP server. Once it has an address everything 
works. There is no way to set a static IP on an HDHomerun. So if you are 
using it on it's own NIC, you just have to wait.

Another solution is to use a switch and have another system provide the 
HDHomerun with DHCP, so that when your Myth system comes up the 
HDHomerun has already gotten its DHCP provided address from somewhere 
else previously. Though I never found a switch that would not drop 
packets (thus creating horizontal zips across the recordings) so I did a 
direct connect to the HDHomerun and wait for it to poll DHCP.

I use something like this:

                count=25
                /usr/local/bin/hdhomerun_config discover  > /dev/null
                while [ $? -eq 1 -a $count -gt 0 ]; do
                        sleep 3
                        count=`expr $count - 1`;
                        /usr/local/bin/hdhomerun_config discover > /dev/null
                done
 

S.

Nick Rout wrote:
> On Thu, Aug 14, 2008 at 5:36 PM, scram69 <scram69 at gmail.com> wrote:
>   
>> On Tue, Aug 12, 2008 at 11:51 PM, Michael Rice <mikerice1969 at gmail.com> wrote:
>>     
>>> On Tue, Aug 12, 2008 at 10:19 PM, scram69 <scram69 at gmail.com> wrote:
>>>       
>>>> On Tue, Feb 12, 2008 at 6:09 PM, Michael Rice <mikerice1969 at gmail.com> wrote:
>>>>         
>>>>> On 11/5/07, Michael Rice <mikerice1969 at gmail.com> wrote:
>>>>>           
>>>>>> On 11/5/07, Harley Peters <harley at thepetersclan.net> wrote:
>>>>>>             
>>>>>>> Well i gave it a try but i have to set it to 200+ to get it to work.
>>>>>>> So i just installed a second switch instead.
>>>>>>> The real problem is when you reboot the backend the network interface on
>>>>>>> the Hdhomerun goes down. And when it comes back up it tries to get an ip
>>>>>>> address from the dhcp server right away and the server hasn't booted up
>>>>>>> yet so the dhcp server isn't yet available.
>>>>>>>               
>>>>>> Makes sense and all but after installing the HDHR on the separate NIC
>>>>>> I rebooted several times and haven't seen the problem.  Does this
>>>>>> happen everytime or does it find the HDHR on some reboots?  I'd like
>>>>>> to know if I am "safe" or if I will have this happen down the road.
>>>>>> My backend is on FC6 now... what distro are you using?  I wonder if
>>>>>> the timing issues are distro specific or something else.
>>>>>>
>>>>>>             
>>>>> I installed a different NIC in my backend and started getting the
>>>>> "HDHR doesn't get an IP address fast enough" problem.  In case anyone
>>>>> is still having a problem with this I solved it by adding a few lines
>>>>> to my mythbackend startup scipt.  It just pings the HDHR's IP address
>>>>> until successful before starting the backend.  I haven't used it a
>>>>> long time yet but it seems better than editing the mythtv source:
>>>>>
>>>>>  # Wait for HDHR to come up
>>>>>  RESULT=1
>>>>>  CNT=0
>>>>>  while [ "$RESULT" != "0" ];
>>>>>  do
>>>>>    /bin/ping -c 1 192.168.2.30
>>>>>    RESULT="$?"
>>>>>    CNT="`expr $CNT + 1`"
>>>>>    if [ "$CNT" = "30" ]; then
>>>>>      RESULT=0
>>>>>    fi
>>>>>  done
>>>>>
>>>>> Any better ideas?
>>>>> _______________________________________________
>>>>> mythtv-users mailing list
>>>>> mythtv-users at mythtv.org
>>>>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>>>>
>>>>>           
>>>> I'm also having this problem, and would rather not edit the source
>>>> (mostly because I've never been able to successfully compile myth from
>>>> anything).  But the HDHR seems to take an inordinate amount of time to
>>>> get an address from my 2nd NIC (eth1).  Here are the relevent lines
>>>> from /var/log/messages:
>>>>
>>>> Aug 12 18:07:34 mediaserver kernel: [   53.246499] eth1: link up,
>>>> 100Mbps, full-duplex, lpa 0x41E1
>>>> Aug 12 18:07:54 mediaserver dhcpd: Internet Systems Consortium DHCP
>>>> Server V3.0.6
>>>> Aug 12 18:07:54 mediaserver dhcpd: Copyright 2004-2007 Internet
>>>> Systems Consortium.
>>>> Aug 12 18:07:54 mediaserver dhcpd: All rights reserved.
>>>> Aug 12 18:07:54 mediaserver dhcpd: For info, please visit
>>>> http://www.isc.org/sw/dhcp/
>>>> Aug 12 18:07:54 mediaserver dhcpd: Internet Systems Consortium DHCP
>>>> Server V3.0.6
>>>> Aug 12 18:07:54 mediaserver dhcpd: Copyright 2004-2007 Internet
>>>> Systems Consortium.
>>>> Aug 12 18:07:54 mediaserver dhcpd: All rights reserved.
>>>> Aug 12 18:07:54 mediaserver dhcpd: For info, please visit
>>>> http://www.isc.org/sw/dhcp/
>>>> Aug 12 18:07:54 mediaserver dhcpd: Wrote 0 deleted host decls to leases file.
>>>> Aug 12 18:07:54 mediaserver dhcpd: Wrote 0 new dynamic host decls to
>>>> leases file.
>>>> Aug 12 18:07:54 mediaserver dhcpd: Wrote 2 leases to leases file.
>>>> Aug 12 18:07:54 mediaserver kernel: [   78.868019] NET: Registered
>>>> protocol family 17
>>>> Aug 12 18:08:38 mediaserver dhcpd: DHCPDISCOVER from 00:18:dd:01:19:75 via eth1
>>>> Aug 12 18:08:38 mediaserver dhcpd: DHCPOFFER on 192.168.0.198 to
>>>> 00:18:dd:01:19:75 via eth1
>>>> Aug 12 18:08:39 mediaserver dhcpd: DHCPREQUEST for 192.168.0.198
>>>> (192.168.0.1) from 00:18:dd:01:19:75 via eth1
>>>> Aug 12 18:08:39 mediaserver dhcpd: DHCPACK on 192.168.0.198 to
>>>> 00:18:dd:01:19:75 via eth1
>>>>
>>>> and, inevitably, in /var/log/mythbackend.log:
>>>>
>>>> 2008-08-12 18:07:51.322 Current Schema Version: 1214
>>>> Starting up as the master server.
>>>> 2008-08-12 18:07:51.408 mythbackend: MythBackend started as master server
>>>> 2008-08-12 18:07:52.529 HDHRChan(ffffffff/0), Error: device not found
>>>> 2008-08-12 18:07:52.537 New DB connection, total: 3
>>>> 2008-08-12 18:07:52.586 Connected to database 'mythconverg' at host: localhost
>>>> 2008-08-12 18:07:52.589 mythbackend: Problem with capture cards: Card
>>>> 1failed init
>>>> 2008-08-12 18:07:53.792 HDHRChan(ffffffff/1), Error: device not found
>>>> 2008-08-12 18:07:53.802 mythbackend: Problem with capture cards: Card
>>>> 2failed init
>>>>
>>>> Here is what is in my dhcpd.conf, where I try to give the hdhr a
>>>> "fixed" address based on it's MAC:
>>>>
>>>> # A slightly different configuration for an internal subnet.
>>>> subnet 192.168.0.0 netmask 255.255.255.0 {
>>>>  range 192.168.0.100 192.168.0.199;
>>>>  #option domain-name-servers ns1.internal.example.org;
>>>>  #option domain-name "internal.example.org";
>>>>  #option routers 192.168.0.1;
>>>>  option broadcast-address 192.168.0.255;
>>>>  default-lease-time 1209600;
>>>>  max-lease-time 1209600;
>>>> }
>>>>
>>>> host hdhomerun {
>>>>  hardware ethernet 00:18:dd:01:19:75;
>>>>  fixed-address 192.168.0.198;
>>>> }
>>>>
>>>> So it takes over a minute to give the hdhr it's address.  I've tried
>>>> the script above, and all it does is delay the address assignment that
>>>> much longer.  Any ideas as to why dhcpd takes over 60 seconds to do
>>>> anything?
>>>>         
>>> The script has been working great for me.  It usually only needs one
>>> ping but occasionally 2 or 3.
>>> Does it eventually work if you increase the number of pings you try?
>>> Certainly your log shows you are running
>>> mythbackend before you can ping the HDHR.  Does it ever come up if you
>>> continue to ping it
>>> before running mythbackend?
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>>
>>>       
>> As a test, I put the script back in, and doubled the number of pings (60).
>>
>> When I rebooted, I watched 60 attempts go by before the goot process
>> could finish, and the system could get to the point at which it tends
>> to want to respond to the HDHR's request for an address.
>>
>> During the entire time, the HDHR's network LED is flashing.  From the
>> silicon dust firmware page:
>> "Flash Ethernet LED while attempting to get DHCP address. "
>>
>> So the addition of the 60 ping attempts resulted in:
>> Aug 13 19:48:42 mediaserver kernel: [   54.165342] eth1: link up,
>> 100Mbps, full-duplex, lpa 0x41E1
>> ...
>> Aug 13 19:52:58 mediaserver dhcpd: DHCPDISCOVER from 00:18:dd:01:19:75 via eth1
>>
>> ... taking over four minutes between eth 1 coming up and the system
>> willing to listen to the HDHR's request for an address.
>>
>> Essentially, what I end up seeing each time is that the HDHR's network
>> LED does not stop flasing until I see the network icon appear in the
>> upper right hand corner of the Mythbuntu desktop.  This leads me to
>> believe that something is preventing the dhcp server from responding
>> to the HDHR until the boot process is completely finished.
>>     
>
> Ahh well I have found with ubuntu that the network is not able to be
> used until someone logs in (which would correspond with the network
> icon appearing in the upper right hand corner). I thought in my case
> it was because I am using encrypted wireless and the system needed
> access to my passphrase, which is provided by some doohickey that
> starts when a user logs in (keyring?). Not having a wired network
> around here to try it on, I am not sure if this is a red herring to
> your problem.
>
> You could try setting your network parameters in
> /etc/network/interfaces and it should come up at boot. At least thats
> what I did on my mythbuntu.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>   


-- 
==
Ubuntu Feisty 7.04
MythTV SVN version below
AMD 64 x2 4200+ 65W Energy Efficient Processor
Abit NF-N2 nView Motherboard
NVidia 6150 video VGA/DVI
PVR-500 (Phillips Chipset)
 IVTV 0.10.4
HDHomerun /sys/version 20071120
1GB RAM
2- 500GB Seagate SATA: ST3500641AS
SONY DVD RW AW-G170A
------------------------------------------
Please include all output in bug reports.
MythTV Version   : 16312M
MythTV Branch    : trunk
Library API      : 0.21.20080224-1
Network Protocol : 40
Options compiled in:
 linux release using_oss using_alsa using_arts using_jack using_backend using_dbox2 using_directfb using_dvb using_firewire using_frontend using_hdhomerun using_iptv using_ivtv using_joystick_menu using_libfftw3 using_lirc using_opengl_vsync using_v4l using_x11 using_xrandr using_xv using_xvmc using_xvmcw using_bindings_perl using_bindings_python using_opengl using_ffmpeg_threads using_libavc_5_3 using_live




More information about the mythtv-users mailing list