home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Watch / Listen Media
Television (MyTV frontend and TV-Server)
Problem with TV Server and WLAN
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Shazell" data-source="post: 281798" data-attributes="member: 51936"><p>Ok I've done a bit of browsing through the code</p><p></p><p>This is the code that finds the list of IP Addresses</p><p></p><p>/trunk/TvEngine3/TVLibrary/TVLibrary/Streaming/RtspStreaming.cs</p><p></p><p>[CODE] 67 #region ctor</p><p> 68 /// <summary></p><p> 69 /// Initializes a new instance of the <see cref="RtspStreaming"/> class.</p><p> 70 /// </summary></p><p> 71 /// <param name="hostName">ipadress to use for streaming.</param></p><p> 72 public RtspStreaming(string hostName)</p><p> 73 {</p><p> 74 try</p><p> 75 {</p><p> 76 IPHostEntry local = Dns.GetHostByName(hostName);</p><p> 77 foreach (IPAddress ipaddress in [B]local.AddressList[/B])</p><p> 78 {</p><p> 79 StreamSetup(ipaddress.ToString());</p><p> 80 break;</p><p> 81 }</p><p> 82 _initialized = true;</p><p> 83 _streams = new Dictionary<string, RtspStream>();</p><p> 84 }</p><p> 85 catch (Exception ex)</p><p> 86 {</p><p> 87 Log.Log.Write(ex);</p><p> 88 }</p><p> 89 }</p><p> 90 #endregion</p><p>[/CODE]</p><p></p><p>So I assume that before the WLAN is up and running local.AddressList only returns the local host IP, but when the WLAN is up it only returns the IP of the WLAN (And any other active network cards, but no others in my case)</p><p></p><p>This IP is then used here</p><p></p><p>/trunk/TvEngine3/TVLibrary/TvService/TVController.cs</p><p></p><p>[CODE] 87 void StreamSetup(char* ipAdress)</p><p> 88 {</p><p> 89 TCHAR folder[MAX_PATH];</p><p> 90 TCHAR fileName[MAX_PATH];</p><p> 91 ::SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE);</p><p> 92 sprintf(fileName,"%s\\Team MediaPortal\\MediaPortal TV Server\\log\\streaming server.Log",folder);</p><p> 93 ::DeleteFile(fileName);</p><p> 94 </p><p> 95 Log("-------------- v1.0.0.1---------------");</p><p> 96 Log("Stream server:Setup stream server for ip:%s",ipAdress);</p><p> 97 </p><p> 98 ReceivingInterfaceAddr=inet_addr(ipAdress );</p><p> 99 SendingInterfaceAddr=inet_addr(ipAdress );</p><p> 100 </p><p> 101 TaskScheduler* scheduler = BasicTaskScheduler::createNew();</p><p> 102 m_env = BasicUsageEnvironment::createNew(*scheduler);</p><p> 103 m_rtspServer = RTSPServer::createNew(*m_env);</p><p> 104 if (m_rtspServer == NULL)</p><p> 105 {</p><p> 106 Log("Stream server:Failed to create RTSP server: %s",m_env->getResultMsg());</p><p> 107 exit(1);</p><p> 108 }</p><p> 109 }</p><p>[/CODE]</p><p></p><p>I am wondering if it would be possible to add a section in the setup to manually enter a static IP so that there would be two servers on startup, the local host and the IP specified (And any network cards found as well). I also think that for single seat cases then the local host should always be there as well to avoid any network issues. So the client on the same PC as the Server always uses the local host and works no matter what happens to the network. This would fix both my problems.</p><p></p><p>Not sure if an invalid IP address would cause issues when the RTSP server is initialised though.</p><p></p><p></p><p></p><p>I'll have a look at that as well tonight, but a secondary problem is that the WLAN router is not always available as it is only powered on when I use the desktop PC, I do not tend to leave any devices switched on when not in use as I am an eco green friendly sort of bloke (aka the wife nagging me to switch things off) <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /></p><p></p><p>Thats a problem I could solve by having the router permanently powered so not really a big issue, but I would like to see the TV server able to work either single seat or over WLAN without the WLAN status affecting the single seat client.</p><p></p><p>And some more digging around on the web and I may have come up with a solution</p><p></p><p>I reckon that if I edit my HOSTS file (%windir%/system32/drivers/etc/hosts)</p><p></p><p>And change it from </p><p></p><p>127.0.0.1 localhost</p><p></p><p>to</p><p></p><p>192.168.2.3 htpc</p><p></p><p>This should set the local host to my WLAN static IP address then it may work no matter whether the WLAN is active or not as I will always have the same IP address and host name.</p><p></p><p>Anyone know if this will cause any problems with anything else?</p></blockquote><p></p>
[QUOTE="Shazell, post: 281798, member: 51936"] Ok I've done a bit of browsing through the code This is the code that finds the list of IP Addresses /trunk/TvEngine3/TVLibrary/TVLibrary/Streaming/RtspStreaming.cs [CODE] 67 #region ctor 68 /// <summary> 69 /// Initializes a new instance of the <see cref="RtspStreaming"/> class. 70 /// </summary> 71 /// <param name="hostName">ipadress to use for streaming.</param> 72 public RtspStreaming(string hostName) 73 { 74 try 75 { 76 IPHostEntry local = Dns.GetHostByName(hostName); 77 foreach (IPAddress ipaddress in [B]local.AddressList[/B]) 78 { 79 StreamSetup(ipaddress.ToString()); 80 break; 81 } 82 _initialized = true; 83 _streams = new Dictionary<string, RtspStream>(); 84 } 85 catch (Exception ex) 86 { 87 Log.Log.Write(ex); 88 } 89 } 90 #endregion [/CODE] So I assume that before the WLAN is up and running local.AddressList only returns the local host IP, but when the WLAN is up it only returns the IP of the WLAN (And any other active network cards, but no others in my case) This IP is then used here /trunk/TvEngine3/TVLibrary/TvService/TVController.cs [CODE] 87 void StreamSetup(char* ipAdress) 88 { 89 TCHAR folder[MAX_PATH]; 90 TCHAR fileName[MAX_PATH]; 91 ::SHGetSpecialFolderPath(NULL,folder,CSIDL_COMMON_APPDATA,FALSE); 92 sprintf(fileName,"%s\\Team MediaPortal\\MediaPortal TV Server\\log\\streaming server.Log",folder); 93 ::DeleteFile(fileName); 94 95 Log("-------------- v1.0.0.1---------------"); 96 Log("Stream server:Setup stream server for ip:%s",ipAdress); 97 98 ReceivingInterfaceAddr=inet_addr(ipAdress ); 99 SendingInterfaceAddr=inet_addr(ipAdress ); 100 101 TaskScheduler* scheduler = BasicTaskScheduler::createNew(); 102 m_env = BasicUsageEnvironment::createNew(*scheduler); 103 m_rtspServer = RTSPServer::createNew(*m_env); 104 if (m_rtspServer == NULL) 105 { 106 Log("Stream server:Failed to create RTSP server: %s",m_env->getResultMsg()); 107 exit(1); 108 } 109 } [/CODE] I am wondering if it would be possible to add a section in the setup to manually enter a static IP so that there would be two servers on startup, the local host and the IP specified (And any network cards found as well). I also think that for single seat cases then the local host should always be there as well to avoid any network issues. So the client on the same PC as the Server always uses the local host and works no matter what happens to the network. This would fix both my problems. Not sure if an invalid IP address would cause issues when the RTSP server is initialised though. I'll have a look at that as well tonight, but a secondary problem is that the WLAN router is not always available as it is only powered on when I use the desktop PC, I do not tend to leave any devices switched on when not in use as I am an eco green friendly sort of bloke (aka the wife nagging me to switch things off) :D Thats a problem I could solve by having the router permanently powered so not really a big issue, but I would like to see the TV server able to work either single seat or over WLAN without the WLAN status affecting the single seat client. And some more digging around on the web and I may have come up with a solution I reckon that if I edit my HOSTS file (%windir%/system32/drivers/etc/hosts) And change it from 127.0.0.1 localhost to 192.168.2.3 htpc This should set the local host to my WLAN static IP address then it may work no matter whether the WLAN is active or not as I will always have the same IP address and host name. Anyone know if this will cause any problems with anything else? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Watch / Listen Media
Television (MyTV frontend and TV-Server)
Problem with TV Server and WLAN
Contact us
RSS
Top
Bottom