Install Canvas

From xPL
Jump to: navigation, search

A Raspberry Pi can easily serve 4&nbspK high definition images (3840 x 2160 pixels) to a TV screen or a computer monitor. The system is aimed to remain lightweight. It uses the framebuffer to display the images and, as such, doesn't require the X Window System to be installed.

The installation instructions are provided for raspbian on a Raspberry Pi.

Base installation

At first, install the raspbian console operating system.

Set the framebuffer resolution to match the monitor's.

Install the framebuffer image viewer together with the graphic libraries for image transformation and display.

The system is to be controlled via xPL. Install:

Install xPL picture frame

Download the screen controller script to xPL scripts directory:

su control
SCRIPTS_BASE_DIR=/home/control/Documents/Controls
cd $SCRIPTS_BASE_DIR
wget http://www.dspc.ch/xPL/Downloads/xpl-canvas.pl
chown control:users *.pl
chmod 775 *.pl

Test the picture display:

su control
SCRIPTS_BASE_DIR=/home/control/Documents/Controls
$SCRIPTS_BASE_DIR/xpl-canvas.pl -vn canvas1 -u 60

Open another terminal window and test the commands:

su control
SCRIPTS_BASE_DIR=/home/control/Documents/Controls
$SCRIPTS_BASE_DIR/xpl-send.pl -v -t cmnd -c canvas.basic -d dspc-canvas.canvas1 command=stop
$SCRIPTS_BASE_DIR/xpl-send.pl -v -t cmnd -c canvas.basic -d dspc-canvas.canvas1 command=start
$SCRIPTS_BASE_DIR/xpl-send.pl -v -t cmnd -c canvas.basic command=next
$SCRIPTS_BASE_DIR/xpl-send.pl -v -t cmnd -c canvas.basic directory=/home/control/Canvas/Paintings/Tintoretto
$SCRIPTS_BASE_DIR/xpl-send.pl -v -t cmnd -c canvas.basic duration=10

Alternatively, start an xPL monitor and watch the status information issued by the canvas:

$SCRIPTS_BASE_DIR/xpl-monitor.pl -vf

Launch the scripts at startup

Debian with SystemD

On Debian with systemd (such as Raspbian), the scripts can be defined as services.

Edit /lib/systemd/system/xpl-canvas.service:

[Unit]
Description=picture display service
After=xpl-hub.service

[Service]
Type=simple
User=control
Group=users
ExecStart=/home/control/Documents/Controls/xpl-canvas.pl -n canvas1
Restart=always

[Install]
WantedBy=multi-user.target

Activate the service:

su
systemctl enable xpl-canvas.service
service xpl-canvas start

Reboot and check:

ps ax | grep -v grep | grep -i xpl
systemctl list-units --type=service --state=running | grep xpl
service xpl-canvas status