Hi David,
A very simple asyn driver based on asynPortDriver would do the trick.
The constructor would set the asynFloat64Mask bit in the interface mask. You would implement the readFloat64 function, which would open and read from /proc/acpi/thermal_zone/THRM, parse the temperature and return that as the value. That would work with periodically scanned records.
The whole thing could probably be about 30 lines of code.
If you want to get more sophisticated you could set a polling frequency in the configure command, which you pass to the constructor. It would then have a polling thread that reads, parses, calls setDoubleParam() and callParamCallbacks(). That way the record only processes when the temperature changes.
You could also support other parameters (power, fan, etc.) by using the drvInfo field to specify what parameter is to be returned.
Mark
________________________________
From: Eric Norum [mailto:[email protected]]
Sent: Mon 11/29/2010 7:30 PM
To: David Morris
Cc: Mark Rivers; Steve Shoaf
Subject: Re: Monitoring CPU temperature for small IOC
Sounds like a fairly simple 'devEPICS/ASYN' driver would do the trick.
I think that Steve Shoaf at the APS may have something similar for controlling/reading digital I/O points and load average on an embedded linux system.
On Nov 29, 2010, at 5:20 PM, David Morris wrote:
> Hello all
> I have a Linux based IOC running on a dedicated small hardware platform (Atom CPU in Mini-ITX form factor) We would like this to have no moving parts, which means monitoring the CPU state becomes critical on hot summer days. Is there support for monitoring CPU temperatures using the /proc/acpi service? It seems like this would be something that devIocStats could provide, but perhaps it is too system dependent.
>
> Is there an easy way to collect information from the IOC host system and place it into PVs? Regular reading of /proc/acpi/thermal_zone/THRM will give an updated CPU core temperature, but it is not clear to me how to place this into a PV.
>
> Thanks in advance.
>
> David
>
> --
>
> David Morris TRIUMF
> Systems Designer 4004 Wesbrook Mall
> Ph 604-222-7450 Vancouver, B.C.
> Fax 604-222-7307 V6T 2A3, Canada
>
>
>
--
Eric Norum
[email protected]
- References:
- Monitoring CPU temperature for small IOC David Morris
- Navigate by Date:
- Prev:
Monitoring CPU temperature for small IOC David Morris
- Next:
RE: Monitoring CPU temperature for small IOC Allison, Stephanie
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Monitoring CPU temperature for small IOC David Morris
- Next:
RE: Monitoring CPU temperature for small IOC Allison, Stephanie
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|