Last active
March 7, 2020 17:02
-
-
Save artivis/7726f2a73773c1a436a83609d4dbdf46 to your computer and use it in GitHub Desktop.
cockpit-temperature-plugin small fix for RaspberryPi + Ubuntu Server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 7e69b28973c4cf5d7580dd3dad9fda8de245f1a7 Mon Sep 17 00:00:00 2001 | |
From: artivis <[email protected]> | |
Date: Sat, 7 Mar 2020 11:53:21 -0500 | |
Subject: [PATCH] fix for raspi+ubuntu18.04 | |
--- | |
temperature.js | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
diff --git a/temperature.js b/temperature.js | |
index c7dbeba..6bc192a 100644 | |
--- a/temperature.js | |
+++ b/temperature.js | |
@@ -10,9 +10,9 @@ window.onload = function () { | |
chart.streamTo(canvas, 500); | |
function run_proc(series,average_array) { | |
- var proc = cockpit.spawn(["vcgencmd","measure_temp"]); | |
+ var proc = cockpit.script("cat /sys/class/thermal/thermal_zone*/temp"); | |
proc.done(function(data){ | |
- pt = parseFloat(data.match(/([0-9\.]+)/)[1]); | |
+ pt = parseFloat(data.match(/([0-9\.]+)/)[1])/1000; | |
series.append(new Date().getTime(), pt); | |
document.getElementById("cur_temp").innerHTML = pt; | |
average_array.push(pt); | |
-- | |
2.17.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment