Unable to start TVH server when network connection not present or using tethered AP on WIFI
Added by fred z over 7 years ago
I have a built a streaming media server using a PI Zero, a combined USB/ Ethernet (powered) adapter, a DVBT dongle and a 802.11n dongle to either allow me to connect to the internet or to act as a wifi hotspot. The intent of the setup is to allow me to have a standalone/ mobile media server.
So here goes...
When I connect the PI to a LAN via wifi or Ethernet the TVH server starts and I can map DVBT networks and stream TV over the LAN connection and watch in various devices, so far so good..... HOWEVER....
When I disconnect the LAN (either wifi or ethernet) and enable the hotspot, upon reboot the TVH Server will not start, this problem persists even if the AP is disbaled i.e. no lan connection?!?!?!?
1) is this normal/ expected behavior?
2) can TVH be started and be functional without a LAN connection i.e. to use the wifi AP?
I am using TVH 4.2 on LibreElec 8.0.2.
Replies (5)
RE: Unable to start TVH server when network connection not present or using tethered AP on WIFI - Added by Robert Cameron over 7 years ago
Sounds like Tvheadend is binding to a particular interface/IP, and when it changes Tvheadend becomes unreachable.
A fix to this might be a bridge adapter, when you create a virtual interface to hold all of your physical ones. Then Tvheadend may bind to your virtual adapter, which will then handle the fall over and activation of your other interfaces.
RE: Unable to start TVH server when network connection not present or using tethered AP on WIFI - Added by fred z over 7 years ago
Robert - thank you for the reply - I have been digging into this and I think you are correct.
When I am in AP mode both the eth and wifi are disconnected but I do have a 'tether' interface - assuming that TVH is looking for eth or wifi then this would explain why it fails to start.
I have tried to create a dummy interface but failed as libreelec does not have the 'dummy' interface library loaded (modprobe dummy - and I cant figure out how to add it!) - i was simply hoping to create an eth0:1 and off we go!
As an aside when I SSH into the PI, I can manually start TVH but I get user access errors on the web interface (401/ cannot log in) which I figure is down to selecting the right user:group combo on the -u and -group at the cmd line.
best case I would like to bind the dummy adapter worst case I am guessing I could look at a script to start TVH when the PI boots
RE: Unable to start TVH server when network connection not present or using tethered AP on WIFI - Added by Robert Cameron over 7 years ago
LE doesn't really do well with custom or advanced setups. I'm not sure what networking framework that LE uses, so I can't offer more help. The Arch wiki has a decent article on bridging: https://wiki.archlinux.org/index.php/Network_bridge
You can also follow the links in there to get info if LE is using systemd-networkd. However, without knowing what kernel modules the LE ships, your results will vary. Personally, I recommend moving away from LE for Tvheadend, and only using it on client devices, and only then if necessary.
RE: Unable to start TVH server when network connection not present or using tethered AP on WIFI - Added by fred z over 7 years ago
taking on board what your saying I wonder if I need to prove this with another linux system (ubuntu ?)
What i am thinking is to try to replicate the same conditions - no network - and see what happens to TVH i.e. will it start with no network!
If im right in what im thinking I dont think it will start which then leads me to wonder if its a binding problem with TVH - is it waiting for a network - if it is then the next logical question is how would I change the behavior?
RE: Unable to start TVH server when network connection not present or using tethered AP on WIFI - Added by fred z over 7 years ago
FIXED IT!!!!!!!!!!!!!!
I remembered looking at
.kodi/addons/service.tvheadend42/system.d service.tvheadend42.service
which has the following two lines:
After=network-online.service
Requires=network-online.service
I figured if I commented them out as follows:
#After=network-online.service
#Requires=network-online.service
then TVH would not wait for the network, start and bind itself to any available adapter - it works
Robert it sounds crazy but your input was just enough to get me thinking this through a little more - thx