5 Commits

Author SHA1 Message Date
6a5ec86505 update logger README to include detailed usage instructions and examples
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
2025-12-10 10:01:26 +09:00
e20f4b9f74 csv_2_plot: update title margin
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
2025-12-10 10:01:26 +09:00
56e1f619e1 csv_2_plot: update y-axis gridline colors
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
2025-12-10 10:01:26 +09:00
8930a36eaf csv_2_plot: improve plot configuration and add average voltage/interval calculations
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
2025-12-10 10:01:26 +09:00
194474fdff logger: save time on UTC
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
2025-12-10 10:00:27 +09:00
3 changed files with 5 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
# Odroid PowerMate Logger and Plotter
This directory contains two Python scripts to log power data from an Odroid Smart Power device and visualize it.
This directory contains two Python scripts to log power data from an Odroid PowerMate 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
pip33 install requests websockets protobuf pandas matplotlib python-dateutil
pip3 install requests websockets protobuf pandas matplotlib python-dateutil
```
### 4. Protobuf Generated File

View File

@@ -1,5 +1,4 @@
import argparse
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import pandas as pd

View File

@@ -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,
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
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}"
]
csv_writer.writerow(row)