Yes, you will need to adjust the orientation or placement of each client to properly grid the display across the single 15” screen. This involves configuring the pwomx.conf
file on each client to specify its position and dimensions within the grid. Below is the revised setup script that includes this configuration step.
Create a script named setup_piwall.sh
on the master node (192.168.0.26) to configure all Raspberry Pi devices.
#!/bin/bash
# Define environment variables for username and password
export USERNAME="your-username"
export PASSWORD="your-password"
# Define IP addresses for the master and client nodes
MASTER_NODE="192.168.0.26"
CLIENT_NODES=("192.168.0.21" "192.168.0.22" "192.168.0.23" "192.168.0.24" "192.168.0.25")
# Command to add user and set password
USER_ADD_CMD="sudo useradd -m -s /bin/bash \$USERNAME; echo '\$USERNAME:\$PASSWORD' | sudo chpasswd; sudo usermod -aG sudo \$USERNAME"
# Command to set up PiWall master node
SETUP_MASTER_CMD="sudo cp shared/* /shared/; \
sudo cp -r init/* /etc/init.d; \
sudo chmod +x /etc/init.d/piwallserver /etc/init.d/splashscreen /etc/init.d/updatesplash; \
sudo update-rc.d piwallserver defaults; \
sudo update-rc.d splashscreen defaults; \
sudo update-rc.d updatesplash defaults; \
sudo apt-get install -y fbi; \
sudo sed -e 's/tty1/tty3/' -e 's/\$ /loglevel=3 vt.global_cursor_default=0 logo.nologo/' -i /boot/cmdline.txt; \
sudo dpkg -i packages/*; \
sudo apt-get install -y libav-tools; \
sudo cp .pi* /root/; \
sudo cp /etc/network/interfaces{,.bak}; \
sudo cp network/interfaces* /etc/network; \
echo 'alias lan=/home/pi/piwall/network/localnetwork.sh' >> ~/.bashrc; \
echo 'alias wan=/home/pi/piwall/network/globalnetwork.sh' >> ~/.bashrc; \
source ~/.bashrc; \
lan; \
sudo /etc/init.d/piwallserver start"
# Function to generate client configuration based on position
generate_client_config() {
local x=$1
local y=$2
local width=$3
local height=$4
cat <<EOF
[Display]
x = $x
y = $y
width = $width
height = $height
EOF
}
# Command to set up PiWall client nodes
SETUP_CLIENT_CMD="sudo cp shared/* /shared/; \
sudo cp -r init/* /etc/init.d; \
sudo chmod +x /etc/init.d/piwalltile /etc/init.d/splashscreen /etc/init.d/updatesplash; \
sudo update-rc.d piwalltile defaults; \
sudo update-rc.d splashscreen defaults; \
sudo update-rc.d updatesplash defaults; \
sudo apt-get install -y fbi; \
sudo sed -e 's/tty1/tty3/' -e 's/\$ /loglevel=3 vt.global_cursor_default=0 logo.nologo/' -i /boot/cmdline.txt; \
sudo dpkg -i packages/*; \
sudo apt-get install -y libav-tools; \
sudo cp .pi* /root/; \
sudo cp /etc/network/interfaces{,.bak}; \
sudo cp network/interfaces* /etc/network; \
echo 'alias lan=/home/pi/piwall/network/localnetwork.sh' >> ~/.bashrc; \
echo 'alias wan=/home/pi/piwall/network/globalnetwork.sh' >> ~/.bashrc; \
source ~/.bashrc; \
lan; \
sudo /etc/init.d/piwalltile start"
# Dimensions for each client display in the grid (example for a 3x2 grid)
DISPLAY_WIDTH=640
DISPLAY_HEIGHT=480
# Loop through each client node and configure the PiWall setup
for i in "${!CLIENT_NODES[@]}"; do
IP=${CLIENT_NODES[$i]}
X=$(( (i % 3) * DISPLAY_WIDTH ))
Y=$(( (i / 3) * DISPLAY_HEIGHT ))
CLIENT_CONFIG=$(generate_client_config $X $Y $DISPLAY_WIDTH $DISPLAY_HEIGHT)
echo "Configuring client node at $IP with display position ($X, $Y)"
ssh $USERNAME@$IP "echo \"$CLIENT_CONFIG\" | sudo tee /etc/piwall/pwomx.conf"
ssh $USERNAME@$IP "$SETUP_CLIENT_CMD"
done
echo "Configuring master node at $MASTER_NODE"
ssh $USERNAME@$MASTER_NODE "$SETUP_MASTER_CMD"
echo "PiWall setup complete on all devices."
-
Ensure SSH Access:
- Ensure SSH is enabled on all Raspberry Pi devices. You can enable SSH by placing an empty file named
ssh
in the/boot
directory of the SD card, or by usingraspi-config
.
- Ensure SSH is enabled on all Raspberry Pi devices. You can enable SSH by placing an empty file named
-
Generate SSH Keys (Optional but Recommended):
-
Generate an SSH key pair on the master node and copy the public key to each Raspberry Pi for password-less SSH access:
ssh-keygen -t rsa -b 4096 -C "cdaprod@master" for IP in 192.168.0.21 192.168.0.22 192.168.0.23 192.168.0.24 192.168.0.25 192.168.0.26; do ssh-copy-id cdaprod@$IP done
-
-
Create the Setup Script:
- The script
setup_piwall.sh
is created to automate the process of configuring PiWall, including setting the user and configuring the grid layout.
- The script
-
Command Explanation:
SETUP_MASTER_CMD
: Contains commands to configure the master node, including copying shared files, enabling init scripts, installing tools, and starting the PiWall server.generate_client_config
: A function that generates the configuration for each client based on its position in the grid.SETUP_CLIENT_CMD
: Contains commands to configure the client nodes, similar to the master node but tailored for clients.
-
Configure Each Client Node:
- The loop iterates over each client node, generates the appropriate display configuration, and sets up the client.
-
Make the Script Executable:
- Use
chmod +x setup_piwall.sh
to make the script executable.
- Use
-
Run the Script:
- Running
./setup_piwall.sh
executes the script, configuring PiWall on all specified Raspberry Pi devices.
- Running
- SSH Keys: Setting up SSH key-based authentication is highly recommended for secure and automated access.
- Error Handling: Consider adding error handling to the script to manage cases where an SSH connection fails or a command does not execute properly.
- Initial Setup: Ensure all Raspberry Pis have the same initial configuration and are reachable over the network.
By following these steps, you can efficiently configure the master and client nodes for PiWall, ensuring your video wall setup works seamlessly on your single 15” screen.