LogoLogo
qoitech.com
  • Welcome
  • Otii PRODUCT SUITE
    • Overview
      • What’s included
    • Otii hardware
      • Otii Arc Pro
      • Otii Ace Pro
    • Otii software
      • Otii 3 Desktop App
      • Otii Toolbox
        • Otii Battery Toolbox [BT]
        • Otii Automation Toolbox [AT]
  • Otii SETUP
    • Connecting Otii hardware
      • Otii hardware overview
        • Otii Arc Pro overview
        • Otii Ace Pro overview
      • Wiring up
        • Expansion Port
        • Measuring DUT
        • Measuring a subsystem
        • External power source
        • Capture UART logs
    • Installing Otii software
      • Windows 10/11 setup
      • macOS setup
      • Ubuntu setup
      • Raspberry Pi setup
    • Getting started
      • Account & licensing
        • Activation & Licensing
        • Managing Licenses
      • User interface overview
        • Main window layout
        • Keyboard navigation
      • Support resources
  • Otii 3
    • Settings overview
    • Working with projects
      • Project storage
      • Create a new project
      • Save & open a project
      • Import an Otii 2.0 project
      • Export recordings as CSV
    • Control
      • Otii Arc/Ace setup
      • General settings
      • Channels
      • UART
      • Firmware management
      • Calibration
    • Recordings
      • Recording management
      • Recording tools
      • Recording viewers
        • Analog
        • Digital
        • Log
    • Measurements
    • Battery life estimator
    • Otii Battery Toolbox
      • Battery emulation
      • Battery profiler
        • Getting started with battery profiling
      • Battery validation
      • Battery Model Parameters
    • Otii Automation Toolbox
      • Otii TCP Server
      • Otii 3 Desktop App
      • Otii Server
      • User management
    • Additional features
      • User management
      • Show monitor
      • Notifications
    • Online account manager
  • Advanced guides
    • Python scripting
    • C# scripting
    • Jenkins integration
  • HELP & FAQ
    • FAQ
      • Otii Arc Pro
      • Otii Ace Pro
    • Revision history
  • Legal information
    • Product safety
    • Liability disclaimer
Powered by GitBook
On this page
  • Requirements
  • Hardware
  • Software
  • Setting up Raspberry Pi
  • Installing Raspberry Pi OS on the SSD Disk
  • Wiring up
  • Access Raspberry Pi using SSH
  • Installing Otii Server
  • Running Otii Server
  • Running Python script

Was this helpful?

Export as PDF
  1. Otii SETUP
  2. Installing Otii software

Raspberry Pi setup

Install Otii Server on a Raspberry Pi

PreviousUbuntu setupNextGetting started

Last updated 11 months ago

Was this helpful?

Requirements

Hardware

  • Otii hardware: or

  • Raspberry Pi 4B rev 1.2 8 GB or Raspberry Pi 5 8GB

  • USB SSD disk

  • External DC power supply

  • Device under test (DUT)

  • Jumper wires

  • Otii server will run on a Raspberry Pi 4/5 with less than 8 GB RAM, but it is not recommended.

  • Running the system on an SD card will degrade performance, and the memory card will likely quickly wear out. Use the USB SSD disk instead, as recommended.

Software

  • Otii Automation Toolbox License

  • Raspberry Pi OS (64-bit)

Otii 3 Server is a 64-bit application. Therefore, the 64-bit version of the Raspberry Pi OS is a must.

Setting up Raspberry Pi

Installing Raspberry Pi OS on the SSD Disk

  1. Plug the SSD disk to the computer via USB.

  2. Click on the different options listed in the Raspberry Pi Imager, and select the following options:

    • Raspberry Pi Device: Raspberry Pi 4 or 5

    • Operating System: Raspberry Pi OS (64-bit)

    • Storage: The one assigned to the SSD disk

    Once everything is selected, it should look like below:

  3. Click the "NEXT" button.

  4. In the following window, “Use OS customization”, click on “EDIT SETTINGS”.

    1. In the GENERAL tab, define the hostname, username, password, SSID, and password of the network you intend to connect to, the country of the Wireless LAN, and local settings such as time zone and keyboard layout.

    2. In the SERVICE tab, toggle the "Enable SSH" option to enable it, and click on "Use password authentication".

    3. Click the "SAVE" button to save the changes made.

    4. Once it takes you to the previous window, click on the “YES” option to apply the custom settings to the OS.

  5. As a final warning, a warning window will pop up to confirm if you are sure to continue, as it will overwrite the existing data on the disk. Click “YES", then the system will ask for the computer password to proceed – the system will take a few minutes to download the OS and write it into the SSD disk.

  6. Once completed, a message will be displayed indicating that the disk can now be removed from the reader. Now, it is time to connect it to the Raspberry Pi, turn it on, wait a couple of seconds, and access it via SSH.

Wiring up

  1. Take the Raspberry Pi, without powering it up, connect the SSD Disk to the bottom USB 3 port of the Raspberry Pi.

  2. With the USB cable provided in the Otii hardware box, plug the USB output into the Otii hardware box and the USB type A output into the top USB 3 port of the Raspberry Pi.

  3. Lastly, power the Raspberry Pi through the USB C power supply port, ensuring that it is powered with the optimal parameters: 5V and a current capacity of at least 3A (5A for Raspberry Pi 5).

Once the entire system is connected, it should look like the following:

Access Raspberry Pi using SSH

  1. If you do not have it installed, download, install, and open the SSH client of your preference.

  2. In the connection configuration, assign:

    1. Port: 22.

    2. Connection type: SSH

    Based on the SSH client used, proceed with the following steps to establish the connection.

  3. Once connected, the username and password previously assigned must be entered, in my case, pi.qoitech as the username.

Once accessed, observe you are now interacting from the Raspberry Pi.

Installing Otii Server

The Otii server will enable the automated test setup for the Otii Product suite tools through scripting, supporting popular languages like Python and Java.

  1. Select the Raspberry Pi version.

  2. Once downloaded, the .deb file must be transferred to the Raspberry Pi. This can be done in two ways:

    • If you have access to the Raspberry Pi interface, you can surf in the browser and then repeat the previously mentioned steps to download the file directly on the Raspberry Pi.

    • Copy the file using scp, a command that manages the copy of files or directories between a local and remote system or between two remote systems. In this case, the local system would be the computer, and the remote system would be the Raspberry Pi. Note that this option will be explained below.

  3. To copy files from the computer to the Raspberry Pi, run the following command on the computer's terminal and assign the required information:

    scp <Path to File Copy> <username>@<IP Address of Raspberry Pi>:<Path that File will go>

    Once the information has been assigned, it should look like:

    scp Downloads/otii_server_3.4.3_arm64.deb pi.qoitech@192.168.1.64:/home/pi.qoitech/Downloads
  4. In remote access to the Raspberry Pi, we go to the directory where we copied/downloaded our .deb package.

    cd Downloads
  5. Then, execute the installation with:

    sudo dpkg -i otii_server_3.x.x_arm64.deb

Once installed, a scalable, low-power, functional testing of IoT and embedded systems can now be easily started.

Running Otii Server

For the purpose of the example below, two SSH connections must be established to run and interact with the Otii server: one to run the Otii server and another for user management and scripting. However, note that the Otii server can be activated directly from the scripting if required.

  1. On one of the connections, run the following command to run the Otii Server. The connection should stay established in the background:

    otii_server 
  2. On other connection, run the following command to enable the user management capability within the command line interface (CLI):

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    pip install otii_tcp_client

Running Python script

For a practical use case, let's run a Python example that shows how to log in, list licenses, reserve and return a license, and log out.

  1. On the Raspberry Pi, create a Python file. You can use the nano command, assign the name and type of the file:

    nano user_management.py
  2. Copy and paste in the code below:

    user_management.py
    import json
    import os
    import time
    from otii_tcp_client import otii_connection, otii as otii_application
    
    # The default hostname and port of the Otii 3 application
    HOSTNAME = '127.0.0.1'
    PORT = 1905
    
    CREDENTIALS = './credentials.json'
    
    ABBREVATIONS = {
        "Automation": "AT",
        "Battery": "BT",
        "BatteryValidation": "BVT",
    }
    
    def list_and_reserve_licenses():
        '''
        This example shows you how to login,
        list licenses, reserve and return a license,
        and how to logout.
        '''
        if not os.path.isfile(CREDENTIALS):
            raise Exception('You need to create a credentials.json file')
    
        # Connect to the Otii 3 application
        connection = otii_connection.OtiiConnection(HOSTNAME, PORT)
        connect_response = connection.connect_to_server(try_for_seconds=10)
        if connect_response['type'] == 'error':
            raise Exception(f'Exit! Error code: {connect_response["errorcode"]}, '
                            f'Description: {connect_response["payload"]["message"]}')
        otii = otii_application.Otii(connection)
    
        # Read the credentials
        with open(CREDENTIALS, encoding='utf-8') as file:
            credentials = json.load(file)
    
        # Login to the Otii license server
        otii.login(credentials['username'], credentials['password'])
    
        # List all available licenses
        otii_licenses = otii.get_licenses()
        print('  Id Type         Available Reserved to     Hostname')
        for otii_license in otii_licenses:
            available = "Yes" if otii_license["available"] else "No "
            print(f'{otii_license["id"]:4d} {otii_license["type"]:12} {available}       '
                  f'{otii_license["reserved_to"]:15} {otii_license["hostname"]}')
            for addon in otii_license['addons']:
                print(f'     - {addon["id"]}')
    
        # Reserve a license that includes access to Automation Toolbox
        otii.reserve_license(credentials['license_id'])
    
        # Do your stuff
        time.sleep(3)
    
        # Return the license and logout
        otii.return_license(credentials['license_id'])
        otii.logout()
    
    if __name__ == '__main__':
        list_and_reserve_licenses()
  3. Create a file within the same folder as the script above with the name credentials.json

  4. Copy the JSON file below, assign the username and password of your Qoitech User Management account, as well as the Automation Toolbox license ID, which can be easily found in the UM either from the Otii 3 Desktop App or the web. Then, save it.

    {
            "username": "YOUR USERNAME",
            "password": "YOUR PASSWORD",
            "license_id": "YOUR LICENSE ID"
    }
  5. Run the user_management.py script, by running the following command:

    python user_management.py

    Upon running the code, the following logs will be shown:

      Id Type         Available Reserved to     Hostname
    4389 Pro          Yes                       None
    4723 All          Yes       {your_username}  raspberrypi
    Progress on otii_reserve_license is {}
    Progress on otii_return_license is {}

Remember you must have the Otii 3 Desktop App closed, no session logged in, and no license reserved to run the script above successfully.

Download, install, and run .

To wire up the system, all the must be on hand.

Supply power to the Otii hardware with an external DC power supply, fulfilling the essential requirements for proper operation. . After powering up, the LED on the front of the Otii hardware must be turned on.

You must also connect the desired DUT to be analyzed and optimized, which must be , allowing to debug the incoming messages, to automate processes based on these received messages.

Once the Raspberry Pi has been properly powered up, you can access it via SSH. To do so, use SSH clients such as or .

Hostname: assigned in the Raspberry Pi Imager (in my case raspberry.local), or you could also assign the IP address allocated to the Raspberry Pi; to find out the IP address, use tools to scan the network you are connected to to identify the different devices connected, as .

Visit the portal, and access your account. In case of not having one already, create it by simply clicking on "" – once created, the account must be verified with the associated email address to activate it.

Within the User Management portal, navigate to the page.

To download it, the must be accepted by clicking the check box.

Now, you can either operate User Management (UM) , or . See the documentation for full details.

The next step is to fully explore the and create custom Python scripts to automate the tests required throughout your hardware development cycles. Refer to to explore TCP clients for or , which contain ready-to-use examples.

Otii Arc Pro
Otii Ace Pro
Raspberry Pi Imager
Read in more detail here
set up under the UART configuration
Putty
Termius
Fing
Qoitech User Management
Create an account
Download
EULA terms
Otii TCP Client's functionalities
Qoitech's Github
Python
Java
hardware requirements mentioned above
Automation Toolbox
using Python
by scripting
Raspberry Pi 4 Imager Setup
Otii Ace Pro + Raspberry Pi 4 + SSD Disk
Raspberry Pi 4 | SSH access using Termius