# My thermal sensor is reading negative values.



## Sopalajo (May 6, 2018)

Hello, boys.
I am testing the thermal reading system by issuing:


```
$ sysctl -a | grep temp
```

And I get:


```
net.inet6.ip6.use_tempaddr: 0
net.inet6.ip6.temppltime: 86400
net.inet6.ip6.tempvltime: 604800
net.inet6.ip6.prefer_tempaddr: 0
hw.acpi.thermal.tz0.temperature: -273.2C
hw.usb.template: 0
```

Obviously, none of my chips (CPU in this case) is at -273ºC X-D .

Could anyone help me calibrate this wrong behavior, please?

My version:


```
$ uname -a
FreeBSD Balanceador.Kame 10.3-RELEASE FreeBSD 10.3-RELEASE #16 a679439(RELENG_2_3): Tue Apr 12 12:07:02 CDT 2016     root@ce23-amd64-builder:/builder/pfsense/tmp/obj/builder/pfsense/tmp/FreeBSD-src/sys/pfSense  amd64
```


----------



## k.jacker (May 6, 2018)

This is not the temperature sensor inside of your cpu.
Depending on your cpu is Intel or AMD you have to either `# kldload coretemp` or `# kldload amdtemp`
to make the corresponding oid appear.
coretemp(4)
amdtemp(4)

On an Intel quad core cpu (or dual core with HT) you will get the following

```
dev.cpu.3.temperature: 47,0C
dev.cpu.2.temperature: 47,0C
dev.cpu.1.temperature: 46,0C
dev.cpu.0.temperature: 46,0C
```


----------



## Sopalajo (May 6, 2018)

k.jacker said:


> This is not the temperature sensor inside of your cpu.
> Depending on your cpu is Intel or AMD you have to either `# kldload coretemp` or `# kldload amdtemp`
> to make the corresponding oid appear.



My CPU is reported as *Intel(R) Pentium(R) D CPU 2.80GHz .*
But there is no output from `# kldload coretemp` command. :-(

More details on my CPU:
_Current: 2400 MHz, Max: 2800 MHz
                       2 CPUs: 1 package(s) x 2 core(s)   _ 

My system is a pfSense implementation of FreeBSD. Could that be a problem?


----------



## k.jacker (May 7, 2018)

The above isn't the output from kldload, but the sysctl values you can read from, after loading the coretemp module.


----------



## Phishfry (May 7, 2018)

The Pentium D 820 pre-dates (2005) the Intel Core architecture needed for coretemp.
https://www.freebsd.org/cgi/man.cgi?coretemp


----------



## Sensucht94 (May 7, 2018)

After loading coretemp.ko with kldload(8) (you can also load it at boot by appending it to the loader(8): `echo coretemp_load=\"YES\" >> /boot/loader.conf`) you can use sysctl to display CPU temp values:

```
sysctl dev.cpu.*.temperature
```

Where * is the number of the core (starting from 0)

To directly read the temperature only you can pipe the command through `awk`, e.g.:

```
sysctl dev.cpu.0.temperature | awk '{print $2}'
```

EDIT: Phishfry promptly corrected my wrong assumption according to which your CPU was supported. You can try instead with sysutils/xmbmon


----------



## SirDice (May 7, 2018)

Interesting value, -273.2 C is absolute zero. Your machine is using super-conductivity 

https://en.wikipedia.org/wiki/Absolute_zero


----------



## ralphbsz (May 7, 2018)

A: You are asking about pfSense, which is a distribution that's derived from FreeBSD, and not real FreeBSD.
B: Your kernel is old, it's 10.3, and today's production kernels are 11.1 and 12.x
C: Not all Intel CPUs support coretemp, in particular not the older ones.  On my Atom machine for example, it does not work.
D: There are many other ways to measure the motherboard temperature; the depend on what sensors are installed on your motherboard.


----------



## Oleg P. (May 8, 2018)

Hello. I have got the same issue https://forums.freebsd.org/threads/hw-acpi-thermal-tz0-temperature-273-2c.63834/#post-370107 .
I am using FreeBSD 10.3-stable on the PC Shuttle XPC with Pentium D CPU.
And I need a help too.


----------



## Phishfry (May 8, 2018)

Sensucht94 said:


> You can try instead with sysutils/xmbmon


Yes this is what is needed.
These PentiumD processors used a temperature sensor underneath the cpu in the center. They had no on die monitoring.
So you need motherboard utilities which can monitor temps. There are many different temp sensors used too.


----------



## Phishfry (May 8, 2018)

You could also check sysutils/cpu-x and see if it offers any temperatures for your CPU.


----------



## Oleg P. (May 9, 2018)

Hello! Thanks Phishfry. I have installed xmbmon.
I think xmbmon shows real temperature of CPU (about 62 C).
But how can I make fan control on my PC?
Thanks for advice.


----------



## Phishfry (May 9, 2018)

I don't think motherboard fan control really hit until 4 Wire CPU fans with PWM. Before that we used front panel knobs and I had a thermaltake orb inline knob gizmo for adjusting the speed on the 3 Pins. With the Three wire fans you have Pos/Neg and tachometer. No control.
In the old days real tweakers would solder in a resistor to pull it down to around 7V for reduced fan rpms.
With the PentiumD you do not want to reduce the fan. They were notorious flamethrowers and the lowest TDP was 95W.
Not to insult you but they are a horrible CPU. Lower end D-820 defiantly better then PentiumD-960. Those PentiumD 9xx should have been outlawed. I think they were 130W and ran like it. Higher clocks meant much higher operating temps.
https://en.wikipedia.org/wiki/Pentium_D


----------



## Oleg P. (May 9, 2018)

BIOS on my PC has options "smart" to control fan, but under FreeBSD 10.3 it does not works.
If I understand do I need write a program to control fan on my PC?


----------



## Phishfry (May 9, 2018)

Well it boils back down to 3-Pin header and CPU fan or 4 Pin header and fan.
Many of the 4 Pin CPU fan headers will accept a 3 pin fan.
Only a 4 Pin fan in a 4 Pin socket can be controlled electronically from what I know.
Do you have that?

I remember many serverboards having a broken SmartFan implementation by running the fans full blast. Fine in datacenter.
Probably like laptop fans that run full blast in FreeBSD. Broken ACPI implementation in bios.
Many times I crosscheck and see the same issues on Linux. ACPI bios errors.

I just wrote a thread tonight about a Lanner server I bought. I had to use 'manual' under SmartFan and set a PWM number.
The newer CPU's have thermal trips and you can't kill them. Pentium D is not one of those.
You stop that fan with wrong values and you'r toast.
That cpu needs cooling.


----------



## SirDice (May 9, 2018)

Oleg P. said:


> I am using FreeBSD 10.3-stable


Update your system. FreeBSD 10.3-RELEASE is End-of-Life and 10-STABLE is 10.4-STABLE.


----------



## Oleg P. (May 9, 2018)

Now I have checked fan pins. It has 4 pin connector.
And under Windows XP "smart" option of fan was working not bad.
May be, do I have a chance to make fan control on my PC under FreeBSD?


----------



## Phishfry (May 9, 2018)

Yes have you enabled powerd(8). It acts as a throttle. It has various settings for performance versus economy.

I can't guarantee it will work for the older CPU's. Look at dmesg for failure messages for powerd if enabled.


----------



## Phishfry (May 9, 2018)

You want to research your processors Thermal Junction to get an idea of what temperatures your CPU can endure.

Looking here your Tcase is 64 degrees Celsius. This is the absolute maximum they can endure without degradation.
This thermal junction number is extremely low for CPU's today. Most are 80C and some 100C

You are showing 62 degrees Celsius. You better hope you thermal sensor is not reading correct. You have nowhere to go.
Maybe Tcase number is low for a buffer. With no thermal trip they need a safety margin.
These were naturally warm running. The chart said only the PD-805 and PD-820 were 95W. All the rest 130W.
The PentiumD 900 series did have a few more 95W chips.


----------



## Phishfry (May 9, 2018)

Well I learned something helping you.
The Pressler 'Extreme Edition' PentiumD's were the first desktop Intel CPU's with thermal protection.

I want to mention there is also another cpu throttling program called sysutils/powerdxx
Claims to be better and I have seen some recommendations for it here.
So your CPU fan is controlled by ACPI which if working correctly should detect the temperature and adjust the fan accordingly.
powerd acts as the power regulator.
You can fiddle with ACPI thermal sysctl and adjust the fan speed but your on your own there.


----------



## Oleg P. (May 9, 2018)

Well, I have launched xmbmon on the "cold" PC, it has shown 42C.
62C was got after 3 hours of work PC.


----------

