Skip to content

Commit

Permalink
RockChip CPU temp reporting #327
Browse files Browse the repository at this point in the history
Added a case to psUtilGetStats() for CPU temperature monitoring on the RockPi platform
  • Loading branch information
gpread committed Jan 21, 2022
1 parent 8978bf3 commit 5b27cb1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions octoprint_dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def psUtilGetStats(self):
cpu_val = tempFile.read()
tempFile.close()
self.cpu_temp = int(round(float(cpu_val)/1000))
elif "cpu" in thermal: # RockPi (probably all RockChip CPUs/SOCs)
self.cpu_temp = int(round((thermal["cpu"][0][1])))
self.cpu_percent = str(psutil.cpu_percent(interval=None, percpu=False))
self.cpu_freq = str(int(round(psutil.cpu_freq(percpu=False).current, 0)))
self.virtual_memory_percent = str(psutil.virtual_memory().percent)
Expand Down

0 comments on commit 5b27cb1

Please sign in to comment.