Inhaltsverzeichnis

Cubietruck als headless Video Disk Recorder (VDR)

Installation von GNU Debian 10.x aka Buster auf dem Cubietruck (ARMv7 AllWinner A20)

Quellen

Debian 10.x aka. Buster Installation

Installation wie in [1] beschrieben durchführen.

wget https://dl.armbian.com/cubietruck/nightly/Armbian_5.97.190916_Cubietruck_Debian_buster_dev_5.3.0_minimal.7z
7z e Armbian_5.97.190916_Cubietruck_Debian_buster_dev_5.3.0_minimal.7z
sudo su
dd bs=1M if=Armbian_5.97.190916_Cubietruck_Debian_buster_dev_5.3.0_minimal.img of=/dev/sdc

Konfiguration des Grundsystems

#login als root, PW: 1234, via SSH
ssh -l root <CUBIETRUCK-IP>
apt-get update
apt-get upgrade
apt-get install mc aptitude
#
# kein WLAN benötigt ...
systemctl stop hostapd
systemctl disable hostapd
#
# Zeitzone auf Europa - Berlin einstellen:
timedatectl set-timezone Europe/Berlin
# Check mit:
date
# Systemsprache ändern:
locale-gen de_DE.UTF-8
sed -i 's/LC_ALL="C"/LC_ALL=de_DE.UTF-8/g' /etc/environment
echo "LANG=de_DE.UTF-8" >> /etc/environment
echo "LANG=de_DE.UTF-8" > /etc/default/locale
echo "LANGUAGE=de_DE.UTF-8" >> /etc/default/locale
echo "LC_MESSAGES=de_DE.UTF-8" >> /etc/default/locale

Netzwerkkonfiguration

systemctl stop NetworkManager
systemctl disable NetworkManager
 
mcedit /etc/network/interfaces
...
auto eth0
iface eth0 inet static
	address 192.168.100.101
	broadcast 192.168.100.255
	netmask 255.255.255.0
	gateway 192.168.100.1
	dns-nameservers 192.168.100.1
#
systemctl restart networking
systemctl restart resolvconf
shutdown -r now && exit

NTP Server ändern

# eigenen NTP Server eintragen:
grep -v '^pool' /etc/chrony/chrony.conf > /etc/chrony/chrony.tmp; echo "server 192.168.100.1" >> /etc/chrony/chrony.tmp; mv /etc/chrony/chrony.tmp chrony.conf

Festplatte einbinden

blkid
...
/dev/sda1: UUID="de764572-848c-47a7-b38c-baf9c1c39660" TYPE="ext4" PARTUUID="74da3bc5-01"
...
mcedit /etc/fstab
UUID=de764572-848c-47a7-b38c-baf9c1c39660 /mnt/sda1 ext4 defaults 1 1
#
# HOME-Verzeichnis umleiten ;-)
mkdir -p /mnt/sda1
mount -a
mkdir -p /mnt/sda1/christoph
cd /home/
mv christoph christoph_orig
ln -s /mnt/sda1/christoph christoph
chown -R christoph:christoph /mnt/sda1/christoph
cd /home/christoph_orig
find . -depth -print | cpio -pdm ../christoph/

Installation Sundtek Treiber

ssh -l root <VDR-IP>
cd /root
wget http://www.sundtek.de/media/sundtek_netinst.sh
chmod +x sundtek_netinst.sh
./sundtek_netinst.sh
/opt/bin/mediaclient --dtvtransfermode=bulk -d /dev/dvb/adapter0/frontend0
# Reconnect Tuner #1
/opt/bin/mediaclient --dtvtransfermode=bulk -d /dev/dvb/adapter1/frontend0
# Reconnect Tuner #2
#
# VDR erneut starten wenn DVB-Tuner Treiber geladen sind:
echo "device_attach=service vdr restart" >> /etc/sundtek.conf

VDR installieren

apt-get install vdr vdr-plugin-streamdev-server vdr-plugin-vnsiserver vdradmin-am vdr-plugin-epgsearch w-scan
#
# VDR und VDRadmin-am Dienst via sytemctl starten:
systemctl start vdr && systemctl start vdradmin-am
#
# VDR und VDRadmin-am Dienst via sytemctl stoppen:
systemctl stop vdr && systemctl stop vdradmin-am
#

VDR Konfiguration

mkdir -p /mnt/sda1/video0
chown -R vdr:vdr /mnt/sda1/video0/
chmod g+w /mnt/sda1/video0/
systemctl stop vdr && systemctl stop vdradmin-am
sed -i 's/ENABLED="0"/ENABLED="1"/g' /etc/default/vdradmin-am
sed -i 's/UpdateChannels = 5/UpdateChannels = 0/g' /var/lib/vdr/setup.conf
sed -i 's/PASSWORD = linvdr/PASSWORD = vdr/g' /etc/vdradmin-am/vdradmind.conf
sed -i 's/USERNAME = linvdr/USERNAME = vdr/g' /etc/vdradmin-am/vdradmind.conf
sed -i 's/LANG = en_US.utf8/LANG = de_DE.utf8/g' /etc/vdradmin-am/vdradmind.conf
echo "LOCAL_NET = 192.168.0.0/16" >> /etc/vdradmin-am/vdradmind.conf
sed -i 's/--video=\/var\/lib\/video/--video=\/mnt\/sda1\/video0/g' /etc/vdr/conf.d/00-vdr.conf
sed -i 's/--lirc/#--lirc/g' /etc/vdr/conf.d/00-vdr.conf
sed -i 's/--vfat/#--vfat/g' /etc/vdr/conf.d/00-vdr.conf
cp /var/lib/vdr/channels.conf /var/lib/vdr/channels.conf_orig
cp /root/20190917_channels.conf /var/lib/vdr/channels.conf
chown vdr:vdr /var/lib/vdr/channels.conf
# Netzwerke zulassen:
echo "192.168.100.0/24" >> /etc/vdr/svdrphosts.conf 
echo "192.168.200.0/24" >> /etc/vdr/svdrphosts.conf
# Netzwerke zulassen:
sed -i 's/#192.168.100.0\/24/192.168.100.0\/24/g' /etc/vdr/plugins/streamdevhosts.conf
echo "192.168.200.0/24" >> /etc/vdr/plugins/streamdevhosts.conf
# Netzwerke zulassen:
echo "192.168.200.0/24" >> /etc/vdr/plugins/vnsiserver/allowed_hosts.conf
sed -i 's/192.168.0.0\/24/192.168.100.0\/24/g' /etc/vdr/plugins/vnsiserver/allowed_hosts.conf

Sendersuchlauf starten

sudo su
#apt-get install w-scan
# w_scan -fc -c DE >> /root/channels.conf
w_scan -fc -c DE >> /root/`date +%Y%m%d`_channels.conf

angepasste Kanalliste verwenden

Kanalliste kopieren nach /var/lib/vdr/channels.conf

channels.conf
Das Erste HD;ARD:330000:M256:C:6900:5101=27:0;5102=@106,5103=@106:5104;5105:0:11100:1:1051:0
ZDF HD;ZDFvision:450000:M256:C:6900:6110=27:0;6120=@106,6121=@106,6123=@106:6130;6131:0:11110:1:1079:0
NDR FS NDS HD;ARD:458000:M256:C:6900:5221=27:0;5222=@106,5223=@106:5224;5225:0:10327:1:1073:0
SAT.1;Digital Free:122000:M64:C:6900:2701=2:2702=ger@3;2703=@106:2704:0:53626:61441:10000:0
RTL;Digital Free:122000:M64:C:6900:1401=2:1402=ger@3;1403=@106:1404;6261:0:53601:61441:10000:0
ProSieben;Digital Free:442000:M256:C:6900:2201=2:2202=ger@3;2203=@106:2204:0:53621:61441:10008:0
VOX;Digital Free:394000:M256:C:6900:1701=2:1702=ger@3:1704;1700:0:53604:61441:10003:0
kabel eins;Digital Free:442000:M256:C:6900:2301=2:2302=ger@3:2304:0:53622:61441:10008:0
kabel eins Doku;Digital Free:610000:M64:C:6900:1511=2:1512=ger@3:1514:0:50122:61441:10021:0
3sat HD;ZDFvision:562000:M256:C:6900:6691=27:0;6692=@106,6693=@106,6697=@106:6694;6690:0:11150:61441:10017:0
arte HD;ARD:418000:M256:C:6900:6661=27:0;6662=@106,6663=@106,6669=@106:6664;6665,6666:0:11120:61441:10014:0
PHOENIX HD;ARD:474000:M256:C:6900:581=27:0;582=@106,583=@106:584:0:10331:61441:10009:0
zdf_neo HD;ZDFvision:474000:M256:C:6900:541=27:0;542=@106,543=@106,547=@106:544;540:0:11130:61441:10009:0
ZDFinfo HD;ZDFvision:450000:M256:C:6900:6710=27:0;6720=@106,6721=@106,6723=@106:6730;6731:0:11170:1:1079:0
tagesschau24 HD;Digital Free:586000:M256:C:6900:1221=27:0;1222=@106,1223=@106:1224:0:50062:61441:10018:0
n-tv;Digital Free:394000:M256:C:6900:1901=2:1902=ger@3,1903=qaa@4:1904:0:53606:61441:10003:0
N24 Doku;Digital Free:610000:M64:C:6900:1471=2:1472=ger@3:1474:0:51037:61441:10021:0
ONE HD;Digital Free:570000:M256:C:6900:1721=27:0;1722=@106,1723=@106:1724;1720:0:10376:61441:10023:0
ARD alpha HD;Digital Free:586000:M256:C:6900:1211=27:0;1212=@106,1213=@106:1214;1210:0:50061:61441:10018:0
KiKA HD;ZDFvision:474000:M256:C:6900:431=27:0;432=@106,433=@106:434;430:0:11160:61441:10009:0
TOGGO plus;Digital Free:402000:M256:C:6900:591=2:592=ger@3:0:0:53326:61441:10002:0
ProSieben MAXX;Digital Free:562000:M256:C:6900:6431=2:6432=ger@3;6433=@106:6434:0:53009:61441:10017:0
Welt der Wunder TV;Digital Free:610000:M64:C:6900:1421=2:1422=ger@3:0:0:51043:61441:10021:0
BR Fernsehen Süd HD;ARD:338000:M256:C:6900:5201=27:0;5202=@106,5203=@106:5204;5205:0:10325:1:1101:0
SR Fernsehen HD;Digital Free:586000:M256:C:6900:1271=27:0;1272=@106,1273=@106:1274;1270:0:50064:61441:10018:0
rbb Berlin HD;ARD:450000:M256:C:6900:5311=27:0;5312=@106,5313=@106:5314;5315:0:10351:1:1079:0
NDR FS HH HD;ARD:338000:M256:C:6900:5241=27:0;5242=@106,5243=@106:5244;5245:0:10329:1:1101:0
MDR Sachsen HD;ARD:338000:M256:C:6900:5321=27:0;5322=@106,5323=@106:5324;5325:0:10352:1:1101:0
SWR RP HD;ARD:330000:M256:C:6900:5131=27:0;5132=@106,5133=@106:5134;5135:0:10304:1:1051:0
WDR HD Köln;ARD:330000:M256:C:6900:5501=27:0;5502=@106,5503=@106:5504;5505:0:28325:1:1051:0
hr-fernsehen HD;ARD:418000:M256:C:6900:6551=27:0;6552=@106,6553=@106:6554;6550:0:10355:61441:10014:0
sixx;Digital Free:442000:M256:C:6900:1181=2:1182=ger@3:1184:0:50700:61441:10008:0
TELE 5;Digital Free:442000:M256:C:6900:411=2:412=ger@3:414:0:53002:61441:10008:0
SUPER RTL;Digital Free:394000:M256:C:6900:1501=2:1502=ger@3:1504;1500:0:53602:61441:10003:0
RTL II;Digital Free:394000:M256:C:6900:1601=2:1602=ger@3:1604;1600:0:53603:61441:10003:0
DMAX;Digital Free:466000:M256:C:6900:2291=2:2292=ger@3:2294:0:53617:61441:10007:0
SAT.1 Gold;Digital Free:538000:M256:C:6900:2431=2:2432=deu@3:2434:0:53324:61441:10022:0

vor und nach Aufnahmen ...

/etc/vdr/recording-hooks/R90.custom
case $1 in
    before)
        # do here whatever you would like to do right BEFORE
        # the recording $2 STARTS
        echo 1 > /sys/class/leds/blue\:ph21\:led1/brightness
        #sudo telegram-cli -W -e "msg <EMPFÄNGER> \"VDR: Aufnahme $2 gestartet!\""
        ;;
 
    started)
        # do here whatever you would like to do right AFTER
        # the recording $2 STARTED
        ;;
 
    after)
        # do here whatever you would like to do right AFTER
        # the recording $2 ENDED
        echo 0 > /sys/class/leds/blue\:ph21\:led1/brightness
        chmod -R g+w $2/..
        #sudo telegram-cli -W -e "msg <EMPFÄNGER> \"VDR: Aufnahme $2 beendet!\""
        ;;
 
    edited)
        # do here whatever you would like to do right AFTER
        # the recording $2 has been EDITED
        # $3 is the original recording
        ;;
    deleted)
        # do here whatever you would like to do right AFTER
        # the recording $2 has been DELETED
        ;;
esac

Radiorecorder mit Web-GUI

sudo su
apt-get install lighttpd streamripper at
systemctl status lighttpd
usermod -G vdr -a www-data
# PHP7.x
apt-get install php-common php-cgi php
lighty-enable-mod fastcgi
service lighttpd force-reload
lighty-enable-mod fastcgi-php
service lighttpd force-reload
systemctl restart lighttpd
echo "<?php phpinfo(); ?>" >> /var/www/html/phpinfo.php
# Im Browser öffnen: http://VDR-IP/phpinfo.php
# www-data aus /etc/at.deny entfernen
sed -i -e '/www-data/d' /etc/at.deny
cd ~
wget https://netcologne.dl.sourceforge.net/project/radiorecwebgui/0.3.x/radiorecorder_0.3.1.tar.gz
tar xfz radiorecorder_0.3.1.tar.gz
mkdir -p /var/www/html/radiorecorder
cp -R radiorecorder_0.3.1/* /var/www/html/radiorecorder/
touch /var/www/html/radiorecorder/res/streams.txt

/var/www/html/radiorecorder/res/streams.txt

streams.txt
NDR2;http://ndr-ndr2-niedersachsen.cast.addradio.de/ndr/ndr2/niedersachsen/mp3/128/stream.mp3
NDR Kultur;http://ndr-ndrkultur-live.cast.addradio.de/ndr/ndrkultur/live/mp3/128/stream.mp3
NDR Info;http://ndr-ndrinfo-niedersachsen.cast.addradio.de/ndr/ndrinfo/niedersachsen/mp3/128/stream.mp3
N-Joy;http://ndr-njoy-live.cast.addradio.de/ndr/njoy/live/mp3/128/stream.mp3
NDR Blue;http://ndr-ndrblue-live.cast.addradio.de/ndr/ndrblue/live/mp3/128/stream.mp3
NDR Plus;http://ndr-ndrplus-live.cast.addradio.de/ndr/ndrplus/live/mp3/128/stream.mp3
chown -R www-data:www-data /var/www/html/
mkdir /mnt/sda1/video0/radiorecorder
chown -R vdr:vdr /mnt/sda1/video0/radiorecorder/
chmod -R g+w /mnt/sda1/video0/radiorecorder/
systemctl restart lighttpd
# Im Browser öffnen: http://<VDR-IP/radiorecorder/

/var/www/html/radiorecorder/res/settings.php

settings.php
<?php
 
class Settings {
 
  public static $siteRoot = '/var/www/html/radiorecorder';
  public static $recordedFilesDestination = '/mnt/sda1/video0/radiorecorder';
  public static $language = 'de'; //"de" for german or "en" for english
  public static $locale = 'C'; // default is "C"; other possible locales: "de_AT.UTF-8" to enable all corresponding characters for the filename
  public static $defaultStreamripperParams = '';	// adds streamripper params to each call
  public static $addDatePrefixToFilename = null;	// prefix format (e.g. 'Y-m-d') or null if no prefix to add
  public static $postCommand = '';	// command to be executed after the recording is finished
  public static $logThreshold = 3; //Level of log messages, possible values : LEVEL_DEBUG=4, LEVEL_INFO=3, LEVEL_WARN=2, LEVEL_ERROR=1
 
}
 
?> 

SAMBA installieren und einrichten

apt-get install samba cifs-utils
sed -i 's/workgroup = WORKGROUP/workgroup = WG/g' /etc/samba/smb.conf
echo "wins support = no" >> /etc/samba/smb.conf
echo "wins server = eth0:192.168.100.1" >> /etc/samba/smb.conf
adduser christoph
smbpasswd -a christoph
usermod -G vdr -a christoph
systemctl restart smbd