📜 ⬆️ ⬇️

Two DNLA servers on one WD My Book Live

Good afternoon, colleagues!

It all started with the fact that I got a WD My Book Live network drive. Finding out that on board, though he had a curtailed, but more or less full-fledged Debian, I decided to use the capabilities of the device to the fullest. The first and quite logical is to make a torrent-rocket from MBL. This task is easily solved with the help of Transmission - there are plenty of interfaces for it (I have a GUI for Windows and for Android). The second, arising from the first, is to automate the download from LostFilm of a new series of various series. Here the task is a little more complicated - to install and configure FlexGet. But she, too, is solved easily. The third thought on using the device is to distribute with it IPTV stream coming from the provider via UDP to various network devices, for example, on Samsung's SmartTV.
About the solution to this problem can be read under the cut.

After reading the FAQ on the device, it turned out that there are several different DLNA servers for it, but they have different specializations. Normally, Twonky v5 is on the device, but it will not be supported in updates, and new versions cost money. And I somehow didn’t like him very much in my work - the connection with him often disappeared. Although it may not be the case, but as they say, the sediment remained. I liked the mediatomb more - it is more configurable, and seems to be more stable. But, unfortunately, sharpened more under the distribution of local files. He also knows how to distribute streams, but for this you need to specifically edit playlists, as well as the script that these playlists parse (by default, it parses streams as musical). But the threads are perfectly able to distribute XUPNPD , but it works worse with local files (for example, it does not know how to look through directories recursively).

In general, I came to the conclusion that the ideal option is to have both servers on the device at the same time, and Mediatomb (for local files) and xupnpd (for IPTV). But the problem is that DLNA uses fixed UDP port 1900 to announce its presence on the network. Therefore, the first server that starts will occupy the port and will be announced individually.
')
Nevertheless, there is a way to start both servers at once. This method is called aliased interface. It allows you to bind another IP address to the existing physical interface (eth0), and access it as a separate network interface (eth0: 1). To do this, add several lines to the / etc / network / interfaces file:

auto eth0:1 iface eth0:1 inet static address 192.168.1.99 netmask 255.255.255.0 


Unfortunately, I was not able to find a way to obtain an IP address for this interface dynamically, via DHCP. An attempt to install a locally administered MAC for this interface was unsuccessful. So if anyone knows a way - I will be glad to see the description in the comments.

However, on the device, a separate interface with a separate IP address is thus obtained, and in the xupnpd settings, you can specify it as an interface for broadcasting. Next, just fill the playlist with the provider’s IPTV channels in xupnpd - and you can watch. Yes, xupnpd has its own features for recognizing playlist entries (for example, it understands the group indication for the channel in #EXINFO, but the group must be specified for each channel separately - the group from the previous channel does not match by default), but otherwise it worked for me no messing around with the settings.

Despite the fact that the setup seems to be simple - you do it at your own peril and risk. During the experiments (I will say in advance that they nevertheless ended successfully - otherwise I would not write this post) with the installation of two servers on one device, I somehow managed to break the initial boot order, as a result of which the main interface eth0 rose and pinged, but the secondary interface and network services (in particular, apache and ssh) did not rise, as a result of which it was impossible to access the device settings. I had to disassemble the device, remove the disk, connect it to the computer, and then restore the firmware by booting from SystemRescueCD . But that's another story…

UPD:
By the way, one of the possible solutions to the problem is to install xupnpd on the router. I have a DLink DIR-825, on which OpenWRT is installed, and in principle could be used as a DNLA server for distributing IPTV to it. But I am connected to Beeline home Internet, and Beeline has Internet access through L2TP. I did not measure how much the processor of the router is loaded at maximum speeds (60 Mbps), but I assume that L2TP together with the DLNA server will load it in full.

Source: https://habr.com/ru/post/170673/


All Articles