Compare commits
5 Commits
v1.1.1
...
797876eeac
| Author | SHA1 | Date | |
|---|---|---|---|
| 797876eeac | |||
| f73c2668e3 | |||
| 55b5296d16 | |||
| a8faa6a441 | |||
| c7188df159 |
@@ -1,6 +1,6 @@
|
||||
# Odroid PowerMate Logger and Plotter
|
||||
|
||||
This directory contains two Python scripts to log power data from an Odroid PowerMate device and visualize it.
|
||||
This directory contains two Python scripts to log power data from an Odroid Smart Power device and visualize it.
|
||||
|
||||
1. `logger.py`: Connects to the device's web server, authenticates, and logs real-time power data from its WebSocket to a CSV file.
|
||||
2. `csv_2_plot.py`: Reads the generated CSV file and creates a plot image of the power, voltage, and current data over time.
|
||||
@@ -42,7 +42,7 @@ Ensure you have Python 3 installed.
|
||||
With the virtual environment activated, install the necessary Python packages:
|
||||
|
||||
```bash
|
||||
pip3 install requests websockets protobuf pandas matplotlib python-dateutil
|
||||
pip33 install requests websockets protobuf pandas matplotlib python-dateutil
|
||||
```
|
||||
|
||||
### 4. Protobuf Generated File
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import argparse
|
||||
|
||||
import matplotlib.dates as mdates
|
||||
import matplotlib.pyplot as plt
|
||||
import pandas as pd
|
||||
|
||||
@@ -113,9 +113,9 @@ class OdroidPowerLogger:
|
||||
ts_iso_csv = ts_dt.isoformat(timespec='milliseconds').replace('+00:00', 'Z')
|
||||
row = [
|
||||
ts_iso_csv, sensor_data.uptime_ms,
|
||||
f"{sensor_data.vin.voltage:.3f}", f"{sensor_data.vin.current:.3f}", f"{sensor_data.vin.power:.3f}",
|
||||
f"{sensor_data.main.voltage:.3f}", f"{sensor_data.main.current:.3f}", f"{sensor_data.main.power:.3f}",
|
||||
f"{sensor_data.usb.voltage:.3f}", f"{sensor_data.usb.current:.3f}", f"{sensor_data.usb.power:.3f}"
|
||||
sensor_data.vin.voltage, sensor_data.vin.current, sensor_data.vin.power,
|
||||
sensor_data.main.voltage, sensor_data.main.current, sensor_data.main.power,
|
||||
sensor_data.usb.voltage, sensor_data.usb.current, sensor_data.usb.power
|
||||
]
|
||||
csv_writer.writerow(row)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user