Skip to main content

RPI5 Target Setup Guide

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

    Download and install the Raspberry Pi Imager from this link (https://www.raspberrypi.com/software/) Open Raspberry Pi Imager and click on choose device.

    image.png


    Click on Raspberry Pi 5.

    image.png


    Next choose the OS and scroll to “Use custom.”

    image.png


    Click Ok and browse for the downloaded .img file provided by Candera and open.

    image.png


    Next choose storage and select the SD card 64gb which is inserted and click on next, this will take some time to flash OS on SD card.
    Now eject the SD card form Laptop/PC.

    Flash OS on Raspberry Pi 5 

      Insert the flashed SD card into Raspberry pi 5 board.
      Connect the Raspberry Pi board to a display, connect USB for touch, and insert SD card into Raspberry Pi board and switch on the power supply.
      OS will automatically start to install on Raspberry Pi.
      Once installed you can see OS UI 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 have used WinSCP to transfer additional files to the target device as needed.
      After this step, your target system will be prepared to run Python-based data binding examples or any assets using the CGI-Studio runtime environment.
      The login credentials for the connection are -
      Username: candera 
      Password: candera

      image.png

      NOTE : To get the IP address of the RPI5 once it is connected to LAN, connect RPI5 with a keyboard and press “Ctrl+Alt+F4”. This will open a window asking for username and password, put candera for both and enter the command “ip addr show”, this will show the ip address of the connected network. Once you connect to the network using WinSCP or tera-term, press “Ctrl+Alt+F1” to come back to main screen.

      Blood Pressure Sample

        We have prepared several samples to demonstrate the capabilities of CGI-Studio on the target image. These samples are located at:
        /opt/candera/Samples/ on the target image and in <cgi-studio-installation-path>\bin\ProfessionalEdition\Python\Samples on the host computer.
        We will use the Blood Pressure Sample as an example to demonstrate how to run our samples. The Blood Pressure device sample is a Scene Composer sample that showcases a blood pressure measurement device with exemplary scenes and animations. 
        For the Professional 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.
        In this section we will explain how to run the BloodPressureSample with our precompiled target player and with the Player Connector Library. For this chapter the completed “Image Setup” is required.

        Run Blood Pressure Sample with Target Player

        Follow the steps given below to run the Blood Pressure sample on the target with our precompiled target player:

        1. Navigate to the player directory.

        cd /opt/candera/Player

        2. Run the Asset
            Execute the below command in the terminal

        ./Player ../Samples/BloodPressureDevice/BloodPressureDevice.bin

        3. The Asset will be visible on the target device.    

        image.png

        Run Blood Pressure Sample with Player Connector Library 

        Once the hardware is set up follow these steps to configure the Python environment and execute the sample.

          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
          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
          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
          source bin/activate

          Install Dependencies
          Install the required Python packages defined in the project's requirements file:
          Command -
          pip install -r ./requirementsWithoutSoundhound.txt

          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/

          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 - sudo XDG_RUNTIME_DIR=/tmp wlr-randr --output DSI-1 --transform 90

          Run Slider and Gauge Sample with Player Connector Library

            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/SliderAndGauge

            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

            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
            source bin/activate

            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/SliderAndGauge
            export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0
            export GSTREAMER_ROOT=/usr/lib/aarch64-linux-gnu/

            Run the Slider and gauge Sample
            Execute the main script by pointing it to the Player Connector library and the compiled asset file:
            Command  -
            python3 Sample.py  -lbp /opt/candera/PlayerConnector/libPlayerConnectorLibrary.so -abp /opt/candera/Samples/SliderAndGauge/SliderAndGauge.bin

            Verification: Upon execution, the Slider and gauge UI should initialize and appear on your connected Raspberry Pi display. The slider and gauge moves accordingly.