Difference between revisions of "Install Canvas"

From xPL
Jump to: navigation, search
(Created page with "A [https://www.raspberrypi.org/ Raspberry Pi] can easily serve 4&nbspK high definition images (3840 x 2160 pixels) to a TV screen or a computer monitor. The sys...")
 
(Debian with SystemD)
 
(2 intermediate revisions by one user not shown)
Line 23: Line 23:
 
* the [[Install dawnDusk|dawn/dusk messenger]]
 
* the [[Install dawnDusk|dawn/dusk messenger]]
  
Next, install a [[install http|web server]] for the control of the display over web pages.
+
= Install xPL picture frame =
 +
 
 +
Download the [http://www.dspc.ch/xPL/Downloads/xpl-canvas.pl 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 [https://wiki.debian.org/systemd systemd] (such as [https://www.raspbian.org/ Raspbian]),
 +
the scripts can be defined as services.
 +
 
 +
Edit <code>/lib/systemd/system/xpl-canvas.service</code>:
 +
[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
 +
 
 +
 
 +
[[Category: all]] [[Category: install]] [[Category:xPL]]

Latest revision as of 11:34, 19 March 2019

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