sensor-ina260

CLI reference

glasgow run sensor-ina260

Measure voltage, current and power with TI INA260 sensors.

Only readout is supported. Configuration cannot be changed, and alerts cannot be enabled.

usage: glasgow run sensor-ina260 [-h] [-V SPEC] [--scl PIN] [--sda PIN]
                                 [--i2c-address ADDR]
                                 OPERATION ...
-h, --help

show this help message and exit

-V <spec>, --voltage <spec>

configure I/O port voltage to SPEC (e.g.: '3.3', 'A=5.0,B=3.3', 'A=SA')

--scl <pin>

bind the applet I/O line 'scl' to PIN (default: 'A0', required)

--sda <pin>

bind the applet I/O line 'sda' to PIN (default: 'A1', required)

--i2c-address <addr>

I2C address of the sensor (0x40 to 0x4F, default: 0x40)

glasgow run sensor-ina260 log

usage: glasgow run sensor-ina260 log [-h] -i TIME DATA-LOGGER ...
-h, --help

show this help message and exit

-i <time>, --interval <time>

sample each TIME seconds

glasgow run sensor-ina260 log csv

Log data to a comma-separated value (CSV) file.

usage: glasgow run sensor-ina260 log csv [-h] [--dialect DIALECT] CSV-FILE
csv-file

write data to CSV-FILE

-h, --help

show this help message and exit

--dialect {excel,excel-tab,unix}

format CSV file according to DIALECT

glasgow run sensor-ina260 log influxdb

Log data to an InfluxDB 1.x endpoint over HTTP(S).

usage: glasgow run sensor-ina260 log influxdb [-h] [-r POLICY] [-t TAG=VALUE]
                                              -p PRECISION
                                              [--batch-size BATCH-SIZE]
                                              ENDPOINT DATABASE SERIES
endpoint

write to endpoint URL //ENDPOINT/write

database

write to database DATABASE

series

write to measurement SERIES

-h, --help

show this help message and exit

-r <policy>, --retention-policy <policy>

write to retention policy POLICY

-t <tag=value>, --tag <tag=value>

attach TAG=VALUE to all data points

-p {ns,us,ms,s,m,h}, --precision {ns,us,ms,s,m,h}

set timestamp precision to PRECISION

--batch-size <batch-size>

submit data in groups of BATCH-SIZE points

glasgow run sensor-ina260 log influxdb2

Log data to an InfluxDB 2.x endpoint over HTTP(S).

usage: glasgow run sensor-ina260 log influxdb2 [-h] [-t TAG=VALUE]
                                               -p PRECISION
                                               [--batch-size BATCH-SIZE]
                                               --token TOKEN
                                               ENDPOINT ORGANIZATION BUCKET
                                               SERIES
endpoint

write to endpoint URL //ENDPOINT/api/v2/write

organization

write to Organization ORGANIZATION (can be either the name or the id)

bucket

write to bucket BUCKET

series

write to measurement SERIES

-h, --help

show this help message and exit

-t <tag=value>, --tag <tag=value>

attach TAG=VALUE to all data points

-p {ns,us,ms,s,m,h}, --precision {ns,us,ms,s,m,h}

set timestamp precision to PRECISION

--batch-size <batch-size>

submit data in groups of BATCH-SIZE points

--token <token>

set the Token to use for Authentication

glasgow run sensor-ina260 log stdout

Log data to standard output in a human-readable format.

usage: glasgow run sensor-ina260 log stdout [-h]
-h, --help

show this help message and exit

glasgow run sensor-ina260 measure

usage: glasgow run sensor-ina260 measure [-h]
-h, --help

show this help message and exit

API reference

exception glasgow.applet.sensor.ina260.INA260Error
class glasgow.applet.sensor.ina260.INA260Interface(logger: Logger, i2c_iface: I2CControllerInterface, i2c_address: int = 0x40)