Need to execute digitemp multiple times to read temps and humidity

99 views
Skip to first unread message

Peter

unread,
Apr 22, 2012, 10:17:43 AM4/22/12
to DigiTemp
Hi,

I have a number of temperature sensors and two humidity sensors. I
would like to read all sensors via single execution of digitemp, but
right now the only way I can gather data from all sensors is via the
following.

digitemp_DS9097U -c /home/pete/digitemp-3.6.0/.digitemprc -a -o2
digitemp_DS9097U -c /home/pete/digitemp-3.6.0/.digitemprc -t4 -H\%h -q
digitemp_DS9097U -c /home/pete/digitemp-3.6.0/.digitemprc -t1 -H\%h -q

Is there an easier way to accomplish this?

Thanks,
Peter

Lars Heineken

unread,
Apr 22, 2012, 1:06:45 PM4/22/12
to digi...@googlegroups.com
Hi Peter,

At first I thought you were missing a digitemprc file, but that's obviously not the case.
Unfortunately I don't own any humidity sensors to test, but my guess would have been that -a would read all sensors of the config (humidity and temperature). My digitemprc file contains formatting strings for both of them. Yours as well?

Best regards,

Lars.

Guenther Boelter

unread,
Apr 22, 2012, 12:08:00 PM4/22/12
to digi...@googlegroups.com
Hi Peter,

digitemp is great but in this case you should take a look at ardunio or
similar.

Regards
Guenther

--
DavaoSOFT, the home of ERPel
ERPel, das deutsche Warenwirtschaftssystem fuer LINUX
http://www.davaosoft.com

Brian C. Lane

unread,
Apr 22, 2012, 3:37:39 PM4/22/12
to digi...@googlegroups.com

What, exactly, is the problem? -a should make it read all the sensors.

--
http://www.brianlane.com

Peter

unread,
Apr 22, 2012, 8:48:55 PM4/22/12
to DigiTemp
> What, exactly, is the problem? -a should make it read all the sensors.

This is the output I get with -a (where all of the sensors are being
read).

[pete@webmail digitemp-3.6.0]# ./digitemp_DS9097U -a
DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
GNU Public License v2.0 - http://www.digitemp.com
Apr 22 20:39:52 Sensor 1 C: 7.97 F: 46.34 H: 0%
Apr 22 20:39:53 Sensor 2 C: 20.81 F: 69.46
Apr 22 20:39:54 Sensor 3 C: 18.88 F: 65.97
Apr 22 20:39:55 Sensor 4 C: 17.44 F: 63.39 H: 47%
Apr 22 20:39:55 Sensor 5 #0 80
Apr 22 20:39:55 Sensor 5 #1 79

I've been trying to use the -o 2 format for export purposes, but this
does not show the humidity readings. Hence my original question
regarding the need to run both digitemp three times (first with -a -o
2), then to read the humidity value of sensor 1, then the humidity
value of sensor 4.

[root@webmail digitemp-3.6.0]# ./digitemp_DS9097U -a -o 2
DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
GNU Public License v2.0 - http://www.digitemp.com
0 8.16 20.81 18.94 17.47 80 79

Is there an easy way to get a tab delimited file containing all
readings (temperature, humidity, counter).

Thanks,
Peter

Dale Reagan

unread,
Apr 25, 2012, 7:04:36 AM4/25/12
to DigiTemp
On Apr 22, 8:48 pm, Peter <contact...@gmail.com> wrote:
> > What, exactly, is the problem? -a should make it read all the sensors.
>
> This is the output I get with -a (where all of the sensors are being
> read).
>
> [pete@webmail digitemp-3.6.0]# ./digitemp_DS9097U -a
> DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
> GNU Public License v2.0 -http://www.digitemp.com
> Apr 22 20:39:52 Sensor 1 C: 7.97 F: 46.34 H: 0%
> Apr 22 20:39:53 Sensor 2 C: 20.81 F: 69.46
> Apr 22 20:39:54 Sensor 3 C: 18.88 F: 65.97
> Apr 22 20:39:55 Sensor 4 C: 17.44 F: 63.39 H: 47%
> Apr 22 20:39:55 Sensor 5 #0 80
> Apr 22 20:39:55 Sensor 5 #1 79
>
> I've been trying to use the -o 2 format for export purposes, but this
> does not show the humidity readings. Hence my original question
> regarding the need to run both digitemp three times (first with -a -o
> 2), then to read the humidity value of sensor 1, then the humidity
> value of sensor 4.
>
> [root@webmail digitemp-3.6.0]# ./digitemp_DS9097U -a -o 2
> DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
> GNU Public License v2.0 -http://www.digitemp.com
> 0       8.16    20.81   18.94   17.47   80      79
>
> Is there an easy way to get a tab delimited file containing all
> readings (temperature, humidity, counter).


- Custom Formatting won't work?
- Note that the MAN Page (on my system) indicates that: 'When the -o2
or -o3 log options are used the attached DS2438's temperatures will be
output WITHOUT THE HUMUDITY."
- I suggest using a Configuration File - use the '-i' switch to create
then copy/edit and specify in your automated setup
i.e. (your default file will, of course, be different from the
below... Also, I don't currently have a 1-Wire humidity sensor - the
HUM_FORMAT string is, I think, the default...)
------------
TTY /dev/ttyUSB0
LOG /path_to_log_file/temps.log
READ_TIME 750
LOG_TYPE 1
LOG_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F | %N | %s | %R"
CNT_FORMAT "%s | %R | %C | %F | %N"
HUM_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F H: %h%%"
SENSORS 43
ROM 0 0x28 0xE0 0x00 0xCE 0x02 0x00 0x00 0x00
ROM 1 0x28 0xE0 0x00 0xCE 0x02 0x00 0x00 0x00
ROM 2 0x28 0xD0 0x00 0xCE 0x02 0x00 0x00 0x00
...

:)
Dale



:)
Dale
Reply all
Reply to author
Forward
0 new messages