Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Nov 2017, 22:00
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
pmcputemp -temperature monitor
Post new topic   Reply to topic View previous topic :: View next topic
Page 5 of 6 [88 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
OscarTalks


Joined: 05 Feb 2012
Posts: 1635
Location: London, England

PostPosted: Sat 02 May 2015, 18:20    Post subject:  

OK so I tested the load_module_func code as posted after your edit and if I leave the k8temp and the k10temp commented out then those 2 modules do not get loaded (even though they are mentioned in the first modprobe), but the it87 does (it does also automatically load the hwmon and hwmon_vid deps so that is not a problem). On the old AMD system this is enough and pmcputemp does work.

If I uncomment the k8temp and the k10temp then they do load when the script runs. I end up with all 5 loaded but the k8 and k10 do not seem to be needed in this case by pmcputemp and as you say they are not needed by it87.

_________________
Oscar in England

Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8659
Location: qld

PostPosted: Sat 02 May 2015, 22:08    Post subject:  

OscarTalks wrote:

If I uncomment the k8temp and the k10temp then they do load when the script runs. I end up with all 5 loaded but the k8 and k10 do not seem to be needed in this case by pmcputemp and as you say they are not needed by it87.



This is the point of having the loop. Sure, I could modprobe everything inline but then we end up with unused loaded modules. No harm I guess apart from using a tiny bit of extra ram.

Thanks for your tests and going on that I'll release the next version soon.

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
OscarTalks


Joined: 05 Feb 2012
Posts: 1635
Location: London, England

PostPosted: Sun 03 May 2015, 13:11    Post subject:  

I'm afraid I don't really understand how the loop works or what it is intended to do but I thought I would just mention the following:-

My Dell Vostro desktop has a Pentium Dual-Core E6700 at 3.20 GHz and pmcputemp has been working with coretemp loaded and temp2_input as the detected file. I noticed that the it87 module will also load, creating a new directory /sys/devices/platform/it87.2576 which contains a further 3 temp*_input files along with the 2 in coretemp.0

If I swap the code in the script and delete and restart all the pmcputemp stuff I find that the it87 module loads in favour of coretemp and (although pmcputemp still works) I wonder if this is what you would want.

_________________
Oscar in England

Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 3147
Location: King's Lynn, UK.

PostPosted: Sun 03 May 2015, 15:25    Post subject:  

Evening, Mick.

Have just discovered your pmcputemp; NICE one..!

I've got two machines in regular use. A 2005 HP/Compaq desktop PC; belonged to my sister...I've had it about 18 months, and have upgraded just about every major component on it in that time.

Been using Tahrpup since late October. I run tempicon on this one, and it works fine. K8 architecture; did run a single-core Athlon 64, now running an X2 dual Athlon 64. No problems with the upgrade...still works fine.

My other machine is an ancient Dell Inspiron 1100 laptop, from 2002. Used to run a 'Netburst'-gen Celeron (2.2 GHz), recently upgraded to a 2.6 GHz P4 (BIG difference!) This also runs Tahrpup; initially, it was the ONLY Linux distro that just 'worked' with the awkward Intel 82845 video chip. I tried running tempicon on the Dell, but it didn't want to know...

Pmcputemp works beautifully. I DO like the background colour change, as the temp rises...very neat! In fact, I'm going to try it out on the Compaq; if it runs (and I've no reason to think it won't), I'll probably adopt it.

( Now realise that I wasn't even aware that tempicon does change colour; the Compaq runs so cool that it rarely gets above 35C; if it does, I get worried...!)

I don't know quite how your initial run script checks on the hardware sensors, but I DO know that the 'Netburst' P4's & Celerons didn't have the standard coretemp sensor that all modern Intel chips have.....they used something called a 'thm' sensor ( not sure what it stands for), which was situated, I believe, in the socket rather than the chip itself.

Whatever, I've now got a working temp readout...all thanks to your good self. I can quite understand your rant back on page 1; if you don't get feedback, whether negative OR positive, then how ARE you to know if it's working for other folks?? You at least know that it works on the P4's now..!

Quoted by 01micko:-

Quote:
Now, I have 2 problematic laptops that store temperature in :

/sys/devices/virtual/thermal/thermal_zone0/temp

Both intel.


Exact same location for me; I checked.

Code:
 root# find /sys -type f -name 'temp*'
/sys/devices/virtual/thermal/thermal_zone0/temp
root#


I can't speak for the later P4's...like Prescotts & Cedar Mills, etc; but it's definitely a peculiarity of the 'Netburst' variants. Thought you'd like to know.

Credit where credit is due. Cheers!

----------------------------------------------------

BTW: What update intervals have you got set on this? Is it possible to change 'em.....and where would I find them?


Regards,

Mike. Very Happy

_________________
If I've helped you.....please say 'Thanks'!
MY PUPPY PACKAGES
--------------------------------------

Back to top
View user's profile Send private message Visit poster's website 
Mike Walsh


Joined: 28 Jun 2014
Posts: 3147
Location: King's Lynn, UK.

PostPosted: Sun 03 May 2015, 19:18    Post subject:  

@ 01micko:-

I've noticed there seems to be about 7 or 8 degrees difference between the readouts of pmcputemp and tempicon, with the former being the 'cooler' of the two. Any ideas which is which.....and which one might be more accurate? It's a job to know with the AMDs anyway, as they have never used the kind of direct temp readings that Intel use.....everything's calculated as an 'average'.

But 'average' of what?


Regards,

Mike.

_________________
If I've helped you.....please say 'Thanks'!
MY PUPPY PACKAGES
--------------------------------------

Back to top
View user's profile Send private message Visit poster's website 
OscarTalks


Joined: 05 Feb 2012
Posts: 1635
Location: London, England

PostPosted: Mon 04 May 2015, 08:34    Post subject:  

HP Compaq d530 Small Form Factor desktop with Pentium 4 with HT at 2.8 GHz
This was one of the machines on which pmcputemp did not work.
I tried installing lm_sensors and ran sensors-detect which flagged-up a module lm85 which needs to be loaded. Doing this creates 3 temp*_input files:-
Code:
# find /sys -type f -name 'temp*_input'
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp3_input
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp1_input
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp2_input
#

Running the sensors command then suggests that temp2 is the M/B temp and I am wondering if the CPU temp is temp3 (which is higher) rather than temp1 in this case but I can edit that manually in the config file of course. The temp1 does vary, but not to the same extent.
Code:
# sensors
adt7463-i2c-6-2e
Adapter: SMBus I801 adapter at fc00
in0:          +0.01 V  (min =  +0.00 V, max =  +3.32 V)  ALARM
Vcore:        +1.49 V  (min =  +0.00 V, max =  +2.99 V)
+3.3V:        +3.27 V  (min =  +0.00 V, max =  +4.38 V)
+5V:          +5.18 V  (min =  +0.00 V, max =  +6.64 V)
+12V:         +3.25 V  (min =  +0.00 V, max = +15.94 V)
fan1:           0 RPM  (min =    0 RPM)
fan2:           0 RPM  (min =    0 RPM)
fan3:           0 RPM  (min =    0 RPM)
fan4:           0 RPM  (min =    0 RPM)
temp1:        +36.5°C  (low  = -127.0°C, high = +127.0°C)
M/B Temp:     +42.8°C  (low  = -127.0°C, high = +127.0°C)
temp3:        +56.2°C  (low  = -127.0°C, high = +127.0°C)
cpu0_vid:    +1.525 V

#

Anyway, with this module loaded pmcputemp is now working on this machine so maybe you should consider adding this module to the loop as well.

_________________
Oscar in England

Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8659
Location: qld

PostPosted: Mon 04 May 2015, 16:53    Post subject:  

Hi Oscar, interesting find.

OscarTalks wrote:
I tried installing lm_sensors and ran sensors-detect which flagged-up a module lm85 which needs to be loaded. Doing this creates 3 temp*_input files:-


I think I will have to rewrite the script with logic like this:

load_module >if error; load_module_next >if no_error; check_temp_files exist >if no_temp_files; unload_module; load_next_module (check and so on) >if no_modules_work; quit

Make sense?

That way we don't end up with a bunch of modules loaded which do nothing.

My previous logic was:

load_module >if it_doesnt_load; load_next_module >if it_does_load; break >check_temp_files

That way, we can add as many modules that crop up and just tack them on to the list; much more maintainable. Order is of no importance.

Digressing, I have added support back in if lm_sensors is installed. Still experimenting, but when I'm satisfied I'll upload the code to github. I have also added a 'help' option, which depends on jamesbond's new app mdview.

These options will be only available at compile time, as mdview and sensors may not be installed and they are useless without them. However, if those options are enabled and those programs are not installed then pmcputemp will carry on regardless. I know it sounds confusing, but there is a method in the madness.

-----------------------------

Mike Walsh

Thanks for the credit.

Mike Walsh wrote:
I've noticed there seems to be about 7 or 8 degrees difference between the readouts of pmcputemp and tempicon, with the former being the 'cooler' of the two. Any ideas which is which.....and which one might be more accurate? It's a job to know with the AMDs anyway, as they have never used the kind of direct temp readings that Intel use.....everything's calculated as an 'average'.


I'd be more inclined to think that pmcputemp is more reliable, for the simple fact that with the help of Oscar, David and others, that we have done a lot more work on the initial script that finds your temperature data. Go back through this thread and have a read, then try some of the commands I have suggested to others.

That said, it could be wrong! That's why it's important for me to get a good cross section of results.

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 8659
Location: qld

PostPosted: Mon 04 May 2015, 17:37    Post subject:  

Here is a rewrite of pmcputemp.sh , give it a dry run first, then if you are happy, comment the echoes and uncomment the writing to file.

I've made it verbose so you can see what went on.

Code:
#!/bin/sh

TMP=~/.config/pmcputemp
arch=`uname -m`

load_module_func() {
   echo "test module" # COMMENT THIS IN REAL LIFE
   for m in coretemp k10temp k8temp it87 lm85 # more can be added
   do
      lsmod|grep -q $m
      ret=$?
      if [ $ret -ne 0 ];then
         modprobe $m 2>/dev/null # load if not already
      fi
      check_temp_data_exists # returns 0 on success
      dat=$?
      if [ $dat -eq 0 ];then
         return 0 # success, break here
      else
         rmmod $m 2>/dev/null # try to unload as it is useless to us
         continue # module failed, try next module
      fi
   done      
   # if we get here it failed
   echo "Can't load a temperature module"
   return 1
}

find_func() {
   echo "searching" # COMMENT THIS IN REAL LIFE
   FILES="$1"
   for n in `echo $FILES`; do
      read p < $n
      if [ $? = 0 ];then
         FILE=$n # found it
         break
      else
         continue # didn't find, search again
      fi
   done
   # if we get here we didn't find anything useful
}

check_temp_data_exists() {
   echo "checking data" # COMMENT THIS IN REAL LIFE
   # the rough order is Intel, AMD, whatever else
   for a in `find /sys/devices/platform -type f -name 'temp*_input'|sort` \
         `find /sys/devices/pci* -type f -name 'temp*_input'|sort` \
         `find /sys/devices/virtual -type f -name 'temp'|sort`
   do find_func "$a"
      [ -z "$FILE" ] && continue || break # if we found data break
   done
   if [ ! "$FILE" ];then echo "Failed to find file" && return 1 # bail out
   fi
   # if we get here we found it, so we write to file
   [ ! -d $TMP ] && mkdir $TMP
   echo "${FILE} is written to $TMP"
   #echo -n ${FILE} > $TMP/pmcputemprc # UNCOMMENT THIS IN REAL LIFE
   return 0
}

cputempfunc() {
   echo "starting" # COMMENT THIS IN REAL LIFE
   if [ "${arch:0:3}" != "arm" ];then
      load_module_func
      [ $? -ne 0 ] && exit 1
   else
      check_temp_data_exists
   fi
}
cputempfunc # start

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
gcmartin

Joined: 14 Oct 2005
Posts: 6730
Location: Earth

PostPosted: Mon 04 May 2015, 18:42    Post subject:  

testing on a single core 32bit P4 laptop
Copied latest rewrite to /usr/bin/pmcputemp.sh. Opened terminal and
Code:
# uname -a
Linux XSlacko-GWLaptop 3.10.32 #1 SMP Mon Mar 3 16:37:24 EST 2014 i686 Genuine Intel(R) CPU           T2080  @ 1.73GHz GenuineIntel GNU/Linux
# ls -l /usr/bin/pmcputemp.sh
-rwxr-xr-x 1 root root 1964 May  4 18:54 /usr/bin/pmcputemp.sh
# which pmcputemp.sh
/usr/bin/pmcputemp.sh
# pmcputemp.sh
starting
test module
checking data
searching
/sys/devices/platform/coretemp.0/temp2_input is written to /root/.config/pmcputemp
# cat  /root/.config/pmcputemp/pmcputemprc
/sys/devices/platform/coretemp.0/temp2_input
# echo "Using geany, Comment where indicated in script and uncomment as well"
Using geany, Comment where indicated in script and uncomment as well
# pmcputemp.sh
/sys/devices/platform/coretemp.0/temp2_input is written to /root/.config/pmcputemp
(1st day back) Willing to provide any info which you feel would be useful.
_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 3147
Location: King's Lynn, UK.

PostPosted: Mon 04 May 2015, 20:52    Post subject:  

@01micko:-

I'm off to bed now, but before I go, i'll just say this;

As of this moment, I've got both tempicon and pmcputemp running on the taskbar. Currently, the readings are approx:-

tempicon: 26C
pmcputemp: 18/19C

I don't know about you, but I can't quite see how a 10-yr old, dual-core CPU, with over 180 million transistors, and pulling nearly 90W TDP, can possibly run that cool.

What d'you think?


Regards,

Mike. Confused

_________________
If I've helped you.....please say 'Thanks'!
MY PUPPY PACKAGES
--------------------------------------

Back to top
View user's profile Send private message Visit poster's website 
davids45


Joined: 26 Nov 2006
Posts: 992
Location: Chatswood, NSW

PostPosted: Tue 05 May 2015, 02:41    Post subject: Another (old) HP Compac Small Form tested
Subject description: dc7600 3GHz dual core - but no sensors
 

G'day,

Set up for the grandkids, I have a couple of HP small form desktops (model dc7600, 'Pentium 4 HT', vintage 2005) which sensors-detect says there are 'no i2c device files found'.

01micko's latest script for pmcputemp.sh reports lots of 'Failed to find file' lines and finally 'Can't load a temperature module'.

Being an optimist, I tried loading the lm85 module (as per OscarTalks' similar HP desktop) but nothing changed.

pmcputemp-0.63 gives the brown screen 'doesn't work' on start up with these.

I also have a couple of newer HP Small Form desktops which do have 'sensors' and which already run pmcputemp-0.63 OK. I have not tried the latest pmcputemp.sh script in these - should I?

David S.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8659
Location: qld

PostPosted: Tue 05 May 2015, 03:01    Post subject: Re: Another (old) HP Compac Small Form tested
Subject description: dc7600 3GHz dual core - but no sensors
 

davids45 wrote:
should I?



Can't hurt. Just run it from terminal without installing because it needs to be commented/uncommented on all the 'REAL LIFE' lines. Smile


---------------

Mike Walsh -

run these commands in order (the ones that I posted earlier in the thread - to which I referred Wink )
Code:

find /sys -type f -name 'temp'
find /sys -type f -name 'temp*_input'
find /sys -type f -name 'temp' -exec cat '{}' \;
find /sys -type f -name 'temp*_input' -exec cat '{}' \;


Also, the default update interval is 5 seconds - adjustable thanks to jamesbond's suggestion. On the cli just add an integer from 1 to 10, and that will adjust the update to whatever number you put in. Obviously, the lower the number, the more CPU you will use, but it isn't much.

eg:
Code:

pmcputemp 3


-------------

gcmartin.. looks ok to me. Does it work ok? As in correct temp displayed?

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
OscarTalks


Joined: 05 Feb 2012
Posts: 1635
Location: London, England

PostPosted: Tue 05 May 2015, 11:39    Post subject:  

I am on the lm85 module machine right now. I copied and pasted the code from your post into the pmcputemp.sh file in /usr/bin then killed and deleted everything, unloaded the modules and tried running the script on its own:-
Code:
# pmcputemp.sh
/usr/bin/pmcputemp.sh: line 48: syntax error near unexpected token ``find /sys/devices/pci* -type f -name 'temp*_input'|sort`'
/usr/bin/pmcputemp.sh: line 48: `         `find /sys/devices/pci* -type f -name 'temp*_input'|sort` \ '
#

I was not sure about this but I deleted the 2 spaces after the backslashes on the ends of line 47 and line 48 ( actually I seem to have a space on the end of every line from the copy and paste ) and then:-
Code:
# pmcputemp.sh
starting
test module
checking data
Failed to find file
checking data
Failed to find file
checking data
Failed to find file
checking data
Failed to find file
checking data
searching
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp1_input is written to /root/.config/pmcputemp
#

Running lsmod shows that lm85 and hwmon_vid have been loaded so that all looks OK.

If I go on to do all the IN REAL LIFE commenting and uncommenting and try reseting everything and running the pmcputemp program then on the first run it does not start. The config file has been created but it says that it hasn't:-
Code:
# pmcputemp
Failed to find file
Failed to find file
Failed to find file
Failed to find file
/sys/devices/pci0000:00/0000:00:1f.3/i2c-6/6-002e/temp1_input is written to /root/.config/pmcputemp
Unable to create configuration file.

Then on the second attempt it starts but the gdkpixbuf thing happens and then on the third attempt it all runs as it should with the icon present.

_________________
Oscar in England

Back to top
View user's profile Send private message 
OscarTalks


Joined: 05 Feb 2012
Posts: 1635
Location: London, England

PostPosted: Tue 05 May 2015, 13:04    Post subject:  

Now I am on the it87 module AMD Duron machine with everything killed, deleted and unloaded so as to simulate a fresh install of the program. Running the new code for the script looks good. I uncommented the line to allow the config file to be created and it was. The 3 modules it87 and hwmon and hwmon_vid get loaded but no superfluous modules get loaded as far as I can see.
Code:
# ./pmcputemp.sh
starting
test module
checking data
Failed to find file
checking data
Failed to find file
checking data
Failed to find file
checking data
searching
/sys/devices/platform/it87.656/temp1_input is written to /root/.config/pmcputemp
#

Again though if i substitute the new script in place of the old the program does not work on first run. Is this some sort of timing or order issue, similar to the gdkpixbuf thing (the config file doesn't get created quickly enough or something)? Anyway I'm sure it just needs a tweak and then it will be working on machines it wasn't working on before.

_________________
Oscar in England

Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8659
Location: qld

PostPosted: Tue 05 May 2015, 18:14    Post subject:  

Hi Oscar

Good, results are what I wanted to see, mostly. I suppose the extra spaces after back slashes was from the copy/paste operation. When continuing a line with '\' it is imprtant that there is no space after the '\'.

The failure is just a bad return value.

At line 69, 'fi' add a carriage return and add return 0

It should look like the screen cap.

Cheers!
code.jpg
 Description   
 Filesize   13.46 KB
 Viewed   266 Time(s)

code.jpg


_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 5 of 6 [88 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0798s ][ Queries: 12 (0.0091s) ][ GZIP on ]