Installation Guide
On older Raspberry Pi hardware you should give the supervisor processes plenty of time to startup. Once they are fully loaded any excessive CPU usage should drop off.
Supervisord Warning
Pi Portal makes heavy use of supervisord to manage processes.
If you have custom configuration for supervisord you will encounter problems during install and uninstall. Deploying Pi Portal as a docker container is strongly recommended in these types of scenarios.
Docker Container
This is probably the simplest approach, but requires installing docker:
Steps:
Create a configuration file based on your Slack Bot and GPIOs.
Install the container as a service:
docker run \ -d \ --restart unless-stopped \ --device /dev/gpiomem \ --device /dev/video0 \ -v ${PWD}/[your_config_file.json]:/config.json \ ghcr.io/pi-portal/pi-portal:latest
Log into Slack and start interacting with your camera and sensors.
Important Note:
Anyone user who is a member of the
dockergroup will have full access to the container!
Raspberry PI OS
The pi_portal Debian packages are also fairly straightforward to install:
Steps:
Identify your CPU architecture
uname -mIdentify the underlying Debian version of your Raspberry Pi OS install:
cat /etc/os-releaseVisit the pi_portal releases page and download the corresponding Debian package.
Install the Debian package:
sudo apt update sudo apt install ./pi_portal-x.x.x-[architecture]-[distribution].deb
Create a configuration file based on your Slack Bot and GPIOs.
Install your configuration file:
sudo portal install_config [your_config_file.json]
Test your installation:
sudo portal version
Log into Slack and start interacting with your camera and sensors.
Other Linux Distributions
You’ll need to roll up your sleeves a little bit when installing pi_portal manually, but it’s not that hard …
Steps:
Identify your CPU architecture
uname -mVisit the pi_portal releases page and download:
the correct filebeat tarball for your CPU
the pi_portal python wheel
Assume root privileges:
sudo suInstall filebeat:
# as root tar xvzf filebeat-linux-[x-x-x]-[architecture].tar.gz -C /usr/bin
Install the Python build dependencies. (Commands and exact package names vary by distribution.)
python3 (Versions 3.8 through 3.11 are supported.)
python3-dev (Versions 3.8 through 3.11 are supported.)
Note: you may also need to install packages such as
python3-venvandpython3-pipif they aren’t included in your distribution’s corepython3package.
Install the runtime dependencies. (Commands and exact package names vary by distribution.)
It would be prudent to stop any services launched for motion or supervisor at this point.
The installer will attempt this as well, but your distribution may have an unknown init system.
Create the pi-portal user:
# as root useradd pi-portal --no-create-home -s /bin/false -l
Create a configuration file based on your Slack Bot and GPIOs.
Install the pi_portal wheel:
# as root mkdir -p /opt/venvs python3 -m venv /opt/venvs/pi-portal source /opt/venvs/pi-portal/bin/activate pip install ./pi_portal-x.x.x-py3-none-any.whl chown -R pi-portal:pi-portal /opt/venvs/pi-portal
You can customize the location by setting an environment variable.
While still acting as root, install your configuration file:
# as root pi_portal install_config [your_config_file.json]
Confirm you install was successful:
# as root portal version
Drop root privileges:
# as root exit
You may need to manually start the supervisor service if the installer doesn’t recognize your init system.
Log into Slack and start interacting with your camera and sensors.