Skip to main content

Target Setup Guide for RPi5

Before you Begin

Before starting with the setup guide, we recommend the following to get familiar with CGI-Studio:

  • Explore CGI-Studio
    Read the Quick Start Guide.
  • Learn to create SceneComposer Solutions
    The documentation provides instructions on how to create simple SceneComposer solutions. To access SceneComposer navigate to:
    <cgi-studio-installation-path>\bin\SceneComposer\SceneComposer.exe
  • Generate Assets for Simulation and Target Environments
    You can find guidance on generating assets from solutions (binary files containing solution information for the player) for both simulation and target environments in the documentation.

With this knowledge you should be fit to complete this guide.


Software Image Setup

The CGI Studio Community Edition supports both Raspberry Pi 4 and Raspberry Pi 5. The following section describes how you can install the Community Edition on your Raspberry Pi device.

  1. Download and install the Raspberry Pi Imager from this link: Raspberry Pi software – Raspberry Pi.
  2. Insert a compatible SD card into your computer for flashing the image.
  3. Open Raspberry Pi Imager and click Choose Device.
  4. Select your Raspberry Pi 4 or Raspberry Pi 5 model.

    Raspberry Pi 5 selection

  5. Next choose the OS and select "Raspberry Pi OS (64-bit)".

    OS selection

  6. Next choose storage, select the inserted SD card, and click next.
  7. In the customization click next till the "Customisation: SSH authentication" configuration occurs, Enable SSH here.

    image.png

  8. Click next and click on write, this will take some time and write the OS on SD card.
  9. Now eject the SD card from your PC.

Flash OS on Raspberry Pi 5

Flashing the operating system formats and configures your microSD card with the native Linux environment (Raspberry Pi OS Bookworm) required to run the Pi hardware. This guide outlines the initial hardware setup, booting, and first-time configuration process for provisioning the operating system on a Raspberry Pi 5.

  1. Insert the SD Card: Insert the flashed microSD card securely into the dedicated card slot on Raspberry Pi 5 board.
  2. Connect Hardware: Connect your Raspberry Pi 5 to an external display (using a micro-HDMI to HDMI cable), plug in your USB touch interface/peripherals or connect to DSI cable, and connect the official USB-C power supply to power it on.

  3. Initial Boot & Setup: The OS will automatically begin its initial boot diagnostics. Follow the on-screen configuration wizard to set up your region, skip the Wi-Fi and connect LAN, and establish your core username and password.
  4. Boot to Desktop: Once you complete the wizard, the system will finalize its settings and boot directly into the desktop user interface.
  5. Once installed, the OS UI will appear on the display.

Connecting to the Raspberry Pi using SSH (WinSCP)

After booting, connect to the target device via a serial terminal (e.g., Tera Term) or SSH.

At Candera we used WinSCP to transfer additional files. After this step, your target system will be ready to run Python-based data binding examples or assets using the CGI-Studio runtime environment. Use the IP address of your Raspberry Pi device and your credentials for connecting with WinSCP.

SSH connection example


Install DEB package on the RPi5

Installing this Debian (.deb) package configures the native CGI Studio Player application on your Raspberry Pi 5. This guide outlines the process of transferring and installing the CGI Studio Community package onto a Raspberry Pi 5 using WinSCP and the terminal.

  • Transfer the File: Use WinSCP to transfer the downloaded .deb file to your Raspberry Pi (e.g., /home/username/).
  • Navigate to the Directory: Use cd and verify with ls.
  • Install the Package:
    sudo apt update
    sudo apt install ./cgi-studio-community-rpi5_3.16.0-arm64.deb

Run Blood Pressure Sample with Target Player

The blood pressure device sample is a Scene Composer sample that demonstrates a blood pressure measurement device with exemplary scenes and animations. General information on this sample can be found in the Blood Pressure Solution documentation.

Follow the steps below to run the Blood Pressure sample.

  1. Execute the command in the terminal
    Player /opt/candera/Samples/BloodPressureDevice/BloodPressureDevice.bin
    The asset will be visible on the target device.

Blood pressure example

Run Blood Pressure Sample with Player Connector Library 

For the Community Edition, the sample was extended with a data binding sample programmed in Python. The Python part of the sample relies on the Python-Based Player Data Binding Library to interact with the data bindings of the scene. Once the hardware is set up follow these steps to configure the Python environment and execute the sample.
The Python code for the blood pressure device sample can be found under:
\bin\CommunityEdition\Python\Samples\BloodPressureDevice on the host computer.

Follow the steps below to run the Blood Pressure sample with player connector library.

  1. In Target open terminal and navigate to project directory
    Open the terminal on your Raspberry Pi and move to the specific sample directory:
    Command - 
    cd /opt/candera/Samples/BloodPressureDevice
  2. Prepare the System Environment
    Before running the application, ensure the system package list is up to date and that the Python virtual environment module is installed:
    Commands - 
    sudo apt update
    sudo apt install python3-venv
  3. Configure the Python Virtual Environment
    Creating a virtual environment ensures that the dependencies for the Candera sample do not conflict with other system libraries.
    1. Create the environment: 
    python3 -m venv .
    2. Activate the environment: 
    source bin/activate
  4. Install Dependencies
    Install the required Python packages defined in the project's requirements file:
    Command -
    pip install -r ./requirementsWithoutSoundhound.txt
  5. Configure Environment Variables
    For the application to locate the Candera libraries and GStreamer plugins, you must export the following paths.
    Important: These exports are session-specific. If you close the terminal, you will need to run them again.
    Commands - 
    export PYTHONPATH=$PYTHONPATH:/opt/candera:/opt/candera/CanderaAppConnector:/opt/candera/Samples/BloodPressureDevice
    export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0
    export GSTREAMER_ROOT=/usr/lib/aarch64-linux-gnu/
  6. Run the Blood Pressure Sample
    Execute the main script by pointing it to the Player Connector library and the compiled asset file:
    Command  - 
    python3 BloodPressureDevice.py -wsh -lbp /opt/candera/PlayerConnector/libPlayerConnectorLibrary.so -abp /opt/candera/Samples/BloodPressureDevice/BloodPressureDevice.bin
    Verification: Upon execution, the Blood Pressure Device UI should initialize and appear on your connected Raspberry Pi display.
    NOTE: If the display is portrait mode but if needs to be rotated to landscape mode.
    Command -  wlr-randr --output DSI-2 --transform 90