Skip to main content

Python API for Lanner PSP

Project description

PyPI version License: MIT 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 .so 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 documents.

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

MIT License

Copyright (c) 2022 Lanner Electronics Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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.6.tar.gz (30.9 kB view hashes)

Uploaded Source

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