Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Raspberry Pi Setup

This ansible Playbook does the following things:

  • Install pip3
  • Install jupyter-lab
  • Setup a systemd service for jupyter-lab, enable it (autostart) and start it
  • Jupyter-lab is served on 0.0.0.0:8888 with an empty password. This of course has security implications and should be discussed
  • Install the following python3 packages:
    • numpy
    • sklearn
    • matplotlib
    • pandas
    • Pillow
  • On the desktop version of Raspberry Pi OS, pil and numpy are preinstalled from the APT repository and will be removed in favour the pip3 versions. This behavior should be discussed, as there might be further problems caused by incompatible packages depending on the use of either APT or pip python packages

The project is structured as follows:

  • local.yml: The main playbook file, can be seen as the entry point
    • roles: Contains multiple roles (can be seen as small task specific playbooks). The roles are called in the local.yml

Using the ansible playbook on Raspberry Pi OS

Steps to run the ansible script on a fresh (or not fresh) installation of raspberry pi os:

# Update the APT repo sources
sudo apt update
# Install ansible and git. git is already present on the desktop os version
sudo apt install -y --no-install-recommends ansible git

# Pull and run the ansible scripts from git
# NOTE: Since the repository is currently private, the gitlab login prompt will shown. When  using 
# 2FA for gitlab the password login is not possible and an access token is needed. This will be 
# fixed in the future
sudo ansible-pull -U https://code.fbi.h-da.de/pse-ai-at-the-edge/raspberry-pi-setup.git

Notes

64-Bit Raspberry Pi OS (Desktop)

There were major problems when trying to install the software on 64-Bit Pi OS. Multiple python packages started to compile C/C++ library code on the device which caused extreme increases of installation times and full failures due to the 1GB RAM on model 3B beeing completely used up. Jupyter-lab also needed an additional dependency (libffi-dev) to compile its backend. This behavior occurred when installing packages using pip3, but not when using APT. Since some packages are not available, or too old on APT pip can't be fully avoided.

This might be caused by those python libraries depending on C/C++ code which is either shipped precompile or build on device. In this case there might be a precompiled version available for armv7 (32-bit) but not for aarch64 (64-bit), causing the C/C++ code to be compiled on device with the 64-bit OS and not with the 32-bit OS.