Translate

Sunday, March 26, 2023

Server chronical - Digitemp - reading from DS1490F

Digitemp is a software capable to read Dallas 1Wire sensors for the temperature, the DS18S20.

It was in use on the old server for years in order to acquire different temperatures and thus control automatically some Fans in the server room.

Let's see if it can be revived in the new server.

System information

This article assumes to work on a HP ProLiant DL360p Gen8 server running Ubuntu 22.04 LTS.
Let see some information about that : 
  • Kernel : 5.19.0-32-generic #33
  • Distro : 22.04.1-Ubuntu SMP PREEMPT_DYNAMIC 
  • USB adapter for 1Wire Dallas : seen as DS1490F 
    Bus 001 Device 005: ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1 Fob, 1-Wire adapter

Temperature monitor system

Because the server position it is important to monitor the temperature in order to avoid extremes, automatically activating fans to bring in fresh air and push out hot air.

There are 3 different areas in my case. The server is located in a small room below the laundry stairs, with the only access from the garage.
Thus I set up three main areas to monitor :

  • server area
  • garage
  • laundry area


The Server area is insulated from the Garage area, but it accessible only from it.

The Laundry area is just above the server area. The Laundry area is air conditioned, so it is possible to bring fresh air in the Server area from there (see Cooling the server area)

Two fans are in place, one blowing air FROM the Server area into the Garage area, and one blowing fresh air from the Laundry Room into the server area.

There are some choices to monitor the temperature.

  • 1Wire sensors
  • USB sensor
  • CPU sensor

1Wire sensors

A network of 3 DS18s20 sensors, handled by a 1Wire <-> USB interface (1490F) are installed to monitor the three area temperatures.

The temperature can be acquired using the Digitemp program.

Of course nothing is easy, so I soon discovered that the version of Digitemp installed from the distro is not correctly working.

So the first step is to build the 1wire network using an USB adapter (DS1490F ) and test it on a machine running a working Digitemp.

USB settings

It is mandatory to blacklist the DSx490 from the USB tree, otherwise digitemp can not use it.

Every time a DSx490 is plugged in some modules are automatically loaded from the kernel, this need to be stopped.
In the kernel it is used the name of DS2490 for this type of adapter.

To do so :

  • edit the file /etc/modprobe.d/blacklist.conf

  • add the line (at the end) : blacklist ds2490

  • save the file

  • reboot


After that, plugging the USB adapter would not cause the installation of the kernel modules for it.

Digitemp installation


Initially I installed the official version from the repository : sudo apt-get install digitemp

The version installed was the 3.7.13 and was NOT WORKING !
It is necessary to use a patched version capable to address the USB adapter.


These the steps I followed:

  • I removed official version of Digitemp: sudo apt-get remove digitemp

  • Installed support libraries : 
    - sudo apt install libusb-1.0-0-dev
    - sudo apt install build-essential

  • downloaded a patched version from https://github.com/desto-kluger/digitemp

  • extracted/cloned the code in a local directory (in the example is called MyApps)

  • Compiled :
     - make clean; make ds2490

  • run locally to test :
    sudo ./digitemp_DS2490 -i DigiTemp v3.6.0 Copyright 1996-2009 by Brian C. Lane GNU Public License v2.0 - http://www.digitemp.com Found DS2490 device #1 at 4/3 Turning off all DS2409 Couplers .... Searching the 1-Wire LAN 1098E70F01080027 : DS1820/DS18S20/DS1920 Temperature Sensor 10FDDD710108008B : DS1820/DS18S20/DS1920 Temperature Sensor10438CF501080010 : DS1820/DS18S20/DS1920 Temperature Sensor| ROM #0 : 1098E70F01080027 ROM #1 : 10FDDD710108008B ROM #2 : 10438CF501080010 Wrote .digitemprc


  • Read the temperatures:
    sudo ./digitemp_DS2490 -a
    DigiTemp v3.6.0 Copyright 1996-2009 by Brian C. Lane
    GNU Public License v2.0 - http://www.digitemp.com
    Found DS2490 device #1 at 4/3
    Jun 28 16:09:00 Sensor 0 C: 28.25 F: 82.85
    Jun 28 16:09:01 Sensor 1 C: 25.38 F: 77.68
    Jun 28 16:09:02 Sensor 2 C: 31.25 F: 88.25

Use Digitemp

Before to use Digitemp, it is important to run it with the -i option from the location.

Here the sensor assignment and location :

Num. sensor

ID

Location

Awk number

0

1098e70f01080027

Garage

27

1

10fddd710108008b

AC area

36

2

10438cf501080010

Server area

45




For example (in home) :

sudo MyApps/digitemp-master/./digitemp_DS2490 -i


This will write the configuration file.

Then it will be possible to call (from home):

sudo MyApp/digitemp-master/./digitemp_DS2490 -a



The reading will be for the three sensor :

DigiTemp v3.6.0 Copyright 1996-2009 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

Found DS2490 device #1 at 1/4

Jun 28 23:34:04 Sensor 0 C: 28.50 F: 83.30

Jun 28 23:34:05 Sensor 1 C: 27.50 F: 81.50

Jun 28 23:34:06 Sensor 2 C: 28.50 F: 83.30

Resources


No comments:

Post a Comment