How to install p.w.m. (Pulse Width Modulation) sensors modules

" PWM stands for Pulse Width Modulation. When it comes to most PC fans, they are powered by a constant load of 12v. The voltage never changes, however, by turning the power off and on, we can modulate (adjust) the speed of the fan. "

2 Likes

Hi Neville, :wave:

I used the command man sensors-detect. I guess that´s what you were referring to as well.

Well, it never occurred to me to look up the man-pages, so I never stumbeld over this warning.
Hmm, sounds scary indeed. :thinking:

I just looked up when I last used the command sudo sensors-detect on my Linux Lite system. It was
Wed 18. Jan 17:06:40 CET 2023.

That´s when I installed and initialized lm-sensors.

I never ran into any difficulties, I´m glad to say.
I was following the ubuntuusers instructions at the time:
Lm sensors › Wiki › ubuntuusers.de .
This German-language resource is pretty reliable and trustworthy.

Here´s the relevant part of it:

Configuration

For LM sensors to work, the sensors on the motherboard have to be detected. The small program sensors-detect helps with this.
This program must be executed with root rights in a terminal:

sudo sensors-detect

All requests can be ensed by entering “Yes” or with be confirmed. Finally, a summary is issued:

Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `w83627hf':
  * ISA bus, address 0x290
    Chip `Winbond W83627THF/THG Super IO Sensors' (confidence: 9)

To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
w83627hf
#----cut here----
If you have some drivers built into your kernel, the list above will
contain too many modules. Skip the appropriate ones!

At the end [of the process], you will be asked whether the required modules of sensors-detect should be inserted into the /etc/modules file right after:

Do you want to add these lines automatically to /etc/modules? (yes/NO)yes
Successful!

This must be confirmed by entering “yes”. After rereading the /etc/modules file, the required kernel modules are loaded. To do so, enter the following command in the terminal:

sudo service kmod start 

Alternatively, you can activate the sensor module(s).

sudo modprobe -v MODULNAME 

(translated locally by firefox)

So they never mentioned anything hazardous. I´m sure they would have if the command was dangerous to use. :thinking:

Sorry, Neville. That´s all I can say about it.

Many greetings from Rosika :slightly_smiling_face:

P.S.:

I found these remarks here:

IIRC, lm-sensors can only maybe cause hardware damage if there are ISA devices or raw I/O port devices that sensors-detect would accidentally send commands to. These kinds of devices are rare on modern platforms, and any Ryzen 5000 motherboard would probably not have any.

Even if commands are accidentally sent, it’s very rare that it would cause hardware damage.
Most (like 99%) of devices that would be on these busses like temperature sensors, LEDs, fans, etc. would not have any non-volatile memory, so a restart would be able to fix any misconfiguration that happens.

and here:

You’re “probably” fine.

Typically if there is an issue it causes your fans to stop. Which can cause physical damage from overheating. If you have rebooted or restarted, you’re probably fine. Just make sure your fans are spinning.

Perhaps there might be an over voltage situation, that would stop fan cooling through out reboots. But I’d wager you’re not in that situation.

and:

Probing for ids and sensors is one of the least problematic activities, no worse than checking values in memory. Nothing went wrong. At worst, I2C/SMBus devices could respond with something unexpected that may cause issues. If you don’t have an I2C/SMBus adapter then you have nothing to worry about.

2 Likes

Pulse Width Modulation
Is now in the title, thanks Neville

Thank you Rosika.
I still think I will avoid it.
My consevative nature

2 Likes

Hi Neville, :wave:

sorry I couldn´t reply earlier.
I got pretty sick over Christmas and had to stay in bed all day long.
It´s my first day online today. :slightly_frowning_face:

Of course, Neville. That´s perfectly alright.

But if you never used the command sudo sensors-detect on your system, how is it that you could get sensors running and provide its output in your post #36 :question:

In order to get some sensible output from lm-sensors you´d have to issue the command sudo sensors-detect first, right?

I hope you had a nice Christmas :christmas_tree:

Many greetings from Rosika :slightly_smiling_face:

1 Like

Hi Rosika,
Oh dear, I hope you are recovering well.
I have been struggling too with a back strain. It is slowly improving.

Right. I think my distros must have some modules loaded by default… the cpu temperature ones are probably universal, at least for x86_64.

Regards
Neville

2 Likes

Hi Neville, :wave:

Thank you for the get well wishes. :heart:
I´m still not my usual self. May take a while for me to fully recover.

Sorry to hear that, Neville. Get well soon. :rose:

I see.
Well, according to my understanding for LM sensors to work, the sensors on the motherboard must be detected first.
Therefore the command sudo sensors-detect has to be executed. But just once.
That´s the extent of my knowledge.

Obviously you didn´t have to do it after all. Oh well. :wink:

But thanks for your feedback.

Many greetings from Rosika :slightly_smiling_face:

P.S.:

I asked perplexity ( Perplexity) about sudo sensors-detect.
The AI consulted 7 sources to come up with a run-down of the main facts.
For anyone interested here´s a re-cap of it:

Q: Linux: is it dangerous to use the command sudo sensors-detect?

A: Using sudo sensors-detect is generally safe, but it does carry some potential risks. The command probes hardware to detect sensors, which in rare cases could cause issues
1

2
. However, following the default options (pressing Enter for all prompts) is considered safe for most systems
6

7
. Key points to consider:

  1. The tool accesses hardware directly, which could potentially cause problems ranging from SMBus lockup to permanent hardware damage in extremely rare cases
    1
    .
  2. It’s recommended not to run sensors-detect on production servers or systems where you can’t afford to replace hardware
    1
    .
  3. In practice, many users have run the command for years without experiencing any issues
    5
    .
  4. The default options are designed to be safe, so simply pressing Enter for all prompts is generally recommended
    6

    7
    .
  5. If you’re concerned, you can use the --auto flag to automatically accept all safe answers
    6
    .

While the risks are minimal when using default options, it’s always wise to proceed with caution when running commands with root privileges that interact directly with hardware.

Nice touch: the sources are referenced in its answer.

1 Like