Complete setup guide for running the Multi-Screen Video Streaming Client on a fresh Raspberry Pi installation.
- Raspberry Pi 4B (recommended) or Raspberry Pi 3B+
- MicroSD card (16GB+ recommended)
- Power supply (5V/3A recommended for Pi 4B)
- Network connection (Ethernet or WiFi)
- Monitor/display for initial setup
- Download Raspberry Pi Imager from raspberrypi.com
- Insert microSD card into your computer
- Open Raspberry Pi Imager
- Choose OS: Select "Raspberry Pi OS (64-bit)" (recommended)
- Choose Storage: Select your microSD card
- Click Write and wait for completion
- Insert microSD card into Raspberry Pi
- Connect power, monitor, and keyboard
- Wait for first boot (may take several minutes)
- Complete initial setup:
- Set country, language, and timezone
- Create username and password
- Connect to WiFi (if using wireless)
- Update system software when prompted
# Update package list and upgrade packages
sudo apt update && sudo apt upgrade -y
# Reboot to ensure all updates are applied
sudo reboot# Enable SSH (for remote access)
sudo raspi-config
# Navigate to: Interface Options > SSH > Enable# Install essential packages
sudo apt install -y \
git \
python3 \
python3-pip \
python3-dev \
ffmpeg \
vim \
htop \
curl \
wget
# Verify installations
python3 --version
ffmpeg -version# Upgrade pip
python3 -m pip install --upgrade pip
# Install required Python packages
pip3 install --user requests# Navigate to home directory
cd ~
# Clone the repository
git clone https://github.com/Sira-K/Multiscreen
cd UB_Intern
# Make setup script executable
chmod +x client/setup_client.sh# Navigate to client directory
cd client
# Run the automatic setup script
./setup_client.sh
# The script will:
# - Verify all dependencies are installed
# - Test the client installation
# - Provide usage instructions# Edit network configuration
sudo nano /etc/dhcpcd.conf
# Add at the end (adjust for your network):
interface eth0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8 8.8.4.4
# Save and exit (Ctrl+X, Y, Enter)
# Restart networking
sudo systemctl restart dhcpcd# Install ufw if not present
sudo apt install -y ufw
# Allow SSH and HTTP
sudo ufw allow ssh
sudo ufw allow 80
sudo ufw allow 443
# Enable firewall
sudo ufw enable# Test client import
python3 -c "import client; print('Client import successful')"
# Test ffplay
ffplay -version
# Test network connectivity
ping -c 4 8.8.8.8# Test client with a local server (if available)
python3 client.py --server http://localhost:5000 --hostname test-pi --display-name "Test Display"
# Or test with external server
python3 client.py --server http://your-server-ip:5000 --hostname pi1 --display-name "Display 1"# Edit config file
sudo nano /boot/config.txt
# Add these lines (adjust values based on your cooling):
over_voltage=2
arm_freq=1750
gpu_freq=600
# Save and reboot
sudo reboot# Edit config file
sudo nano /boot/config.txt
# Add these lines:
gpu_mem=128
gpu_mem_256=128
gpu_mem_512=128
gpu_mem_1024=128
# Save and reboot
sudo reboot# Disable Bluetooth (if not needed)
sudo systemctl disable bluetooth
# Disable WiFi (if using Ethernet)
sudo systemctl disable wpa_supplicant
# Disable desktop (if running headless)
sudo systemctl set-default multi-user.target# Install monitoring tools
sudo apt install -y htop iotop nethogs
# Monitor system resources
htop
iotop
nethogs# View client logs
tail -f ~/client_logs/client.log
# View system logs
journalctl -f
# Monitor network connections
ss -tulpn# Install unattended-upgrades
sudo apt install -y unattended-upgrades
# Configure automatic security updates
sudo dpkg-reconfigure -plow unattended-upgrades# Terminal 1 - Client for Display 1
python3 client.py --server http://your-server:5000 --hostname pi1 --display-name "Display 1" &
# Terminal 2 - Client for Display 2
python3 client.py --server http://your-server:5000 --hostname pi2 --display-name "Display 2" &
# Check running processes
ps aux | grep "python3 client.py"# Install screen
sudo apt install -y screen
# Create screen session for client 1
screen -S client1
python3 client.py --server http://your-server:5000 --hostname pi1 --display-name "Display 1"
# Detach from session (Ctrl+A, D)
# Create screen session for client 2
screen -S client2
python3 client.py --server http://your-server:5000 --hostname pi2 --display-name "Display 2"
# Detach from session (Ctrl+A, D)
# List sessions
screen -ls
# Reattach to session
screen -r client1# Check Python version
python3 --version
# Check dependencies
pip3 list | grep requests
# Check ffplay
which ffplay
# Check network
ping your-server-ip# Check display permissions
echo $DISPLAY
# Test ffplay manually
ffplay -fs test-video.mp4
# Check GPU memory
vcgencmd get_mem gpu
# Check temperature
vcgencmd measure_temp# Check network configuration
ip addr show
# Check routing
ip route show
# Test DNS
nslookup your-server-domain
# Check firewall
sudo ufw status# Check CPU usage
top
# Check memory usage
free -h
# Check disk I/O
iostat
# Check network I/O
iftop# Create service file
sudo nano /etc/systemd/system/video-client.service
# Add content:
[Unit]
Description=Video Streaming Client
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/UB_Intern/client
ExecStart=/usr/bin/python3 client.py --server http://your-server:5000 --hostname pi1 --display-name "Display 1"
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
# Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable video-client
sudo systemctl start video-client
# Check status
sudo systemctl status video-client# Add to rc.local
sudo nano /etc/rc.local
# Add before "exit 0":
cd /home/pi/UB_Intern/client
python3 client.py --server http://your-server:5000 --hostname pi1 --display-name "Display 1" &
python3 client.py --server http://your-server:5000 --hostname pi2 --display-name "Display 2" &# Create dedicated user for video client
sudo adduser videoclient
sudo usermod -aG video videoclient
# Switch to dedicated user
su - videoclient# Configure firewall rules
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow from your-server-ip to any port 22
sudo ufw allow from your-server-ip to any port 80
sudo ufw allow from your-server-ip to any port 443# Set up automatic updates
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
# Schedule regular reboots
sudo crontab -e
# Add: 0 3 * * 0 /sbin/reboot- htop: Process monitoring
- iotop: Disk I/O monitoring
- nethogs: Network usage monitoring
- vcgencmd: Raspberry Pi specific commands
# Start client
python3 client.py --server http://server:5000 --hostname pi1 --display-name "Display 1"
# Check client status
ps aux | grep "python3 client.py"
# View logs
tail -f ~/client_logs/client.log
# Monitor system
htop
# Check temperature
vcgencmd measure_temp
# Check GPU memory
vcgencmd get_mem gpu
# Restart networking
sudo systemctl restart dhcpcd
# Update system
sudo apt update && sudo apt upgrade -yAfter completing this setup:
- Test with your streaming server
- Configure multiple displays if needed
- Set up monitoring and logging
- Implement automatic restart on failures
- Consider backup strategies for configuration
Your Raspberry Pi is now ready for production video streaming!