Adafruit Playground is a wonderful place to share what you find interesting. Have a cool project you are working on? Have a bit of code that you think others will find useful? Want to show off your electronics workbench? You have come to the right place.
Adafruit Playground is a safe place to share with the wonderful Adafruit community of makers and doers.
-
Raspberry Pi Stats Display
The 3D printed insert can be found here: https://www.printables.com/model/710601-pi-5-official-case-active-cooler-insert-small-came
To get the display to show stats, first install blinka by following the guide here: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi
Assuming you created a python virtual environment in /home/pi/env path, run the following commands:
cd ~
source ./env/bin/activate
pip install adafruit-circuitpython-ssd1306
Now create your python file called stats_display.py in the /home/pi directory.
-
Google Coral USB Accelerator on Raspberry Pi Bookworm
Google Coral's USB Accelerator (https://coral.ai/docs/accelerator/get-started) currently doesn't work on the Raspberry Pi OS Bookworm. In order to get the USB Accelerator to work we need to do a few extra things like install Python 3.9 and create a python virtual environment.
Install dependencies
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev
Build Python from scratch
wget https://www.python.org/ftp/python/3.9.18/Python-3.9.18.tar.xz
tar xf Python-3.9.18.tar.xz
cd Python-3.9.18
./configure --enable-optimizations
sudo make altinstall
Make a virtual environment
Python-3.9.18/python -m venv --system-site-packages tf
Next we can install Pycoral
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install libedgetpu1-std -y
sudo usermod -aG plugdevsudo ./tf/bin/pip3 install --extra-index-url https://google-coral.github.io/py-repo/ pycoral
Install any extra python libraries
sudo ./tf/bin/pip3 install opencv-python
sudo apt install libcap-dev libcamera-dev
sudo ./tf/bin/pip3 install rpi-libcamera
sudo ./tf/bin/pip3 install rpi-kms
sudo ./tf/bin/pip3 install picamera2
Note: rpi-libcamera and rpi-kms may need to be updated if your system package is updated.
As of 2/21/2024, If your are installing rpi-libcamera 0.1a2 and have updated to libcamera0.2, you will need to run the following:
cd /usr/lib/aarch64-linux-gnu
sudo ln -s /usr/lib/aarch64-linux-gnu/libcamera-base.so.0.2.0 libcamera-base.so.0.1
sudo ln -s /usr/lib/aarch64-linux-gnu/libcamera.so.0.2.0 libcamera.so.0.1
Run the python virtual environment
source ./tf/bin/activate
At this point you should be able to use the USB Accelerator against the pycoral repo: https://github.com/google-coral/pycoral.git