[Nut-upsdev] apcsmart and dual environmental sensors

Steffen Plotner swplotner at amherst.edu
Thu Jul 9 13:06:02 UTC 2009


Hi,

We have a several AP9612TH environmental cards (they have 2 probe
connectors) inserted into our APC UPS devices which monitor temperature
and humidity. The apcsmart nut module knows how to query the
ambient.temperature and ambient.humidity using the 't' and 'h' commands
of the UPS (refer to apcsmart.h). The results of the 't' and 'h'
commands are from probe 1.

If you submit via the serial port the commands 'T' and 'H' you can
obtain temperature and humidity readings that contains the results of
both probes. The results are comma seperated:

ambient.temperature.dual: 28.70,20.82

I have created a patch that supports the new 'T' and 'H' commands and
its resulting output using upsc is shown above. The patch does not
change the behavior of the origina ambient.temperature reading, it
simply adds a new ambient.temperature.dual reading (this applies to both
temperature and humidity):

--- nut-2.2.0/drivers/apcsmart.h.orig   2006-11-25 02:52:52.000000000
-0500
+++ nut-2.2.0/drivers/apcsmart.h        2009-06-10 09:54:18.000000000
-0400
@@ -156,6 +156,8 @@
                                APC_F_VOLT,             'o' },
 
        { "ambient.humidity",   APC_POLL|APC_F_PERCENT, 'h' },
+       { "ambient.humidity.dual",
+                               APC_POLL|APC_F_LEAVE,   'H' },
        { "ambient.humidity.alarm.maximum", 
                                APC_F_PERCENT,          '{' },
        { "ambient.humidity.alarm.minimum", 
@@ -163,6 +165,8 @@
 
        { "ambient.temperature", 
                                APC_POLL|APC_F_CELSIUS, 't' },
+       { "ambient.temperature.dual",
+                               APC_POLL|APC_F_LEAVE,   'T' },
        { "ambient.temperature.alarm.maximum",
                                APC_F_CELSIUS,          '[' },
        { "ambient.temperature.alarm.minimum", 
@@ -241,7 +245,7 @@
 };
 
 /* things to ignore in protocol_verify - useless variables, etc. */
-#define CMD_IGN_CHARS "\032-78 at .,~\047\177QHRTYayz)1IJ"
+#define CMD_IGN_CHARS "\032-78 at .,~\047\177QRYayz)1IJ"
 
 /* compatibility with hardware that doesn't do APC_CMDSET ('a') */
 

________________________________

Steffen Plotner
Systems Administrator/Programmer
Systems & Networking

Amherst College
PO BOX 5000
Amherst, MA 01002-5000
Tel (413) 542-2348
Fax (413) 542-2626
Email: swplotner at amherst.edu 
________________________________


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20090709/5252f333/attachment.htm>


More information about the Nut-upsdev mailing list