Base install - fcorthay/xPL GitHub Wiki

Table of Contents

Git

Check if git is already installed:

which git

if not, install it:

sudo apt install -y git

Timing commands

Commands can be scheduled or delayed using the at command. It doesn't have sub-minute resolution. Install it:

sudo apt install -y at

Test it:

echo 'date >> /tmp/at.log' | at now +1 min
at -l
# wait one minute
at -l
cat /tmp/at.log

Setup for Perl

Locales

If using Perl scripts, specify locales by editing /etc/default/locale:

LANG=C.UTF-8
LC_ALL=C

Test it after a reboot:

perl -e exit

Scripts documentation

Install the necessary package for the documentation of Perl scripts:

sudo apt install perl-doc

Library for finding Ethernet interfaces

Install the Perl library to find the Ethernet interfaces:

sudo apt install libio-interface-perl

Lookup the existing interfaces on the computer:

perl -MIO::Interface::Simple '-E say $_->address for grep { $_->is_running && defined $_->address } IO::Interface::Simple->interfaces'

Library for reading/writing XML files

XML files are used to store home state information and commands re-routing. Install the library:

sudo apt install -y libxml-simple-perl

Setup for Python

Check if pip is already installed:

which pip
pip -V

Install pip (Python Installs Packages), the Python package manager:

sudo apt install -y python3-pip

Network interfaces

Install netifaces globally to get access to a list of the network interfaces:

sudo apt install -y python3-netifaces

Or install netifaces locally:

pip3 install netifaces

Plotting

Drawing a plot requires the NumPy and Matplotlib libraries. Install them:

sudo apt install -y python3-numpy
sudo apt install -y python3-matplotlib

Control user

The xPL scripts are meant to be run by a user other than root. Add the control user:

sudo useradd -m -g users -G users,dialout,audio -s /bin/bash control
sudo passwd control

Or add the control user to some groups:

sudo usermod -a -G users,dialout,audio control

Check the groups containing the user control:

cat /etc/group | grep control | sort

Install the scripts:

su control

mkdir ~/Controls
cd ~/Controls
git clone https://github.com/fcorthay/xPL.git

Hub

Continue and install an xPL hub.

⚠️ **GitHub.com Fallback** ⚠️