This commit is contained in:
Boaz Sender 2025-06-26 20:14:42 -04:00
parent 12d0125d42
commit 733135d8d1
5 changed files with 115 additions and 31 deletions

View file

@ -1,44 +1,52 @@
# Broadcaster Software (icecast and darkice) # Broadcaster Software (icecast and darkice)
## Summary ## Summary
User: grace User: grace
Hostname: portal.local Hostname: portal.local
Password: emergence 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 ## 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 - Raspberry pi 4b (1 gig ram) - https://www.sparkfun.com/raspberry-pi-4-model-b-1gb.html
* 3 x XLR microphones - - 3 x USB to XLR sound card cable - https://www.amazon.com/dp/B089WFYZ5R?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1
* Raspberry pi 4 Power supply - https://www.waveshare.com/pi-psu-us-w.htm - 3 x XLR microphones -
* ethernet cable - https://hosatech.com/products/data/network-cable/cat-500/ - Raspberry pi 4 Power supply - https://www.waveshare.com/pi-psu-us-w.htm
* micro hdmi to regular hdmi cable- https://www.waveshare.com/pi-official-micro-hdmi-cable-1m.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 ## Hardware setup
* Plug the mic into the the usb cable
* Plug the usb cable into the pi - Plug the mic into the the usb cable
* Plug the pi into the wall - Plug the usb cable into the pi
- Plug the pi into the wall
## Pre work ## Pre work
1. install raspian lite 64 for raspi model 4b 1. install raspian lite 64 for raspi model 4b
2. configure user and wifi and turn on ssh services when you install 2. configure user and wifi and turn on ssh services when you install
3. boot 3. boot
4. find the ip address of the pi and ssh to it 4. find the ip address of the pi and ssh to it
## Setup instructions ## Setup instructions
### Creature comforts ### Creature comforts
1. sudo apt update && install git vim zsh 1. sudo apt update && install git vim zsh
2. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 2. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
### Icecast2 and Darkice installation ### Icecast2 and Darkice installation
Loosely following this tutorial: https://dev.to/shilleh/stream-audio-from-raspberry-pi-to-local-computer-1a1c Loosely following this tutorial: https://dev.to/shilleh/stream-audio-from-raspberry-pi-to-local-computer-1a1c
#### Install icecast2 #### 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. 2. It will ask you for three passwords. Set them all as emergence.
#### Install darkice #### Install darkice
1. sudo apt install darkice 1. sudo apt install darkice
2. sudo vim /etc/darkice.cfg 2. sudo vim /etc/darkice.cfg
@ -59,7 +67,7 @@ bitrateMode = cbr # Constant bit rate
format = mp3 # Audio format format = mp3 # Audio format
bitrate = 128 # Bitrate in kbps bitrate = 128 # Bitrate in kbps
server = localhost # Server name or IP server = localhost # Server name or IP
port = 8000 # Port number port = 80 # Port number
password=emergence # Your Icecast password password=emergence # Your Icecast password
mountPoint = portal # Mount point to stream to mountPoint = portal # Mount point to stream to
name = Black Portal # Name of the stream name = Black Portal # Name of the stream
@ -70,7 +78,9 @@ public = no # Do not list on public lists
``` ```
#### Daemonize darkice #### Daemonize darkice
1. sudo vim /lib/systemd/system/darkice.service 1. sudo vim /lib/systemd/system/darkice.service
``` ```
[Unit] [Unit]
Description=Darkice Service Description=Darkice Service
@ -84,7 +94,40 @@ ExecStart=/usr/bin/darkice -c /etc/darkice.cfg
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
``` ```
2. sudo systemctl daemon-reload 2. sudo systemctl daemon-reload
3. sudo systemctl enable icecast2 3. sudo systemctl enable icecast2
4. sudo systemctl enable darkice 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
```

View file

@ -1,37 +1,43 @@
# Hardware setup instructions # 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. 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: Make sure to do the following steps in the order they are listed:
## Requirements ## Requirements
* Modem and internet plan with a static public ip address.
* Provisioned [broadcaster](broadcaster.md) - Modem and internet plan (no static IP required - uses Dynamic DNS).
* Provisioned [listener](listener.md) - Provisioned [broadcaster](broadcaster.md) with Dynamic DNS configured
- Provisioned [listener](listener.md)
## Steps ## Steps
### Turn on broadcaster ### Turn on broadcaster
1. Plug the usb mic cable into a microphone 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) 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 3. Plug the ethernet cable into the broadcaster and the router
5. Plug the power into the broadcaster (this is how you turn it on) 4. Plug the power into the broadcaster (this is how you turn it on)
### Networking (Simplified with Dynamic DNS)
### Networking ### Networking
6. Log into the router. 6. Log into the router.
7. Find the ip address of the broadcaster (hostname portal) - usually in the advanced > network > dhcp. 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. 8. No port forwarding needed - icecast runs directly on port 80.
9. Set your router to forward all traffic coming in on port "80" to port "8000" at the local ip address of the broadcaster. 9. The broadcaster will automatically update blackportaldetroit.com with the current public IP address via Dynamic DNS.
10. Set your domain name to point to the static IP address of your modem.
### Turn on listener ### 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. 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. 2. The listener is pre-configured to stream from http://blackportaldetroit.com/portal.m3u - no manual configuration needed.
3. Type esc, w, q, enter 3. Type sudo systemctl restart listener
4. Type sudo systemctl restart listener 4. mic check
5. mic check
### Important notes ### Important notes
* The microphone must always be plugged into the broadcaster before the broadcaster is on * 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. * 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

View file

@ -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. 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 ## 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.

View file

@ -14,7 +14,7 @@ bitrateMode = cbr # Constant bit rate
format = mp3 # Audio format format = mp3 # Audio format
bitrate = 128 # Bitrate in kbps bitrate = 128 # Bitrate in kbps
server = localhost # Server name or IP server = localhost # Server name or IP
port = 8000 # Port number port = 80 # Port number
password=emergence # Your Icecast password password=emergence # Your Icecast password
mountPoint = portal # Mount point to stream to mountPoint = portal # Mount point to stream to
name = Black Portal # Name of the stream name = Black Portal # Name of the stream

View file

@ -19,8 +19,10 @@ ver="1.0"
marker="0.0.0" marker="0.0.0"
apt update 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/<port>8000<\/port>/<port>80<\/port>/g' /etc/icecast2/icecast.xml
cp ./darkice.cfg /etc/ cp ./darkice.cfg /etc/
cp ./darkice.service /lib/systemd/system/ cp ./darkice.service /lib/systemd/system/
@ -29,6 +31,31 @@ systemctl daemon-reload
systemctl enable darkice systemctl enable darkice
systemctl start 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)" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "------------------------------------------------------" echo "------------------------------------------------------"