jetpwmon 0.1.0

Rust bindings for Jetson Power Monitor
docs.rs failed to build jetpwmon-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: jetpwmon-0.1.2

jetson-power-monitor

English | 中文

A comprehensive power monitoring library for NVIDIA Jetson devices, available in multiple programming languages.

Features

  • Real-time power consumption monitoring
  • Support for multiple programming languages (C/C++, Rust, Python)
  • Easy installation through package managers
  • Low-level access to power metrics
  • Cross-platform support for Jetson devices

Installation

Python

pip install jetpwmon

Rust

Add to your Cargo.toml:

[dependencies]
jetpwmon = "0.1.0"

C/C++

Download the pre-built .deb package from the Releases page:

sudo dpkg -i jetpwmon_0.1.0_amd64.deb

Or use CMake to find and link the library in your project:

find_package(jetpwmon REQUIRED)
target_link_libraries(your_target PRIVATE jetpwmon::jetpwmon)  # Use shared library
# or
target_link_libraries(your_target PRIVATE jetpwmon::static)    # Use static library

# For C++ bindings
target_link_libraries(your_target PRIVATE jetpwmon::jetpwmon_cpp)  # Use shared library
# or
target_link_libraries(your_target PRIVATE jetpwmon::static_cpp)    # Use static library

Usage

Python

from jetpwmon import PowerMonitor

monitor = PowerMonitor()
power = monitor.get_power_consumption()
print(f"Current power consumption: {power}W")

Rust

use jetpwmon::PowerMonitor;

fn main() {
    let monitor = PowerMonitor::new().unwrap();
    let power = monitor.get_power_consumption().unwrap();
    println!("Current power consumption: {}W", power);
}

C/C++

#include <jetpwmon.h>

int main() {
    PowerMonitor* monitor = power_monitor_new();
    double power = power_monitor_get_power_consumption(monitor);
    printf("Current power consumption: %.2fW\n", power);
    power_monitor_free(monitor);
    return 0;
}

C++

#include <jetpwmon++.hpp>

int main() {
    PowerMonitor monitor;
    double power = monitor.get_power_consumption();
    std::cout << "Current power consumption: " << power << "W" << std::endl;
    return 0;
}

API Documentation

Python

class PowerMonitor:
    def __init__(self) -> None
    def get_power_consumption(self) -> float
    def get_voltage(self) -> float
    def get_current(self) -> float

Rust

pub struct PowerMonitor {
    // ...
}

impl PowerMonitor {
    pub fn new() -> Result<Self, Error>
    pub fn get_power_consumption(&self) -> Result<f64, Error>
    pub fn get_voltage(&self) -> Result<f64, Error>
    pub fn get_current(&self) -> Result<f64, Error>
}

C/C++

PowerMonitor* power_monitor_new(void);
double power_monitor_get_power_consumption(PowerMonitor* monitor);
double power_monitor_get_voltage(PowerMonitor* monitor);
double power_monitor_get_current(PowerMonitor* monitor);
void power_monitor_free(PowerMonitor* monitor);

Building from Source

Prerequisites

  • CMake 3.10 or higher
  • C++ compiler with C++17 support
  • Python 3.7 or higher (for Python bindings)
  • Rust toolchain (for Rust bindings)

Build Steps

git clone https://github.com/yourusername/jetson-power-monitor.git
cd jetson-power-monitor
mkdir build && cd build
cmake ..
make
sudo make install

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for detailed information about:

  • Project architecture and implementation details
  • Development setup and guidelines
  • Code style and testing requirements
  • Pull request process
  • Common development tasks
  • Release process

License

This project is licensed under the BSD 3-Clause License License - see the LICENSE file for details.

Acknowledgments

  • NVIDIA Jetson team for their excellent hardware
  • All contributors who have helped with this project
  • jetson_stats

Star History

Star History Chart