From 5ddf3ba232125fd26eaea6f58921b64f1df23d9a Mon Sep 17 00:00:00 2001 From: Francine Wright Date: Thu, 25 Jul 2024 18:36:47 +0000 Subject: [PATCH] add CSI2 camera support --- stage-gl1/01-install-python-libraries/00-run-chroot.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stage-gl1/01-install-python-libraries/00-run-chroot.sh b/stage-gl1/01-install-python-libraries/00-run-chroot.sh index a47a733..ded34e2 100755 --- a/stage-gl1/01-install-python-libraries/00-run-chroot.sh +++ b/stage-gl1/01-install-python-libraries/00-run-chroot.sh @@ -1,7 +1,8 @@ #!/bin/bash -e -# set up a groundlight virtual environment for python -python3 -m venv /opt/groundlight/gl-py +# Set up a groundlight virtual environment for python. --system-site-packages is +# required for picamera2. +python3 -m venv /opt/groundlight/gl-py --system-site-packages source /opt/groundlight/gl-py/bin/activate # Now install the groundlight python libraries @@ -9,6 +10,11 @@ pip install groundlight # framegrab will install opencv-python, numpy, and pillow pip install framegrab +# Install picamera2, required for use of Raspberry Pi CSI2 cameras. Note that there is +# an option to install through pip, but that is not the reccommended installation +# method. --no-install-recommends prevents installation of GUI dependencies. +sudo apt install -y python3-picamera2 --no-install-recommends + # add a .bashrc entry to activate the groundlight virtual environment echo "source /opt/groundlight/gl-py/bin/activate" >> /home/${FIRST_USER_NAME}/.bashrc