Skip to main content

Wanptek PSU Controller

PyPI version Python versions Publish to PyPI License: MIT

Desktop application to control a Wanptek DC power supply via USB / serial port. Compatible with Windows, macOS and Linux.

Features:

  • Display voltage, current and power in real time
  • Adjust voltage and current setpoints
  • Enable or disable the output
  • Enable or disable OCP (over-current protection)
  • Plot measurement history in a live graph window
  • Alarm sound on over-current trip (optional)

Interface

The application uses a customtkinter interface with:

  • An LCD-style main display
  • Two adjustment knobs
  • A button bar for Menu, Graph, Lock, OCP and Output control

The window is fixed at 280 × 310 pixels.

Requirements

  • Python 3.10 or later with tkinter available (tested up to Python 3.14)
  • A compatible Wanptek DC power supply
  • A USB-to-serial adapter recognised by your OS

Installation

Recommended — via pipx (all platforms)

pipx installs the application in an isolated environment automatically, with no need to manage a virtual environment manually.

Install pipx first:

# Windows
winget install pipx

# macOS
brew install pipx

# Debian / Ubuntu
sudo apt install pipx

# Fedora
sudo dnf install pipx

Then install and run the application:

pipx install wanptek-controller
wanptek-controller

Update:

pipx upgrade wanptek-controller

Alternative — via pip with a virtual environment

If you prefer pip, use a virtual environment to avoid conflicts with system packages:

python -m venv ~/.venv/wanptek
source ~/.venv/wanptek/bin/activate   # macOS / Linux
.\.venv\Scripts\Activate.ps1          # Windows (PowerShell)
pip install wanptek-controller
wanptek-controller

To launch the application later:

source ~/.venv/wanptek/bin/activate && wanptek-controller   # macOS / Linux

Or add an alias to your shell profile (~/.bashrc, ~/.zshrc):

alias wanptek='source ~/.venv/wanptek/bin/activate && wanptek-controller'

From source

Clone the repository and install in a virtual environment:

git clone https://github.com/flkoliv/sw-wanptek-psu.git
cd sw-wanptek-psu
python -m venv .venv
source .venv/bin/activate      # macOS / Linux
.\.venv\Scripts\Activate.ps1  # Windows (PowerShell)
pip install -e .
wanptek-controller

Optional — alarm sound

An alarm sound plays when over-current protection trips. This requires pygame, which is not installed by default.

To enable it:

# pipx
pipx install "wanptek-controller[sound]"

# pip
pip install "wanptek-controller[sound]"

Platform notes

Windows

  • Install Python 3.10 or later from the official installer and make sure tcl/tk and IDLE is checked
  • If PowerShell blocks script execution: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  • Serial ports appear as COM3, COM4, ...

macOS

  • Install Python and tkinter via Homebrew:
    brew install python-tk
    
  • Serial ports appear as /dev/cu.usbserial-XXXX or /dev/cu.SLAB_USBtoUART

Linux

  • Install Python and tkinter:
    # Debian / Ubuntu
    sudo apt install python3 python3-venv python3-tk pipx
    
    # Fedora
    sudo dnf install python3 python3-tkinter pipx
    
  • Add your user to the dialout group to access the serial port:
    sudo usermod -aG dialout $USER
    
    Reboot or log out and back in for the change to take effect.
  • Serial ports appear as /dev/ttyUSB0, /dev/ttyACM0, ...

First-time setup

On first launch:

  1. Click Menu
  2. Select the serial port connected to your power supply
  3. Select the Modbus device address
  4. Select the baud rate (default: 2400)
  5. Click Save

The application will then attempt to connect automatically. The status is shown next to the LED indicator (bottom of the knob panel).

Settings are saved to ~/.wanptek_controller/param.


Usage

Main display

Shows:

  • Output voltage
  • Output current
  • Output power
  • OCP status
  • Output status

Buttons

  • Menu — open the serial configuration dialog
  • Graph — open the measurement history window
  • Lock — enable or disable software control of the setpoints
  • OCP — toggle over-current protection
  • OUT — enable or disable the PSU output

Voltage / current adjustment

When Lock is active:

  • The knobs become interactive
  • New values are sent to the power supply

When Lock is inactive:

  • The knobs display the current setpoints read-only

Graph

The Graph window shows the last 10 minutes of:

  • Voltage
  • Current
  • Power

Project structure

wanptek_controller/
├── __init__.py      — version metadata
├── __main__.py      — module entry point
├── main.py          — application entry point
├── PSUModel.py      — state and persisted settings
├── PSUController.py — Modbus communication and control logic
├── PSUView.py       — graphical interface
├── images/          — icons and logo
└── ressources/      — fonts and sounds
main.py              — development shim (calls wanptek_controller.main)
run.pyw              — GUI launcher (no console window on Windows)

Troubleshooting

ModuleNotFoundError: No module named 'tkinter'

Your Python installation does not include Tk.

  • Windows — reinstall Python with tcl/tk and IDLE checked
  • macOS — brew install python-tk
  • Linux — sudo apt install python3-tk (or sudo dnf install python3-tkinter)

PowerShell blocks Activate.ps1 (Windows)

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\.venv\Scripts\Activate.ps1

Serial port permission denied (Linux)

sudo usermod -aG dialout $USER

Reboot or log out and back in for the change to take effect.

Application does not connect

  • Check that the correct serial port is selected in Menu
  • The connection status is shown next to the LED — read the message for details
  • Default baud rate is 2400 — adjust in Menu if your device uses a different rate
  • Make sure the power supply is switched on
  • Check the USB-to-serial cable and driver (CH340, CP210x, FTDI...)

Graph window does not open

The graph only opens once at least one measurement has been received.


License

See LICENSE.

Metadata

Release files for wanptek-controller 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wanptek-controller 0.2.0
File Size Uploaded
wanptek_controller-0.2.0.tar.gz 461.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wanptek-controller 0.2.0
File Interpreter ABI Platform
wanptek_controller-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 933.5 kB

Release files / wanptek_controller-0.2.0.tar.gz

Download URL wanptek_controller-0.2.0.tar.gz
Size 461.9 kB
Tags Source
SHA-256 checksum
How to use checksums
05c88e8199d58b8d104618239acb2cc6aa570ab79492247cddb7c9a2bdab6001
BLAKE2b-256 checksum
How to use checksums
196f9ebe47942462f23aa69b4198543ce5ed1dabd19663ea672f463236580f9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 4, 2026.

Transparency log

Release files / wanptek_controller-0.2.0-py3-none-any.whl

Download URL wanptek_controller-0.2.0-py3-none-any.whl
Size 471.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb678b9ea259c7d9204509166c254be6d77fe3052460d96e2ebb02050b0c2209
BLAKE2b-256 checksum
How to use checksums
e32861080d02d6419da0deb969f02a5ef15997ad40bebbeca6605e24f3e8a95b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page