Skip to main content

Desktop controller for Wanptek DC power supplies via USB/serial (Modbus RTU)

Project description

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
  • macOSbrew install python-tk
  • Linuxsudo 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wanptek_controller-0.2.0.tar.gz (461.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wanptek_controller-0.2.0-py3-none-any.whl (471.6 kB view details)

Uploaded Python 3

File details

Details for the file wanptek_controller-0.2.0.tar.gz.

File metadata

  • Download URL: wanptek_controller-0.2.0.tar.gz
  • Upload date:
  • Size: 461.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wanptek_controller-0.2.0.tar.gz
Algorithm Hash digest
SHA256 05c88e8199d58b8d104618239acb2cc6aa570ab79492247cddb7c9a2bdab6001
MD5 34becd10a461694976ef0bbe69f0bf4a
BLAKE2b-256 196f9ebe47942462f23aa69b4198543ce5ed1dabd19663ea672f463236580f9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for wanptek_controller-0.2.0.tar.gz:

Publisher: publish.yml on flkoliv/sw-wanptek-psu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wanptek_controller-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wanptek_controller-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb678b9ea259c7d9204509166c254be6d77fe3052460d96e2ebb02050b0c2209
MD5 4b472e2675f3417131a1bf61fc775280
BLAKE2b-256 e32861080d02d6419da0deb969f02a5ef15997ad40bebbeca6605e24f3e8a95b

See more details on using hashes here.

Provenance

The following attestation bundles were made for wanptek_controller-0.2.0-py3-none-any.whl:

Publisher: publish.yml on flkoliv/sw-wanptek-psu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page