<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 09/15/2014 11:25 PM, Stewart C.
      Russell wrote:<br>
    </div>
    <blockquote cite="mid:5417ADA0.2030401@gmail.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <font size="+1">Hi,<br>
        <br>
        Since there are some really experienced system people here, I'd
        like to ask some advice on designing logging parameters for a
        serial device. I'd like to design the output log so it's most
        obvious to users what's coming out the thing, and so it's easy
        to stuff readings into a database for later analysis. I have
        complete freedom to redesign the log coming out of this embedded
        device.<br>
        <br>
        Here's what I get from the device:<br>
      </font>
      <ol>
        <li><font size="+1">Approximately twice a minute, I get a
            cumulative energy reading and the average power for the last
            30s or so</font></li>
        <li><font size="+1">About once every five minutes, I get a
            packet which contains an approximate (±1°C or so) ambient
            temperature</font></li>
      </ol>
      <p><font size="+1">I can also report:<br>
        </font></p>
      <ul>
        <li><font size="+1">a fairly accurate (at least over the short
            term) elapsed time stamp in milliseconds - but not real
            time, as there is no RTC. The time stamp rolls over slightly
            more than once a month.<br>
          </font></li>
        <li><font size="+1">the received signal strength in dBm</font></li>
      </ul>
      <p><font size="+1">This device is decoding the RF packets from the
          BlueLine Power Cost Meter that the OPA and local utilities
          give out to hydro consumers in Ontario. It's also the same as
          the Black & Decker Power Meter. The device would allow you
          to track real-time energy consumption without fiddling around
          with Toronto Hydro's time-of-use website (or, gulp, having to
          mess with Green Button energy files - eek!). As it counts the
          hydro meter's watt-hour pulses, it's pretty accurate.<br>
        </font></p>
      <p><font size="+1">So - I'm currently logging something like this
          <br>
        </font></p>
      <p><font size="+1">    [105874810] Energy: 63856 Wh, Power: 613 W,
          Temp: 14 C (Rssi -81 dBm)<br>
        </font></p>
      <p>where the first number's the timestamp.<br>
      </p>
      <ul>
        <li>Would this format cause hiccups in typical logging
          applications?</li>
        <li>Is 9600 baud still the gold standard serial speed? I can use
          pretty much any speed, and there's never much data to
          transmit.</li>
      </ul>
      <p>Any suggestions/questions greatly appreciated.<br>
      </p>
      If anyone has one of these OPA Power Cost Meters, and wants to
      have a play with it, you'll need:<br>
      <ul>
        <li>a 3.3 V Arduino (or a standard 5V one and some level
          converters that can do SPI)</li>
        <li>an RFM69 433.92 MHz transceiver board (caution: it uses 2 mm
          pin spacing, so won't fit a standard breadboard)</li>
        <li>this code: <a moz-do-not-send="true"
            class="moz-txt-link-freetext"
            href="https://github.com/CapnBry/Powermon433">https://github.com/CapnBry/Powermon433</a></li>
      </ul>
      <p>The output is rough, but I've successfully tracked several
        days' power use so far with far higher resolution than is
        available from smart meter website.<br>
      </p>
      <p>cheers,<br>
         Stewart </p>
    </blockquote>
    It's just a little redundant: the names end in : the values in , the
    time is in square brackets, the  rssi in round ones.  <br>
    <br>
    To analyze, I need to first convert the closing bracket to a , and
    the opening to a blank, and the reverse with the round brackets. 
    Then I prune off the keywords, : and units.  At that point I can
    start the analysis.<br>
    <br>
    I'd be more inclined toward <br>
    <font size="+1"> Timestamp: 105874810, Energy (Wh): 63856, Power
      (W): 613, Temp (C): 14,  Rssi (dBm):  -81</font> <br>
    or a linear format like<br>
    <font size="+1">Timestamp,  Energy (Wh), Power (W), Temp (C),  Rssi
      (dBm)</font><br>
    <font size="+1">105874810, 63856, 613,  14,  -81</font><br>
    <br>
    If the arduino has a clock, you might also start with <br>
    <b># Date and time, </b><b>Tue Sep 16 14:43:01 EDT 2014</b><br>
    <br>
    or if the clock was fairly good at start time, compute a date and
    time for each line from the millisecond counter and the start time. 
    <br>
    <br>
    --dave<br>
    <pre class="moz-signature" cols="72">-- 
David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
<a class="moz-txt-link-abbreviated" href="mailto:davecb@spamcop.net">davecb@spamcop.net</a>           |                      -- Mark Twain
</pre>
  </body>
</html>