Skip to content

indi_pylibcamera setup

Aaron W Morris edited this page Jan 30, 2024 · 19 revisions

Install system packages

sudo apt-get install python3-picamera2

Note: It is possible to install picamera2 in the indi-allsky virtualenv, but it is not possible to install the libcamera python modules. The above requirement kind of takes care of the modules needed.

Virtualenv change

System modules must be allowed in the virtualenv

Edit virtualenv/indi-allsky/pyvenv.cfg and set include-system-site-packages = true

Example:

home = /usr/bin
include-system-site-packages = true
version = 3.11.2
executable = /usr/bin/python3.11
command = /usr/bin/python3 -m venv /home/pi/indi-allsky/virtualenv/indi-allsky

Reactivate the virtualenv

deactivate

Install indi_pylibcamera

source virtualenv/indi-allsky/bin/activate

pip3 install indi-pylibcamera

systemd indiserver unit changes

The indiserver systemd unit must be updated to allow the indi_pylibcamera module to function correctly. Uncomment the two Environment settings and add indi_pylibcamera

Note: Some of the paths are user, architecture, and python version dependent

File: $HOME/.config/systemd/user/indiserver.service

[Unit]
Description=Indi Server
After=network.target

[Service]
#User=pi
Environment="PATH=/home/pi/indi-allsky/virtualenv/indi-allsky/bin:/usr/local/bin:/usr/bin:/bin"
Environment="PYTHONPATH=/home/pi/indi-allsky/virtualenv/indi-allsky/lib/python3.11/site-packages:/usr/local/lib/aarch64-linux-gnu/python3.11/site-packages"
ExecStart=%INDI_DRIVER_PATH%/indiserver -p 7624 indi_simulator_telescope indi_pylibcamera
ExecStop=/bin/kill -TERM $MAINPID
RestartSec=5
PrivateTmp=true
UMask=0022

[Install]
WantedBy=default.target

Reload the systemd config

systemctl --user daemon-reload
Clone this wiki locally