diff --git a/docs/broadcaster.md b/docs/broadcaster.md index 4e298ba..1408e27 100644 --- a/docs/broadcaster.md +++ b/docs/broadcaster.md @@ -1,44 +1,52 @@ # Broadcaster Software (icecast and darkice) + ## Summary + User: grace Hostname: portal.local Password: emergence -Running icecast and darkice. See icecast-darkice.md for setup instructions. +Running icecast (port 80) and darkice with Namecheap Dynamic DNS for external access. See icecast-darkice.md for setup instructions. ## Bill of Materials -* Raspberry pi 4b (1 gig ram) - https://www.sparkfun.com/raspberry-pi-4-model-b-1gb.html -* 3 x USB to XLR sound card cable - https://www.amazon.com/dp/B089WFYZ5R?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1 -* 3 x XLR microphones - -* Raspberry pi 4 Power supply - https://www.waveshare.com/pi-psu-us-w.htm -* ethernet cable - https://hosatech.com/products/data/network-cable/cat-500/ -* micro hdmi to regular hdmi cable- https://www.waveshare.com/pi-official-micro-hdmi-cable-1m.htm + +- Raspberry pi 4b (1 gig ram) - https://www.sparkfun.com/raspberry-pi-4-model-b-1gb.html +- 3 x USB to XLR sound card cable - https://www.amazon.com/dp/B089WFYZ5R?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1 +- 3 x XLR microphones - +- Raspberry pi 4 Power supply - https://www.waveshare.com/pi-psu-us-w.htm +- ethernet cable - https://hosatech.com/products/data/network-cable/cat-500/ +- micro hdmi to regular hdmi cable- https://www.waveshare.com/pi-official-micro-hdmi-cable-1m.htm ## Hardware setup -* Plug the mic into the the usb cable -* Plug the usb cable into the pi -* Plug the pi into the wall + +- Plug the mic into the the usb cable +- Plug the usb cable into the pi +- Plug the pi into the wall ## Pre work + 1. install raspian lite 64 for raspi model 4b 2. configure user and wifi and turn on ssh services when you install 3. boot 4. find the ip address of the pi and ssh to it ## Setup instructions + ### Creature comforts + 1. sudo apt update && install git vim zsh 2. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ### Icecast2 and Darkice installation + Loosely following this tutorial: https://dev.to/shilleh/stream-audio-from-raspberry-pi-to-local-computer-1a1c - #### Install icecast2 -1. sudo apt install icecast2 + +1. sudo apt install icecast2 2. It will ask you for three passwords. Set them all as emergence. - #### Install darkice + 1. sudo apt install darkice 2. sudo vim /etc/darkice.cfg @@ -59,7 +67,7 @@ bitrateMode = cbr # Constant bit rate format = mp3 # Audio format bitrate = 128 # Bitrate in kbps server = localhost # Server name or IP -port = 8000 # Port number +port = 80 # Port number password=emergence # Your Icecast password mountPoint = portal # Mount point to stream to name = Black Portal # Name of the stream @@ -70,7 +78,9 @@ public = no # Do not list on public lists ``` #### Daemonize darkice + 1. sudo vim /lib/systemd/system/darkice.service + ``` [Unit] Description=Darkice Service @@ -84,7 +94,40 @@ ExecStart=/usr/bin/darkice -c /etc/darkice.cfg [Install] WantedBy=multi-user.target ``` + 2. sudo systemctl daemon-reload 3. sudo systemctl enable icecast2 4. sudo systemctl enable darkice +### Dynamic DNS Configuration (Automated) + +The install script automatically configures Namecheap Dynamic DNS to make the stream accessible at blackportaldetroit.com without requiring a static IP address. + +#### What gets installed: + +- **ddclient** - Updates your domain's IP address automatically +- **Configuration file** - Pre-configured for Namecheap at `/etc/ddclient.conf` +- **Systemd service** - Runs ddclient as a background service +- **Icecast on port 80** - Eliminates need for router port forwarding + +#### Manual steps required after installation: + +1. **In Namecheap account**: Enable Dynamic DNS for blackportaldetroit.com +2. **Add DNS record**: Create an "A + Dynamic DNS" record for "@" (root domain) +3. **Get password**: Note the Dynamic DNS password from Namecheap +4. **Update config**: Edit `/etc/ddclient.conf` and replace `REPLACE_WITH_NAMECHEAP_DDNS_PASSWORD` +5. **Start service**: Run `sudo systemctl start ddclient` +6. **No router setup needed** - icecast runs directly on port 80 + +#### Verify Dynamic DNS is working: + +```bash +# Check ddclient status +sudo systemctl status ddclient + +# View ddclient logs +sudo journalctl -u ddclient -f + +# Test DNS resolution +nslookup blackportaldetroit.com +``` diff --git a/docs/how-to-turn-it-on.md b/docs/how-to-turn-it-on.md index a833cad..5fbb4eb 100644 --- a/docs/how-to-turn-it-on.md +++ b/docs/how-to-turn-it-on.md @@ -1,37 +1,43 @@ # Hardware setup instructions + This readme contains insructions for plugging in the system and turning it on. Full software setup documentation is in the broadcaster-software.md and listener-software.md files. Make sure to do the following steps in the order they are listed: - ## Requirements -* Modem and internet plan with a static public ip address. -* Provisioned [broadcaster](broadcaster.md) -* Provisioned [listener](listener.md) + +- Modem and internet plan (no static IP required - uses Dynamic DNS). +- Provisioned [broadcaster](broadcaster.md) with Dynamic DNS configured +- Provisioned [listener](listener.md) ## Steps ### Turn on broadcaster + 1. Plug the usb mic cable into a microphone 2. Plug the usb mic cable into the top right (blue colored) usb port on the broadcaster (raspberry pi 4b) -4. Plug the ethernet cable into the broadcaster and the router -5. Plug the power into the broadcaster (this is how you turn it on) +3. Plug the ethernet cable into the broadcaster and the router +4. Plug the power into the broadcaster (this is how you turn it on) +### Networking (Simplified with Dynamic DNS) ### Networking + 6. Log into the router. 7. Find the ip address of the broadcaster (hostname portal) - usually in the advanced > network > dhcp. -8. Navigate to the NAT forwarding section of the router admin. -9. Set your router to forward all traffic coming in on port "80" to port "8000" at the local ip address of the broadcaster. -10. Set your domain name to point to the static IP address of your modem. +8. No port forwarding needed - icecast runs directly on port 80. +9. The broadcaster will automatically update blackportaldetroit.com with the current public IP address via Dynamic DNS. ### Turn on listener + 1. Turn on the listener (raspberry pi zero). plug it into a monitor and keyboard. when it boots, type sudo raspi-config. navigate to system settings and change the wifi settings so it can access the internet. -2. Type sudo vim /lib/systemd/system/listener.service and edit the line that says "ExecStart=mplayer -playlist http://" changing the http:// part to the static ip address of the router. -3. Type esc, w, q, enter -4. Type sudo systemctl restart listener -5. mic check +2. The listener is pre-configured to stream from http://blackportaldetroit.com/portal.m3u - no manual configuration needed. +3. Type sudo systemctl restart listener +4. mic check ### Important notes + * The microphone must always be plugged into the broadcaster before the broadcaster is on -* The broadcaster must always be on when the listener is turned on. if it is not, then the listener needs to be restarted once the broadcaster is on. \ No newline at end of file +* The broadcaster must always be on when the listener is turned on. if it is not, then the listener needs to be restarted once the broadcaster is on. +* Dynamic DNS automatically keeps blackportaldetroit.com pointed to your current IP address +* No router port forwarding required - icecast runs directly on port 80 diff --git a/docs/readme.md b/docs/readme.md index b582916..a3fc275 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -21,6 +21,14 @@ This repository contains custom software for turning a m3u radio stream into a l Prior research that didn't work in `research-` md files. +## Dynamic DNS Setup + +The broadcaster configures Namecheap Dynamic DNS to make the stream available at blackportaldetroit.com without requiring a static IP address. The setup includes: + +- Automatic IP address detection and updates +- Namecheap integration for seamless domain management +- Icecast running directly on port 80 (no router port forwarding needed) + ## Live access -5. If everything is turned on and configured properly, you may visit https://blackportaldetroit.com to hear the broadcaster. +5. If everything is turned on and configured properly, you may visit http://blackportaldetroit.com to hear the broadcaster. diff --git a/setup/broadcaster/darkice.cfg b/setup/broadcaster/darkice.cfg index 2b529ad..deff21a 100644 --- a/setup/broadcaster/darkice.cfg +++ b/setup/broadcaster/darkice.cfg @@ -14,7 +14,7 @@ bitrateMode = cbr # Constant bit rate format = mp3 # Audio format bitrate = 128 # Bitrate in kbps server = localhost # Server name or IP -port = 8000 # Port number +port = 80 # Port number password=emergence # Your Icecast password mountPoint = portal # Mount point to stream to name = Black Portal # Name of the stream diff --git a/setup/broadcaster/install.sh b/setup/broadcaster/install.sh index 922d584..52e091c 100644 --- a/setup/broadcaster/install.sh +++ b/setup/broadcaster/install.sh @@ -19,8 +19,10 @@ ver="1.0" marker="0.0.0" apt update -apt -y install git vim zsh darkice icecast2 +apt -y install git vim zsh darkice icecast2 ddclient +# Configure icecast to run on port 80 +sed -i 's/8000<\/port>/80<\/port>/g' /etc/icecast2/icecast.xml cp ./darkice.cfg /etc/ cp ./darkice.service /lib/systemd/system/ @@ -29,6 +31,31 @@ systemctl daemon-reload systemctl enable darkice systemctl start darkice +# Configure ddclient for Namecheap Dynamic DNS +cat > /etc/ddclient.conf << EOF +# Namecheap Dynamic DNS configuration +daemon=300 # Check every 5 minutes +syslog=yes # Log to syslog +pid=/var/run/ddclient.pid # PID file location +ssl=yes # Use SSL + +# How to get IP address +use=web, web=dynamicdns.park-your-domain.com/getip + +# Namecheap settings +protocol=namecheap +server=dynamicdns.park-your-domain.com +login=blackportaldetroit.com +password=REPLACE_WITH_NAMECHEAP_DDNS_PASSWORD +@ # Update root domain +EOF + +# Set proper permissions for ddclient config +chmod 600 /etc/ddclient.conf + +# Enable and start ddclient (but don't start until password is configured) +systemctl enable ddclient + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" echo "------------------------------------------------------"