Skip to main content

Python client for the FNIRSI DPS-150 power supply over USB serial

Project description

FNIRSI DPS-150

Small synchronous Python library for controlling an FNIRSI DPS-150 over USB serial.

Credit

This project’s packet layout, command IDs, and initial protocol assumptions were derived from the reverse-engineering work published by cho45 in cho45/fnirsi-dps-150. This library reimplements that protocol in Python and validates behavior against a real connected DPS-150 device.

Setup

python -m pip install fnirsi-dps150

Development Setup

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install ".[dev]"

Usage

from fnirsi_dps150 import DPS150

with DPS150("/dev/cu.usbmodem146061B040251") as dps:
    dps.set_voltage(5.0)
    dps.set_current(1.0)
    print(dps.read_voltage())
    print(dps.read_current())
    print(dps.read_state())

CLI

source .venv/bin/activate
fnirsi-dps150 --port /dev/cu.usbmodem146061B040251 read-state
fnirsi-dps150 --port /dev/cu.usbmodem146061B040251 read-voltage
fnirsi-dps150 --port /dev/cu.usbmodem146061B040251 read-current
fnirsi-dps150 --port /dev/cu.usbmodem146061B040251 set-voltage 5.0
fnirsi-dps150 --port /dev/cu.usbmodem146061B040251 set-current 0.5
fnirsi-dps150 --port /dev/cu.usbmodem146061B040251 output-on
fnirsi-dps150 --port /dev/cu.usbmodem146061B040251 output-off

Hardware Validation

Run the real-device script:

source .venv/bin/activate
python scripts/validate_device.py

License

MIT. See LICENSE.

Publishing

Build artifacts for manual upload:

python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*

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

fnirsi_dps150-1.0.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

fnirsi_dps150-1.0.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file fnirsi_dps150-1.0.0.tar.gz.

File metadata

  • Download URL: fnirsi_dps150-1.0.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fnirsi_dps150-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9cf84b325373437115fbd86d414225d3ef5eff2924352ab0ae32eb8360a01ce3
MD5 13f8b844d08ee65dee8fe4681f3b12dd
BLAKE2b-256 3206e91b5dd85d3c49de5d1fb4d91efaee875c982ab6baa6612f8be67bcd287c

See more details on using hashes here.

File details

Details for the file fnirsi_dps150-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fnirsi_dps150-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fnirsi_dps150-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bb4e2dea32a8afb38af717b8160d91d5eabb893961022636f1d5dc07b6912ff
MD5 00e03ca5c98eeb592919c8793624173b
BLAKE2b-256 7a9d9fe0a8102f8f72433aa93f86af83d1a89e4d02b005bc29a7463950ef0d87

See more details on using hashes here.

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