📜 ⬆️ ⬇️

Home Media Center (HTTP, NFS, FTP, Torrent, MiniDLNA and Firebird server) based on Raspberry Pi

Most of all I do not like noise. Even the minimal noise from an external hard drive keeps me from falling asleep for a long time.

Therefore, I decided to equip my home media center only with silent (in extreme cases, low noise) components.
There was a PC (in the office), an external WD MyBook 1TB hard drive connected to the TV, a Yamaha YSP-900 sound projector, where the toslink sound was output (it's kind in the room for watching movies, that is, in the bedroom).

The Samsung B550 TV, 2009, although it shows movies from USB (after shamanism with settings), but not all, also does not know how to stream DTS to the projector. Cheap WDTV Live Streaming 2012 was chosen for watching movies, famous for its omnivorous. However, the hard drive continued to make noise and interfere with both viewing and sleeping.
')
Therefore, the hard drive was transferred to the office, and connected to the newly purchased Raspberry Pi, after which it was reformatted to ext4.

The Raspberry Pi itself is powered by the computer’s USB port (this scheme also works during deep sleep).

Further tutorial on the Raspberry Pi setup


1. Install the latest version of Raspbian www.raspberrypi.org/downloads on the card
2. Change boot settings (for fullHd screen)
disable_overscan = 1
hdmi_group = 1
hdmi_mode = 16
arm_freq = 800
Setting the frequency to more than 800 requires additional cooling, otherwise the system will be unstable and will hang tight on complex tasks.
3. Change wheezy to jessie in /etc/apt/sources.list, rename /etc/apt/sources.list.d/collabora.list and /etc/apt/sources.list/raspi.list with ~
4. Update sudo apt-get dist-update && sudo rpi-update
5. Configure SSH access by keys (http://www.howtoforge.com/set-up-ssh-with-public-key-authentication-debian-etch and www.howtoforge.com/ssh_key_based_logins_putty), disable the password entry
6. Now you need to have a permanently mounted USB
It is done this way.
sudo blkid -c / dev / null
/ etc / fstab
UUID = ae614151-2654-4ca0-88ee-4fc97a62c048 / media / WD_MyBook_1 ext4 relatime, errors = remount-ro 0 1
UUID = 17f5c5ce-6fde-48ce-98c7-b78d42205e9c / media / WD_MyBook_2 ext4 relatime, errors = remount-ro 0 1
8. On jessie there is a problem with locales . Fix perlgeek.de/en/article/set-up-a-clean-utf8-environment
9. Install torrent client transmission
sudo apt-get install transmission-daemon
sudo adduser --disabled-password transmission
sudo su transmission
transmission-daemon -f
Change settings
sudo chown -R transmission: transmission ./WD_MyBook_1
sudo chown -R transmission: transmission ./WD_MyBook_2
habrahabr.ru/post/87287 trac.transmissionbt.com/wiki/Scripts/initd

Download speed in 100 MBit network provider - about 4.5 MB / s
10. Install NFS
sudo apt-get install nfs-kernel-server portmap nfs-common
www.cyberciti.biz/faq/how-to-ubuntu-nfs-server-configuration-howto
On WDTV Live Streaming, you must enable support for Linux Shares
11. Install Lighthpd server and PHP www.penguintutor.com/linux/light-webserver
12. Install FTP, set up anonymous access within the local network .
sudo apt-get install vsftpd
Rule vsftpd.conf
anonymous_enable = YES
write_enable = YES
anon_root = / media /
anon_umask = 0000
chown_upload_mode = 0644
anon_other_write_enable = YES
anon_upload_enable = YES
anon_mkdir_write_enable = YES
use_localtime = YES
connect_from_port_20 = YES
chown_uploads = YES
chown_username = transmission
ftp_username = transmission
async_abor_enable = YES
Download speed via FTP on a local 100 MBit network - about 7 MB / s

13. The following steps require building from source , so install git and checkinstall
sudo apt-get install git-core checkinstall
14. We collect the latest version of MiniDLNA
build x264 ./configure --enable-shared --prefix = / shared && make && sudo checkinstall --pkgname = x264 --pkgversion "1: 0.git`date +% Y% m% d` +` git rev- list HEAD -n 1 | head -c 7` "--backup = no --default --fstrans = no
collect ffmpeg

sudo apt-get install build-essential libfaac-dev libfaad-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvad-dev libvdpau-dev libvorbis-dev libx11 -dev libxfixes-dev libxvidcore-dev texi2html yasm zlib1g-dev libsqlite3-dev libflac-dev

./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable -libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --extra-cflags = "- I / shared / include" --extra-ldflags = "- L / shared / lib" --extra-libs = -ldl --enable-shared --disable-static
make
sudo checkinstall -fstrans = no -install = yes -pkgname = ffmpeg -pkgversion "1: 0.svn`date +% Y% m% d`" -default

we collect MiniDLNA
./configure
make
sudo checkinstall -fstrans = no -install = yes -pkgname = MiniDLNA -pkgversion "1: 0.svn`date +% Y% m% d`" -default

Change settings MiniDLNA

media_dir = v, / media
friendly_name = Raspberry DLNA Server
db_dir = / home / pi / .minidlna
log_dir = / home / pi / .minidlna / log

On Android I watch movies through BubbleUPNP

15. Install Firebird 2.5 mapopa.blogspot.com/2012/11/debian-and-raspberry-pi-love-small-arm.html

16. Additional buns :
15.1. I installed etherwake, and if necessary, I remove the main computer from hibernation remotely via SSH
15.2. wrote a script in PHP to automatically switch to the backup ADSL channel if the main provider dies (ASUS DSL-N10 B1 router does not do it automatically), put it in the cron
15.3. As it turned out, WDTV Live Streaming does not know how to show BD Remux, but it shows perfectly BD-ISO. Therefore remuxes are distilled in ISO genisoimage -allow-limited-size -o .iso
15.4. Disconnected extra tty
15.5. Collected elinks2
15.6. Wrote a console version of the game 2048 github.com/AndriiZ/2048

Plans :
1. Connect mono as fastcgi, raise ASP.NET MVC website
2. Connect the temperature and humidity sensor. Made by github.com/AndriiZ/RaspberryPI/tree/master/SmartHouse image
3. Raise Internet Radio on Raspberry

Total: Raspberry Pi downloads and distributes content, WDTV Live Streaming and its tablet shows. And silence, because the computer, removable hard drive and Raspberry Pi are in a separate office.

Raspberry Pi is the perfect thing to experiment with.

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


All Articles