Skip to content

Install_items

Pragmatismo edited this page Apr 7, 2023 · 3 revisions

Adding new install items

This is for the NEW gui, currently called test_gui and is currently work in progress

The pigrow gui's install dialogue is designed to make it easy to add new sensors and scripts in a modular fashion, this is achieved by looking through the subfolders of the installer folder and reading the text files within which give the details for how to install the required dependencies.

Each subfolder's name is added to the dropdown box in the install dialogue, the files ending with _install.txt within that folder are added under that category - Pigrow/scripts/gui/test/installer/sensor/bme280_install.txt for example will appear in the sensor category as bme280.

The files are simple key=value lists of information;

install_method=pip
package_name=adafruit-circuitpython-bme280
test=import 
import=adafruit_bme280

this tells it to use pip to install the package using the supplied package name, it also tells it to test if it's successfully installed by attempting to import it into python using the supplied name.

Available Test Methods

To test if something is currently installed there are several methods depending on the item;

python import

Attempts to import the package into python and sets to false if import fails.

test=import
import=<package name as used in python>

git folder test

Checks for the existence of the folder and the git log file, this should indicate a completed install.

test=git

file

Looks for the location of a given file,

test=file

apt

Checks to see if a program is installed by using the command 'which' and the programs name, e.g.

which mpv 

returns the path to the program file for mpv (/usr/bin/mpv) when installed and nothing when it's not

test=apt
import=<program name>  

Available Install Methods

pip

Pip is the python package manager used to install and update most python packages,

apt

Apt is a linux package management tool that's used for installing programs within the Raspberry Pi OS repository, these are generally stand-alone programs but in same cases can also be python packages or similar.

git

Git is a version management system used by many programs to allow easy install and updating of software, the pigrow itself uses this to install as the project is hosted on GitHub.

wget

wget is a linux command used to download a file from the internet, generally further steps such as unpacking and compiling the software are required after the download has been completed but this is not always the case.

Clone this wiki locally