Steffen Plotner
2009-Jul-09 13:06 UTC
[Nut-upsdev] apcsmart and dual environmental sensors
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>
2009/7/9 Steffen Plotner> Hi, >Hi Steffen,> 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') */ > >I've updated the patch report ( https://alioth.debian.org/tracker/index.php?func=detail&aid=311678&group_id=30602&atid=411544) to include your above patch, along with a comment on the namespace integration. As told, "the only remaining point is whether to map ambient.{humidity,...} on ambient.1.{humidity,...}", and so expose 2 times the same data, but keeping the basic ambient data available in the same placeholder. Comments and feedback welcome. cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20090721/3363a455/attachment.htm>