Host library installation guide
After installing the physical device and firmware (see this guide), use this guide to install the host library. When finished, get to know the device with the user guide.
Installation
The PowerSensor host library can be built with cmake. Make sure you have a C++ compiler installed and run the following commands in the host
directory to build and install to the default location (typically /usr/local/
):
cmake -S . -B build
make
make install
To install to a different location, use the -DCMAKE_INSTALL_PREFIX
option of cmake.
Python bindings
Python bindings were created with Pybind11. To use these, make sure you have a recent version of Python3 and install Pybind11, typically with
pip install pybind11
To compile the PowerSensor Python bindings, add -DPYTHON_BINDINGS=ON
to the cmake command. You may need to point cmake to the Pybind11 directory with -Dpybind11_DIR=$(pybind11-config --cmakedir)
. This generates a shared library under build/python
, which you can copy to any folder where Python can find it, or you can add the folder with the library to PYTHONPATH
.
Next steps
To test your installation and get familiar with using PowerSensor have a look at the user guide.