Dies ist eine alte Version des Dokuments!


Musik im Raum

Für die Musik läuft ein MPD auf einem Raspberry PI 3

Hostname rpi3.raum.ctdo.de User: pi Pass: wasserfall

Per ssh einloggen und „ncmpc“ eingeben.

Musik per Webbrowser steuern: http://raum.ctdo.de/mpd/

Die Quellenwahl und Lautstärke kann durch das Projekt Audiosteuerung gemacht werden.

Konfiguration auf dem Raspberry Pi

/etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.

# Activate iptables firewall: Only access from CTDO-IP-Range
iptables -F INPUT
iptables -P INPUT DROP
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -i lo -m conntrack --ctstate NEW -j ACCEPT
iptables -A INPUT -s 195.160.168.0/23 -m conntrack --ctstate NEW -j ACCEPT
iptables -A INPUT -j REJECT

# Activate ip6tables firewall: Only access from CTDO-IP-Range (IPv6)
ip6tables -F INPUT
ip6tables -P INPUT DROP
ip6tables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
ip6tables -A INPUT -p icmpv6 -j ACCEPT
ip6tables -A INPUT -i lo -m conntrack --ctstate NEW -j ACCEPT
ip6tables -A INPUT -s fe80::/10,2001:67c:275c::/48 -m conntrack --ctstate NEW -j ACCEPT
ip6tables -A INPUT -j REJECT

# Make sure that volume is UP when rpi has booted
amixer set Master 100%

# Do NOT play anything after reboot. (Don't freak out the one who just gave power to the room)
mpc pause

# Bridge script to give information about current file to MQTT.
/usr/bin/python3.2 /home/lucas/mpd-to-mqtt.py  >> /dev/null &

exit 0
  • Zuletzt geändert: 05.08.2022 22:51
  • (Externe Bearbeitung)