Digital Signage Deployment with PiSignage
Step-by-step guide to deploying PiSignage server and player on ALPON X4.
PiSignage is a robust digital signage solution designed for seamless deployment on ALPON X4. This guide walks you through building Docker images for the server and player applications, uploading them to the Sixfab Registry, and deploying them on the ALPON X4 to create a fully functional digital signage system.
Prerequisites
- Docker & buildx installed on your personal computer.
- X11 installed on your ALPON X4 (see Running GUI Apps with X11 in Containers)
To run PiSignage software on ALPON X4, we first need to build both server and player. These applications have been containerized by Sixfab to run on ALPON X4. Dockerfile files are included in this document, you can run the software by following the steps.
Note
A high-speed internet connection is required to deploy Player2 via Sixfab Connect. Player2 is approximately 2.2GB in size. Deployment may fail due to timeouts if your connection is slow.
Build Docker Images
The steps in this section should be performed on your personal computer where Docker and buildx are installed.
1. Server Image
Create a directory for the PiSignage server:
mkdir pisignage-server
cd pisignage-server
Create a Dockerfile with the following content:
FROM node:14.15-alpine3.10
RUN apk update && apk add bash
RUN apk add git
RUN apk add ffmpeg
RUN apk add imagemagick
ENV NODE_ENV=production
WORKDIR /pisignage-server
RUN git clone https://github.com/colloqi/pisignage-server.git /pisignage-server
COPY . .
RUN npm install --production
RUN chmod +x ./wait-for-it.sh
CMD [ "./wait-for-it.sh", "127.0.0.1:27017", "--", "node", "server.js"]
Build the server image:
docker buildx build --platform linux/arm64 -t pisignage-server:latest .
2. Player Image
Create a directory for the PiSignage player:
mkdir pisignage-player
cd pisignage-player
Create a Dockerfile with the following content:
FROM bitnami/minideb:latest-arm64
WORKDIR /root
COPY . .
RUN apt -y update && apt -y upgrade
RUN apt install -y wget unzip nodejs npm sudo chromium net-tools iproute2 rfkill
RUN ln -s /usr/bin/chromium /usr/bin/chromium-browser
RUN wget https://pisignage.com/releases/pi-image-p2-v14.zip
RUN unzip -o pi-image-p2-v14.zip
RUN cp player2/build-scripts/install-pisignage.sh .
RUN chmod +x install-pisignage.sh
RUN chmod +x -R player2/build-scripts
RUN chmod +x -R player2/shell-scripts
RUN ./install-pisignage.sh
RUN sed -i "s/\"--default-background-color='00000000'\"/\"--default-background-color='00000000'\", \"--no-sandbox\"/g" player2/pisignage.js
RUN apt update --fix-missing
CMD ["./start.sh"]
Build the player image:
docker buildx build --platform linux/arm64 -t pisignage-player:latest .
Push Images to Sixfab Registry
After completing the build process, we need to upload both images to the Sixfab Registry.
- Navigate to the Sixfab Registry page.
- Click on "+ Add Container" and follow the prompts.
Deployment
1. Deploy MongoDB
- Navigate to the Applications tab of your asset and click "+ Deploy".
- Enter a container name and check "I would like to use my own container path".
- Fill the "Image name" field with arm64v8/mongo:4.4.18
- Enable “Host Network”.
- Click the "Deploy" button to deploy MongoDB on ALPON X4 successfully.
2. Deploy PiSignage Server
- Navigate to the Applications tab of your asset and click "+ Deploy".
- Enter a container name and select the server image and tag from the dropdown menus.
- Enable “Host Network”.
- Click the "Deploy" button to deploy the PiSignage Server on ALPON X4 successfully.
3. Deploy PiSignage Player2
3.1 Grant Access to the Graphical Interface
Before deploying the Player2 application, the graphical interface must be defined.
Run the following command in the device terminal to grant access to the graphical interface from the container:
xhost +
(See Running GUI Apps with X11 in Containers for more details.)
3.2 Deploy the Player2 Container
-
Navigate to the Applications tab of your asset and click "+ Deploy".
-
Enter a container name and select the Player2 image and tag from the dropdown menus.
-
Click "+ Add More" in the Environment section and add the following environment variable:
Key Value DISPLAY :0 -
Click "+ Add More" in the Volumes section and configure the following volumes:
Access Mode | Local Path | Target Path |
---|---|---|
Read/Write | /tmp/.X11-unix | /tmp/.X11-unix |
Read/Write | /root/.Xauthority | /root/.Xauthority |
Read/Write | /dev/snd | /dev/snd |
- Enable "Host Network" and "Privileged".
- Click the "Deploy" button to deploy the PiSignage Player successfully.
4. Verify Deployment
- Check the main screen of your device to confirm that Player2 is running in fullscreen mode.
- Open a web browser and access ports 3000 and 8000 using the device's IP address. This verifies that the device is up and running.
- To use a local server, update the server address in the Player2 interface (running on port 8000) to
127.0.0.1:3000
. If this change is not made, the device will continue to communicate with the default main server.
Troubleshooting
Ensure that a display is physically connected to the ALPON X4. Without a connected display, commands like xhost + may result in errors such as:
If your display is connected, run the following command:
export DISPLAY=:0
Additionally, the xhost.service may fail with the following logs:
These errors indicate that the X11 display is unavailable due to the absence of a physical display or misconfiguration.
Note
A black screen after starting Xorg service is to be expected.
This completes the deployment process for PiSignage server and player on ALPON X4 using Sixfab Connect. With these steps, you have successfully set up a digital signage solution that can be managed and controlled remotely. Remember to regularly update and maintain your system to ensure optimal performance and security.
Updated 3 days ago