Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I120 installer fails #121

Merged
merged 11 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,15 @@ hostname
Hostname
cpu
cpuload
VaporwareII
harperreed
systemctl
nonint
raspi
RPiOS
PiWheels
pre
dev
cp
usr
spi
60 changes: 58 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ See the [Change Log](./documentation/Change_Log.md) for a complete list of updat

## PaperPi Requirements

PaperPi is compatible with Raspberry Pi OS Bullseye. Some python dependencies such as *numpy* will may not build properly under Buster.
PaperPi is compatible with 32 bit Raspberry Pi OS Bullseye. Some python dependencies such as *numpy* may not build properly under Buster.

PaperPi will not automatically install under the 64 bit versions of Raspberry Pi OS. See the [Manual Installation Instructions](#manual-install-for-rpios-64-bit) for 64 bit installs below.

### Required Hardware

Expand Down Expand Up @@ -132,7 +134,60 @@ If you would rather install PaperPi yourself without running a remote script, [c

If you would like to remote install from a different remote branch, use:

`curl -fsSL https://raw.githubusercontent.com/txoof/PaperPi/I113_install_scripts/install/remote_install.sh | bash -s -- -b REPLACE_WITH_BRANCH_NAME`
`curl -fsSL https://raw.githubusercontent.com/txoof/PaperPi/main/install/remote_install.sh | bash -s -- -b REPLACE_WITH_BRANCH_NAME`

### Manual Install for RPiOS 64 bit

PaperPi depends on pre-built wheels from PiWheels to create it's virtual environment. Installing PaperPi. Several critical modules (e.g. Pillow) will fail to install correctly and cause **shed-loads** of dependency errors.

It is possible to manually install PaperPi on a 64 bit system, but it requires some extra work and is not officially supported. These instructions are intended for those that are savvy on the command line and can do some of their own problem solving.

Thanks to @VaporwareII & @harperreed for helping sort this out.

This is all best done as root. Be careful and good luck: you're on your own!

1. Clone PaperPi into a temporary directory:
```
git clone https://github.com/txoof/PaperPi.git
```
2. Run the install script and skip the OS Version Check:
```
# ./install/install.sh -s
```
3. Change to the install directory and create a virtual environment:
```
# export PIPENV_VENV_IN_PROJECT=1
# pipenv --python 3
```
4. Install `pillow` manually: `# pipenv install pillow`
- this *should* avoid dependency issues
5. Install development modules
```
# pipenv install --dev
```
6. Copy the entry script into `/usr/bin/`:
```
# cp ./PaperPi/install/paperpi /usr/bin/
```
7. Enable SPI:
```
# sudo raspi-config nonint do_spi 0
```
8. Copy the configuration file to `/etc/default`
```
# cp ./PaperPi/install/paperpi.ini /etc/default/
```
9. Install and enable the daemon unit file (optional)
```
# cp ./PaperPi/install/paperpi-daemon.service /etc/systemd/system/
# /bin/systemctl daemon-reload
# /bin/systemctl enable /etc/systemd/system/paperpi-daemon.service
```
10. Edit the config file in `/etc/default`
11. Start the daemon (optional)
```
# systemctl restart paperpi-daemon.service
```

### Setup

Expand Down Expand Up @@ -337,3 +392,4 @@ If you're interested in helping out, check out the [issues](https://github.com/t
* @aaronr8684 - writing installer, catching hundreds of errors and generally be a great person
* @veebch - inspiration for Reddit and Crypto plugins
* @PaperCloud10 - testing of new versions and debugging slideshow plugin
* @VaporwareII, @harperreed - diagnosing remote installation failures
40 changes: 40 additions & 0 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ SYSTEMD_UNIT_PATH="/etc/systemd/system/$SYSTEMD_UNIT_FILE_NAME"
CONFIG_FILE_NAME=$APPNAME.ini
SYSTEM_CONFIG_PATH=/etc/default/$CONFIG_FILE_NAME

SKIP_OS_CHECK=0

function abort {
# abort installation with message
printf "%s\n" "$@"
Expand All @@ -36,6 +38,21 @@ function abort {
exit 1
}

function check_os {
if [ "$SKIP_OS_CHECK" -eq 1 ]
then
echo "skiping OS version checking. YOU'RE ON YOUR OWN!"
return 0
fi

echo "checking OS"
long_bit=$(getconf LONG_BIT)
if [ ! "$long_bit" -eq 32 ]
then
abort "PaperPi is supported only on 32 bit versions of RaspberryPi OS. Your version: $long_bit bit. Check README for manual install instructions"
fi
}


function stop_daemon {
echo "checking if $SYSTEMD_UNIT_FILE_NAME is running"
Expand Down Expand Up @@ -576,6 +593,7 @@ function Help {
-h This help screen
-u uninstall $APPNAME
-p uninstall $APPNAME and purge all config files
-s skip OS version check for manuall install on 64 bit systems
"

}
Expand All @@ -594,6 +612,11 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
-s) # skip OS version check
SKIP_OS_CHECK=1
shift
shift
;;
-u) # uninstall
INSTALL=0
UNINSTALL=1
Expand Down Expand Up @@ -640,11 +663,28 @@ fi
# set the pipenv venv to be within the project directory (1)
export PIPENV_VENV_IN_PROJECT=1

check_os
stop_daemon
check_permissions
check_deb_packages
check_py_packages
copy_files
if [ "$SKIP_OS_CHECK" -eq 1 ]
then
echo " "
printf "Basic install completed. You must now manually:
- create a pipenv in $INSTALLPATH/$APPNAME
- install development plugin requirements from the Pipfile in $INSTALLPATH/$APPNAME
- install the entry script in $BINPATH
- install the config in /etc/default
- install and enable the unit file (optional)
- enable SPI
- edit the config in /etc/defaults
- cleanup temporary files
- start the daemon (optional)
"
exit 0
fi
create_pipenv
install_plugin_requirements
install_executable
Expand Down
12 changes: 12 additions & 0 deletions install/remote_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ PP_GITREPO="https://github.com/txoof/PaperPi.git"
#PP_GITBRANCH="manage_modules"
PP_GITBRANCH="main"

long_bit=$(getconf LONG_BIT)


if [[ $1 == "-b" && ! -z $2 ]]
then
PP_GITBRANCH="$2"
Expand Down Expand Up @@ -60,13 +63,22 @@ ohai() {
printf "${tty_blue}==>${tty_bold} %s${tty_reset}\n" "$(shell_join "$@")"
}




# Fail fast with a concise message when not using bash
# Single brackets are needed here for POSIX compatibility
if [ -z "${BASH_VERSION:-}" ]
then
abort "Bash is required to interpret this script."
fi

# fail if not 32 bit os
if [ ! "$long_bit" == "32" ]
then
abort "PaperPi is officially supported only on 32 bit versions of RaspberryPi OS. See the READMEfor manual install instructions."
fi

# check if git is available
if ! command -v git > /dev/null
then
Expand Down
2 changes: 1 addition & 1 deletion paperpi/my_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
APP_NAME = 'PaperPi'
CONTACT='aaron.ciuffo@gmail.com'
DEVEL_NAME = f'com.txoof.{APP_NAME.lower()}'
VERSION='0.5.4.0 RGB'
VERSION='0.5.4.1 RGB'
URL = 'https://github.com/ txoof/PaperPi'


Expand Down
Loading