<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Michael,<div><br></div><div>I checked the Sleep() function. Turning off the SIM908 and going to Sleep() seemed to bring overall usage down to 25mA.</div><div><br></div><div>Your code for alert seems to be ok, but I think the thresholds may be too high. The ADC reading is dependent on individual resistor variation (it is just a voltage divider) and I doubt whether it is accurate to more than 0.5V or so. It will scale linearly, but the offset will be wrong. For example, my car shows 11.5V as the nominal voltage.</div><div><br></div><div>Perhaps lower the threshold to 11V?</div><div><br></div><div>Regards, Mark.</div><div><br><div><div>On 19 Jan, 2013, at 9:36 PM, Michael Balzer <<a href="mailto:dexter@expeedo.de">dexter@expeedo.de</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    Mark,<br>
    <br>
    I just checked in the 12V alert function.<br>
    <br>
    It's straight forward and compiles ok, but I cannot test if it
    triggers and resets correctly under real use conditions -- I've got
    no power supply with adjustable voltage.<br>
    <br>
    As most 12V batteries will be standard lead acid ones, I've set the
    trigger thresholds to reasonable values for these: The alert will be
    triggered on voltage drop below 11.5 V and reset on voltage above
    11.9 V.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 19.01.2013 11:10, schrieb Michael
      Balzer:<br>
    </div>
    <blockquote cite="mid:50FA710B.8060303@expeedo.de" type="cite">
      <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
      Mark,<br>
      <br>
      for the Twizy and maybe other cars, a wakeup from activity on the
      CAN bus could also be an option. I remember reading about that in
      the SIM908 manual. The OVMS could generally sleep while the Twizy
      is off, maybe with an optional timed wakeup every 10-15 minutes
      for 1-2 minutes to detect GPS position changes.<br>
      <br>
      Btw, the SIM908 hardware design contains detailed info on the
      sleep modes and power usages:<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.mt-system.ru/sites/default/files/sim908-c_hardware_design_v1.03.pdf">http://www.mt-system.ru/sites/default/files/sim908-c_hardware_design_v1.03.pdf</a><br>
      <br>
      Thanks for bringing the 12V monitoring to my attention.<br>
      <br>
      I'll now first add an SMS alert on the 12V power line getting too
      low, that's easy to implement and will remind users to charge.<br>
      <br>
      Regards,<br>
      Michael<br>
      <br>
      <br>
      <div class="moz-cite-prefix">Am 19.01.2013 10:47, schrieb Mark
        Webb-Johnson:<br>
      </div>
      <blockquote cite="mid:946F2EB5-33B6-46BE-BF8B-B9E8ED9B8419@webb-johnson.net" type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <div><br>
        </div>
        Here are the power usage figures from my bench, using v1
        hardware:
        <div><br>
        </div>
        <div>
          <ul class="MailOutline">
            <li>PIC (normal mode) on, modem powered down (by power
              toggle switch): 35mA - 42mA</li>
            <li>PIC (normal mode) on, modem on, gps off: 75mA</li>
            <li>PIC (normal mode) on, modem on,gps on: 120mA</li>
            <li>Very short-lived bursts to 160mA at times, presumably
              while transmitting on GSM</li>
          </ul>
        </div>
        <div><br>
        </div>
        <div>Playing with AT+CSCLK=2, the modem seems to drop to almost
          no power usage (perhaps 45mA), with a CR on the async port
          waking it up.</div>
        <div><br>
        </div>
        <div>Looking at the PIC18F2685 data sheet, it seems that with an
          external 20MHz oscillator, the normal power consumption is
          around 30mA to 40mA. Switching to an internal 4MHz oscillator
          reduces that to 5.3mA, and internal 1MHz oscillator to 3mA.
          Sleep mode is 2ľA.</div>
        <div><br>
        </div>
        <div>I'll play around with it. So far, it seems it is quite easy
          to go into low-power sleep mode. It is getting back out that
          is the tricky bit.</div>
        <div><br>
        </div>
        <div>Regards, Mark.</div>
        <div><br>
          <div>
            <div>On 19 Jan, 2013, at 8:50 AM, Mark Webb-Johnson <<a moz-do-not-send="true" href="mailto:mark@webb-johnson.net">mark@webb-johnson.net</a>>

              wrote:</div>
            <br class="Apple-interchange-newline">
            <blockquote type="cite">
              <meta http-equiv="Content-Type" content="text/html;
                charset=ISO-8859-1">
              <div style="word-wrap: break-word; -webkit-nbsp-mode:
                space; -webkit-line-break: after-white-space; ">Michael,
                <div><br>
                </div>
                <div>Urgh. Glad that you managed to recover it.</div>
                <div><br>
                </div>
                <div>The TMC forums have a few theads at the moment of
                  Model S cars with 12V battery issues, and the Tesla
                  Roadster's little 12V battery seems to need replacing
                  every 13 to 25 months.</div>
                <div><br>
                </div>
                <div>For Roadsters, OVMS is not run off that little 12V
                  battery, so we haven't seen this issue.</div>
                <div><br>
                </div>
                <div>The good news is that we did anticipate this sort
                  of thing (except were expecting to see it more on ICE
                  cars with OBDII monitoring). We added 12V power line
                  monitoring, through an ADC, into the v2 hardware.
                  Looking at your logs for the past few days is
                  interesting (I don't think there is anything private
                  in their apart from the vehicleid and odometer, which
                  I have obscured, so hope you don't mind me posting
                  here). The 12v line reading is the second to last
                  column:</div>
                <div><br>
                </div>
                <div>
                  <blockquote style="margin: 0 0 0 40px; border: none;
                    padding: 0px;"><font face="Andale Mono" size="2">2013-01-14

                      06:39:53.930886 -0500 info  main: #34 C XXXXXXX rx
                      msg D
                      128,0,0,13,17,4,0,YYYY9,28,0,-127,0,120,-1,15.0,0<br>
                      2013-01-14 06:59:54.871517 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.7,0<br>
                      2013-01-14 07:05:26.666203 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.7,0<br>
                      2013-01-14 07:05:46.498420 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.7,0<br>
                      2013-01-14 07:06:04.864927 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.7,0<br>
                      2013-01-14 07:30:07.228738 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.6,0<br>
                      2013-01-14 08:29:57.461316 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.5,0<br>
                      2013-01-14 09:29:48.441380 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.4,0<br>
                      2013-01-14 11:29:30.755176 -0500 info  main: #34 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.3,0<br>
                      2013-01-14 15:05:36.688666 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.2,0<br>
                      2013-01-14 16:05:35.111552 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.7,0<br>
                      2013-01-14 16:36:35.755630 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.2,0<br>
                      2013-01-14 18:38:18.404933 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.2,0<br>
                      2013-01-14 21:04:47.187479 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.1,0<br>
                      2013-01-15 02:04:22.801440 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,12.0,0<br>
                      2013-01-15 09:03:13.233483 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.9,0<br>
                      2013-01-15 11:02:54.400624 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.7,0<br>
                      2013-01-15 12:02:44.724576 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.9,0<br>
                      2013-01-15 13:02:34.285593 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.8,0<br>
                      2013-01-15 16:02:09.372087 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.7,0<br>
                      2013-01-15 17:02:00.235001 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.8,0<br>
                      2013-01-15 19:01:41.695938 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.7,0<br>
                      2013-01-16 02:00:40.126355 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.6,0<br>
                      2013-01-16 06:00:03.073862 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.5,0<br>
                      2013-01-16 11:59:01.907094 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.4,0<br>
                      2013-01-16 15:58:22.520731 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 17:22:48.691426 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 17:30:10.701329 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 17:30:21.837740 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.2,0<br>
                      2013-01-16 17:36:37.811552 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 17:46:01.164994 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 17:48:35.257576 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 17:56:49.565932 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:01:15.186127 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:02:46.866156 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:02:54.217581 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:10:29.930408 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:10:38.723483 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.2,0<br>
                      2013-01-16 18:11:12.459758 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.2,0<br>
                      2013-01-16 18:18:31.863177 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:19:03.123286 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:43:55.355803 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.3,0<br>
                      2013-01-16 18:58:43.567326 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.2,0<br>
                      2013-01-16 22:58:15.314101 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.1,0<br>
                      2013-01-17 01:57:50.181011 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,11.0,0<br>
                      2013-01-17 02:57:40.587918 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,10.9,0<br>
                      2013-01-17 03:57:30.418056 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,10.8,0<br>
                      2013-01-17 04:57:19.241415 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,10.6,0<br>
                      2013-01-17 05:57:10.622186 -0500 info  main: #54 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,10.3,0<br>
                      2013-01-17 06:32:32.593533 -0500 info  main: #55 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,10.0,0<br>
                      2013-01-17 07:32:23.932656 -0500 info  main: #55 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,9.4,0<br>
                      2013-01-17 08:32:13.374380 -0500 info  main: #55 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,7.9,0<br>
                      2013-01-17 09:32:03.204557 -0500 info  main: #55 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,7.2,0<br>
                      2013-01-17 10:31:52.551362 -0500 info  main: #55 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,6.5,0<br>
                      2013-01-17 11:31:41.821330 -0500 info  main: #55 C
                      XXXXXXX rx msg D
                      0,0,0,14,15,4,0,ZZZZ0,0,0,-127,0,0,-1,6.7,0<br>
                      2013-01-17 12:58:48.540906 -0500 info  main: #60 C
                      XXXXXXX rx msg D
                      128,0,0,13,1,2,0,ZZZZ8,0,0,-127,0,120,-1,15.1,0</font></blockquote>
                </div>
                <div><br>
                </div>
                <div>It shows 15v at the start (I guess when the car is
                  on and charging it), then 12.7v at 2013-01-14 06am
                  EST, then falls gradually to 11.0v at 2013-01-17 01am
                  EST. At that point it seems to fall faster, down to
                  the last report (just 10 hours later)  6.7v at
                  2013-01-17 11am EST.</div>
                <div><br>
                </div>
                <div>My original thought to handle this was to have two
                  thresholds.</div>
                <div><br>
                </div>
                <div>At the first threshold, the PIC would turn off the
                  modem and re-awake only once every 12 hours, for 2
                  minutes, before going back to sleep.</div>
                <div><br>
                </div>
                <div>At the second threshold, the PIC would turn off the
                  modem, and go to a deep sleep itself. In this mode,
                  once power was restored it would reset itself.</div>
                <div><br>
                </div>
                <div>Exit from either mode would be the 12v power line
                  going back above the first threshold plus some safety
                  margin.</div>
                <div><br>
                </div>
                <div>This weekend, I'll get some exact power
                  measurements from the v2 hardware module, so we know
                  what we are dealing with:</div>
                <div><br>
                </div>
                <div>
                  <ul class="MailOutline">
                    <li>Just the PIC (modem powered down)</li>
                    <li>PIC + MODEM</li>
                    <li>PIC + MODEM + GPS</li>
                  </ul>
                </div>
                <div><br>
                </div>
                <div>Last time I tested this, on v1 hardware without
                  GPS, these were the figures for PIC + MODEM:</div>
                <div><br>
                </div>
                <div>
                  <ul class="MailOutline">
                    <li>Idle: 40mA @12V</li>
                    <li>Cellular Network Registration: 100mA @12V</li>
                    <li>Network activity: 80mA @12V</li>
                  </ul>
                </div>
                <div><br>
                </div>
                <div>Regards, Mark.</div>
                <div><br>
                  <div>
                    <div>On 18 Jan, 2013, at 10:47 PM, Michael Balzer
                      <<a moz-do-not-send="true" href="mailto:dexter@expeedo.de">dexter@expeedo.de</a>>

                      wrote:</div>
                    <br class="Apple-interchange-newline">
                    <blockquote type="cite">Mark, List,<br>
                      <br>
                      yesterday my Twizy was temporarily dead... because
                      of the OVMS power usage.<br>
                      <br>
                      I had not driven for 5 days. The Twizy has a very
                      small 12V battery with only 14 Ah capacity, and it
                      only gets charged while charging the Twizy and
                      while driving (from the main battery).<br>
                      <br>
                      The OVMS with GPS activated needs a constant
                      current of ~110 mA according to my measurement,
                      thus sucking that battery empty within 4-5 days,
                      maybe fewer. I'll make the power warning much more
                      prominent in the Twizy user guide.<br>
                      <br>
                      Have there been any considerations yet about using
                      the sleep mode of the PIC and/or SIM chipset?<br>
                      <br>
                      Regards,<br>
                      Michael<br>
                      <br>
                      -- <br>
                      Michael Balzer * Paradestr. 8 * D-42107 Wuppertal<br>
                      Fon 0202 / 272 2201 * Handy 0176 / 206 989 26<br>
                      <br>
                      <span><dexter.vcf></span>_______________________________________________<br>
                      OvmsDev mailing list<br>
                      <a moz-do-not-send="true" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br>
                      <a moz-do-not-send="true" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
OvmsDev mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a class="moz-txt-link-freetext" href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
</pre>
  </div>

<span><dexter.vcf></span>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br>http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br></blockquote></div><br></div></body></html>