Skip to main content

Python API for Lanner PSP

Project description

PyPI version License: MIT Total downloads Python version

A Python interface to access Lanner PSP.

About

Lanner PSP aims to simplify and enhance the efficiency of customer’s application implementation. When developers intend to write an application that involves hardware access, they were required to fully understand the specifications to utilize the drivers. This is often being considered a time- consuming job which requires lots of related knowledge and time. In order to achieve better full access hardware functionality, Lanner invests great effort to ease customer’s development journey with the release of a suite of reliable Software APIs.

“Python API for Lanner PSP” uses Python to call the shared object file generated after PSP compilation to execute PSP functions, and encapsulates many C functions in PSP into Python interfaces, so please make sure to install Core SDK before use.

If your Core SDK was installed via the One-Step Automated Install method, you can use it out of the box, otherwise you should set the liblmbio.so and liblmbapi.so paths before instantiating other objects. For example:

from lannerpsp import PSP, HWM

PSP.lmb_io_path = "/path/to/liblmbio.so"
PSP.lmb_api_path = "/path/to/liblmbapi.so"

hwm = HWM()

hwm.get_cpu_temp(1)
...

Assuming you want to obtain the sensors data for the hardware monitor:

from lannerpsp import HWM

hwm = HWM()

sensors = hwm.list_supported_sensors()
for s in sensors:
    print(f"{s.display_name} = {s.value} {s.unit}")

Then run it with ROOT privileges, the output will be like:

CPU 1 temperature = 41 C
SYS 1 temperature = 42 C
CPU 1 Vcore = 0.856 V
5V = 5.087 V
3.3V = 3.35 V
Battery = 3.184 V
DDR channel 1 = 1.104 V

For complete usage, please refer to the documentation.

Concurrency and Parallelism

Lanner PSP invokes many underlying hardware interfaces for communication, such as IPMI, SMBus, Super I/O, or some MCUs. Some PSP functions may occupy the same communication channel, such as UART or I2C, etc. Please avoid using multi-process or multi-threading unless you can ensure they will not cause errors due to simultaneous access to the same channel.

Installation

To use the “Python API for Lanner PSP”, you must have ROOT privileges and the Core SDK must be installed first. To install “Python API for Lanner PSP”, see the Installation chapter.

Documentation

Comprehensive documentation is available at https://psp-api-python.readthedocs.io/.

Issues and questions

If you have a feature request or bug report, please open an issue on GitHub. If you have a question or need help, this may be better suited to Lanner’s official online customer service.

Python support

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

lannerpsp-0.0.13.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

lannerpsp-0.0.13-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file lannerpsp-0.0.13.tar.gz.

File metadata

  • Download URL: lannerpsp-0.0.13.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for lannerpsp-0.0.13.tar.gz
Algorithm Hash digest
SHA256 1f4501105d1d2b242e61088abb68ea7b6bdf6555cffb4e96bd9b9a11faf8a36b
MD5 acf5c267312286c4d9049129865843e7
BLAKE2b-256 8f276c4c2ed159c8ee107251946fabf2433f119e138932c32a8dbb933bf34514

See more details on using hashes here.

File details

Details for the file lannerpsp-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: lannerpsp-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for lannerpsp-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 73d156185dfab688259ddce0d0f1f50e7fe2e220a5584fe601dd4c24797b48d7
MD5 fa4c6923d3a046a1b9b0637b8e90fa71
BLAKE2b-256 af231d04e68145febe31da23b7824a4e42d45eba2d3936dc65463aa1a9d8a5e9

See more details on using hashes here.

Supported by

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