Upload files to "/"
Signed-off-by: enderice2 <enderice2@no-reply@enderice2.com>
This commit is contained in:
parent
79e36701d3
commit
20d260052c
24
collect.sh
Normal file
24
collect.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
output_file="sensors_log.csv"
|
||||
|
||||
if [ ! -f "$output_file" ]; then
|
||||
echo "timestamp,CPU (°C),Vcore (V),VSOC (V),VDDP (mV),DRAM (V)" > "$output_file"
|
||||
fi
|
||||
|
||||
while true; do
|
||||
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
|
||||
|
||||
values=$(sensors it8686-isa-0a40 | grep -E 'CPU:|Vcore:|VSOC:|VDDP:|DRAM:')
|
||||
|
||||
CPU_temp=$(echo "$values" | grep "CPU:" | grep -oE '[+-]?[0-9]+\.[0-9]+' | head -n 1)
|
||||
Vcore=$(echo "$values" | grep "Vcore:" | grep -oE '[+-]?[0-9]+\.[0-9]+' | head -n 1)
|
||||
VSOC=$(echo "$values" | grep "VSOC:" | grep -oE '[+-]?[0-9]+\.[0-9]+' | head -n 1)
|
||||
VDDP=$(echo "$values" | grep "VDDP:" | grep -oE '[+-]?[0-9]+' | head -n 1)
|
||||
DRAM=$(echo "$values" | grep "DRAM:" | grep -oE '[+-]?[0-9]+\.[0-9]+' | head -n 1)
|
||||
|
||||
echo "$timestamp,$CPU_temp,$Vcore,$VSOC,$VDDP,$DRAM" >> "$output_file"
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
39
graph.py
Normal file
39
graph.py
Normal file
@ -0,0 +1,39 @@
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
data = pd.read_csv("sensors_log.csv")
|
||||
|
||||
data['timestamp'] = pd.to_datetime(data['timestamp'])
|
||||
|
||||
data.set_index('timestamp', inplace=True)
|
||||
|
||||
plt.style.use('dark_background')
|
||||
|
||||
columns_to_plot = {
|
||||
'CPU (°C)': 1,
|
||||
'Vcore (V)': 0.01,
|
||||
'VSOC (V)': 0.01,
|
||||
'VDDP (mV)': 5,
|
||||
'DRAM (V)': 0.01,
|
||||
}
|
||||
|
||||
for column, threshold in columns_to_plot.items():
|
||||
plt.figure(figsize=(12, 6))
|
||||
plt.plot(data.index, data[column], label=column, color='cyan', linewidth=2)
|
||||
|
||||
last_labeled_value = None
|
||||
for x, y in zip(data.index, data[column]):
|
||||
if last_labeled_value is None or abs(y - last_labeled_value) > threshold:
|
||||
plt.text(x, y, f"{y:.2f}", fontsize=9, ha='center', va='bottom', color='white')
|
||||
last_labeled_value = y
|
||||
|
||||
plt.xlabel("Timestamp", fontsize=12, color='white')
|
||||
plt.ylabel("Value", fontsize=12, color='white')
|
||||
plt.title(f"{column} Over Time", fontsize=14, color='white')
|
||||
plt.legend(loc='upper left')
|
||||
plt.grid(visible=True, color='gray', linestyle='--', alpha=0.7)
|
||||
plt.tight_layout()
|
||||
|
||||
plt.savefig(f"{column}_graph_no_points_dark.png", dpi=300)
|
||||
plt.show()
|
Loading…
x
Reference in New Issue
Block a user