Skip to content
USB Power Meter linux command
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images
README.md
setup.py
usbmeter

README.md

usbmeter

Extracts and graphs data from UM25C etc. USB power meters in Linux.

Based on the excellent reverse engineering found here - https://sigrok.org/wiki/RDTech_UM24C.

graph

Install on arch

sudo pacman -S bluez
sudo pacman -S bluez-utils 
sudo pacman -S python-pybluez
pip3 install . --user

Run on arch

Start the bluetooth service:

sudo systemctl start bluetooth
echo "power on" | bluetoothctl

It is then recommended to do the following, to view a live graph of voltage, current and power:

usbmeter --addr <ADDRESS> --graph

You can also run without the --addr parameter, for the device to be detected automatically, however some people have told me that this gives 'No services found for address ....' for them.

Save data

To save the power data to a file:

usbmeter --addr <ADDRESS> --graph --out out.dat

To process this pickled data, you can do:

#!/usr/bin/python3
import pickle
objects = []

with open('out.dat', 'rb') as f:
    while True:
        try:
            objects.append(pickle.load(f))
        except EOFError:
            break

for x in objects:
    print("%s,%f,%f" % (x['time'],x['Volts'],x['Amps']))

Licence

MIT

You can’t perform that action at this time.