Automation with Python and C# for regression testing, validation and Continuous Integration (CI)

Automate power analysis and validation of electronics and IoT

Automating low-power measurements, battery testing, and validation in embedded and IoT device development is key to improving energy efficiency, reliability, and product lifespan. Using Python, C#, or Java to automate repetitive tasks and parameter validation is a game-changer for hardware teams. Together, the Otii Arc/Ace and Otii Automation Toolbox streamline workflows and deliver accurate, consistent power measurements across tests — helping engineers track power use, validate performance, and save time while reducing errors for faster, more efficient development.

The Otii Automation Toolbox provides access to the Otii TCP Server API and supports scripting in Python, Java, C#, and MATLAB. With this API, you can control Otii hardware and software directly from any application that supports standard TCP sockets.

The set-up is highly customizable and scalable. The basic setup includes an Otii Arc/Ace and device under test (DUT) for simplest case of low power measurements. Additional measurements like collection of the RX and digital inputs can be done on the expansion port.

Automation with Otii Arc/Ace and Otii Automation Toolbox

Products needed

Otii Arc Pro or Otii Ace Pro

Otii Automation Toolbox

Get started

The first step is to install the TCP client. TCP clients for Python, Java, C#, and MATLAB are available on Qoitech GitHub.

The TCP configuration and connection, as well as the TCP commands, are all gathered here. Otii TCP Server can be run using either the Otii desktop client or the Otii command-line interface.

Here is more information about Otii server and how you can use it.

License management

Logging in and reserving license for you setup is made easy and fast. It is possible to use the TCP-API directly in the test script for user and license management or you can access it from the command line using the Python module.

Check how in the Documentation.

If you have several licenses that you would like to share smoothly from a license pool you can set up an account that will be shared between the automation computers. You then add any number of automation licenses to this account, either by moving them from another account, or by purchasing new ones.

Read more about the license pool here.

Example scripts

Automated power measurements with Otii Arc or Otii Ace are fully customizable, making it easy to adapt to different embedded and IoT testing needs. The customization is enabled—and only limited by your imagination—when it comes to what you want to test and script. We’ve are continuously increasing our collection of use-case example scripts to help you get started. Download them here and modify them to fit your specific workflow.

Python examples

C# examples

Automation with Python

Step-by-step guide for scripting with Python

Automation with C#

Step-by-step guide for scripting with C#

Combine debugging and power measurement seamlessly

In the case of firmware and software iterations on the DUT, where a debugger is used for flashing and debugging, an additional switch board can be included to avoid manual switching between the measurements and flashing.

When performing firmware or software iterations on the device under test (DUT), where a debugger is used for flashing and debugging, an additional switch board can be used with the Otii Arc or Otii Ace. This allows seamless switching between power measurements and flashing, eliminating manual labour of switching.

Otii low-power measurement setup for CI with Jenkins using a switching board for seamless firmware flashing

Integration with CI/CD

Even small code changes can greatly affect a device’s energy profile. That’s why it’s essential to test and validate power consumption before releasing software updates. Integrating power measurements into your CI pipeline (e.g., Jenkins) makes energy performance part of quality assurance—preventing battery life surprises and ensuring reliable, efficient releases. Otii Automation Toolbox enables integration with any continuous integration and development setup.

Here is a step-by-step guide on how to integrate low-power measurement in the Jenkins CI setup using Python.

Otii low-power measurements in Ci Jenkins integration