<br><div class="gmail_quote">2009/7/9 Steffen Plotner<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<p><font face="Arial" size="2">Hi,</font></p></div></blockquote><div><br>Hi Steffen, <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><p><font face="Arial" size="2"></font>
</p>
<p><font face="Arial" size="2">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.</font></p>
<p><font face="Arial" size="2">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:</font></p>
<p><font face="Arial" size="2">ambient.temperature.dual: 28.70,20.82</font>
</p>
<p><font face="Arial" size="2">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):</font></p>
<p><font face="Arial" size="2">--- nut-2.2.0/drivers/apcsmart.h.orig 2006-11-25 02:52:52.000000000 -0500</font>
<br><font face="Arial" size="2">+++ nut-2.2.0/drivers/apcsmart.h 2009-06-10 09:54:18.000000000 -0400</font>
<br><font face="Arial" size="2">@@ -156,6 +156,8 @@</font>
<br><font face="Arial" size="2"> APC_F_VOLT, 'o' },</font>
<br><font face="Arial" size="2"> </font>
<br><font face="Arial" size="2"> { "ambient.humidity", APC_POLL|APC_F_PERCENT, 'h' },</font>
<br><font face="Arial" size="2">+ { "ambient.humidity.dual",</font>
<br><font face="Arial" size="2">+ APC_POLL|APC_F_LEAVE, 'H' },</font>
<br><font face="Arial" size="2"> { "ambient.humidity.alarm.maximum", </font>
<br><font face="Arial" size="2"> APC_F_PERCENT, '{' },</font>
<br><font face="Arial" size="2"> { "ambient.humidity.alarm.minimum", </font>
<br><font face="Arial" size="2">@@ -163,6 +165,8 @@</font>
<br><font face="Arial" size="2"> </font>
<br><font face="Arial" size="2"> { "ambient.temperature", </font>
<br><font face="Arial" size="2"> APC_POLL|APC_F_CELSIUS, 't' },</font>
<br><font face="Arial" size="2">+ { "ambient.temperature.dual",</font>
<br><font face="Arial" size="2">+ APC_POLL|APC_F_LEAVE, 'T' },</font>
<br><font face="Arial" size="2"> { "ambient.temperature.alarm.maximum",</font>
<br><font face="Arial" size="2"> APC_F_CELSIUS, '[' },</font>
<br><font face="Arial" size="2"> { "ambient.temperature.alarm.minimum", </font>
<br><font face="Arial" size="2">@@ -241,7 +245,7 @@</font>
<br><font face="Arial" size="2"> };</font>
<br><font face="Arial" size="2"> </font>
<br><font face="Arial" size="2"> /* things to ignore in protocol_verify - useless variables, etc. */</font>
<br><font face="Arial" size="2">-#define CMD_IGN_CHARS "\032-78@.,~\047\177QHRTYayz)1IJ"</font>
<br><font face="Arial" size="2">+#define CMD_IGN_CHARS "\032-78@.,~\047\177QRYayz)1IJ"</font>
<br><font face="Arial" size="2"> </font>
<br><font face="Arial" size="2"> /* compatibility with hardware that doesn't do APC_CMDSET ('a') */</font>
<br><font face="Arial" size="2"> </font></p></div></blockquote></div>I've updated the patch report (<a href="https://alioth.debian.org/tracker/index.php?func=detail&aid=311678&group_id=30602&atid=411544">https://alioth.debian.org/tracker/index.php?func=detail&aid=311678&group_id=30602&atid=411544</a>) to include your above patch, along with a comment on the namespace integration.<br>
<br>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.<br clear="all">
<br>Comments and feedback welcome.<br><br>cheers,<br>Arnaud<br>-- <br>Linux / Unix Expert R&D - Eaton - <a href="http://www.eaton.com/mgeops">http://www.eaton.com/mgeops</a><br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/">http://www.networkupstools.org/</a><br>
Debian Developer - <a href="http://www.debian.org">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.free.fr/">http://arnaud.quette.free.fr/</a><br>