Add support for Argon40 EON
The argon40 EON is a RPI4 with case fan, and 4 drives.
This commit is contained in:
@@ -298,10 +298,16 @@ class MonitorWindow(QMainWindow):
|
||||
y_min=20, y_max=80,
|
||||
window=window
|
||||
)
|
||||
|
||||
casefan = self.config.getValue( "cooling", "casefan", None )
|
||||
if casefan is None:
|
||||
series = [("RPM",None)]
|
||||
else:
|
||||
series = [("CPU", None),("CaseFan",None)]
|
||||
|
||||
self.fan_chart = RollingChart(
|
||||
title="Fan Speed",
|
||||
series_defs=[("RPM",None)],
|
||||
series_defs=series,
|
||||
y_min=0,y_max=6000,
|
||||
window=window
|
||||
)
|
||||
@@ -342,9 +348,12 @@ class MonitorWindow(QMainWindow):
|
||||
'''
|
||||
|
||||
# Obtain the current fan speed
|
||||
try:
|
||||
fan_speed = self.cpuinfo.CPUFanSpeed
|
||||
except Exception:
|
||||
if self.cpuinfo.model == 5:
|
||||
try:
|
||||
fan_speed = self.cpuinfo.CPUFanSpeed
|
||||
except Exception:
|
||||
fan_speed = None
|
||||
else:
|
||||
fan_speed = None
|
||||
|
||||
# Setup the temperature for the CPU and Drives
|
||||
@@ -353,7 +362,7 @@ class MonitorWindow(QMainWindow):
|
||||
temperatures.append( float(self.cpuinfo.temperature) )
|
||||
except Exception:
|
||||
temperatures.append( 0.0 )
|
||||
|
||||
|
||||
# Obtain the drive temperatures
|
||||
try:
|
||||
for _drive in self.multiDrive.drives:
|
||||
|
||||
@@ -229,6 +229,22 @@ class CPUInfo:
|
||||
def __init__( self ):
|
||||
self._cputemp = CPUTemperature()
|
||||
|
||||
def _cpuModel( self ) -> int:
|
||||
with os.popen( "grep Model /proc/cpuinfo" ) as command:
|
||||
data = command.read()
|
||||
if "Compute Module 5" in data:
|
||||
return 5
|
||||
elif "Raspberry Pi 4" in data:
|
||||
return 4
|
||||
elif "Raspberry Pi 5" in data:
|
||||
return 5
|
||||
else:
|
||||
return 0
|
||||
|
||||
@property
|
||||
def model( self ) -> int:
|
||||
return self._cpuModel()
|
||||
|
||||
@property
|
||||
def temperature( self ) -> float:
|
||||
'''
|
||||
@@ -249,15 +265,17 @@ class CPUInfo:
|
||||
Return:
|
||||
The fanspeed as a floating point number
|
||||
'''
|
||||
speed= 0
|
||||
try:
|
||||
command = os.popen( 'cat /sys/devices/platform/cooling_fan/hwmon/*/fan1_input' )
|
||||
speed = int( command.read().strip())
|
||||
except Exception as error:
|
||||
print( f"Could not determine fan speed, error {error}" )
|
||||
finally:
|
||||
command.close()
|
||||
|
||||
speed = 0
|
||||
if self._cpuModel() == 5:
|
||||
try:
|
||||
command = os.popen( 'cat /sys/devices/platform/cooling_fan/hwmon/*/fan1_input' )
|
||||
speed = int( command.read().strip())
|
||||
except Exception as error:
|
||||
print( f"Could not determine fan speed, error {error}" )
|
||||
finally:
|
||||
command.close()
|
||||
else:
|
||||
speed = 0
|
||||
return float(speed)
|
||||
|
||||
class CPULoad:
|
||||
@@ -378,7 +396,8 @@ if __name__ == "__main__":
|
||||
|
||||
cpuinfo = CPUInfo()
|
||||
print( f"CPU Temperature = {cpuinfo.temperature}" )
|
||||
print( f"CPU Fan Speed = {cpuinfo.CPUFanSpeed}" )
|
||||
print( f"CPU Fan Speed = {cpuinfo.CPUFanSpeed}" )
|
||||
print( f"CPU Model = {cpuinfo.model}" )
|
||||
|
||||
test = multiDriveStat()
|
||||
print( test.drives )
|
||||
|
||||
Reference in New Issue
Block a user