<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 &#39;t&#39; and &#39;h&#39; commands of the UPS (refer to apcsmart.h). The results of the &#39;t&#39; and &#39;h&#39; commands are from probe 1.</font></p>


<p><font face="Arial" size="2">If you submit via the serial port the commands &#39;T&#39; and &#39;H&#39; 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 &#39;T&#39; and &#39;H&#39; 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,             &#39;o&#39; },</font>

<br><font face="Arial" size="2"> </font>

<br><font face="Arial" size="2">        { &quot;ambient.humidity&quot;,   APC_POLL|APC_F_PERCENT, &#39;h&#39; },</font>

<br><font face="Arial" size="2">+       { &quot;ambient.humidity.dual&quot;,</font>

<br><font face="Arial" size="2">+                               APC_POLL|APC_F_LEAVE,   &#39;H&#39; },</font>

<br><font face="Arial" size="2">        { &quot;ambient.humidity.alarm.maximum&quot;, </font>

<br><font face="Arial" size="2">                                APC_F_PERCENT,          &#39;{&#39; },</font>

<br><font face="Arial" size="2">        { &quot;ambient.humidity.alarm.minimum&quot;, </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">        { &quot;ambient.temperature&quot;, </font>

<br><font face="Arial" size="2">                                APC_POLL|APC_F_CELSIUS, &#39;t&#39; },</font>

<br><font face="Arial" size="2">+       { &quot;ambient.temperature.dual&quot;,</font>

<br><font face="Arial" size="2">+                               APC_POLL|APC_F_LEAVE,   &#39;T&#39; },</font>

<br><font face="Arial" size="2">        { &quot;ambient.temperature.alarm.maximum&quot;,</font>

<br><font face="Arial" size="2">                                APC_F_CELSIUS,          &#39;[&#39; },</font>

<br><font face="Arial" size="2">        { &quot;ambient.temperature.alarm.minimum&quot;, </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 &quot;\032-78@.,~\047\177QHRTYayz)1IJ&quot;</font>

<br><font face="Arial" size="2">+#define CMD_IGN_CHARS &quot;\032-78@.,~\047\177QRYayz)1IJ&quot;</font>

<br><font face="Arial" size="2"> </font>

<br><font face="Arial" size="2"> /* compatibility with hardware that doesn&#39;t do APC_CMDSET (&#39;a&#39;) */</font>

<br><font face="Arial" size="2"> </font></p></div></blockquote></div>I&#39;ve updated the patch report (<a href="https://alioth.debian.org/tracker/index.php?func=detail&amp;aid=311678&amp;group_id=30602&amp;atid=411544">https://alioth.debian.org/tracker/index.php?func=detail&amp;aid=311678&amp;group_id=30602&amp;atid=411544</a>) to include your above patch, along with a comment on the namespace integration.<br>
<br>As told, &quot;the only remaining point is whether to map ambient.{humidity,...} on ambient.1.{humidity,...}&quot;, 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&amp;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>