<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    FYI:<br>
    <br>
    The V2 REST/JSON API on my server is now also available with SSL.
    The SSL server is on port 6869, so API calls will be…<br>
    <br>
    <tt><a class="moz-txt-link-freetext" href="https://ovms.dexters-web.de:6869/api/cookie?username=…&password=…">https://ovms.dexters-web.de:6869/api/cookie?username=…&password=…</a><br>
      <a class="moz-txt-link-freetext" href="https://ovms.dexters-web.de:6869/api/vehicles">https://ovms.dexters-web.de:6869/api/vehicles</a><br>
      …etc.<br>
    </tt><br>
    I've also changed this on the simpleclient API test page
    (<a class="moz-txt-link-freetext" href="https://ovms.dexters-web.de/f/simpleclient.htm">https://ovms.dexters-web.de/f/simpleclient.htm</a>).<br>
    <br>
    The encryption uses my standard web server certificate generated by
    Let's encrypt.<br>
    <br>
    If you'd like to do this for your personal V2 server, all you need
    to do is cat the privkey.pem + fullchain.pem into a file
    "ovms_server.pem" located in the ovms_server.pl working directory
    (and restart the daemon).<br>
    <br>
    As "ovms_server.pem" contains the private key, you should make it
    owned & readable only by the daemon user. Put all of that into a
    script and automate renewals via cron.<br>
    <br>
    <tt>#!/bin/bash</tt><tt><br>
    </tt><tt><br>
    </tt><tt># ovms_server.pl needs a combined PEM file with privkey +
      fullchain,</tt><tt><br>
    </tt><tt># readable only by the user:</tt><tt><br>
    </tt><tt><br>
    </tt><tt>PKEY=/etc/letsencrypt/live/dexters-web.de/privkey.pem</tt><tt><br>
    </tt><tt>CERT=/etc/letsencrypt/live/dexters-web.de/fullchain.pem</tt><tt><br>
    </tt><tt><br>
    </tt><tt>USER=sddexter</tt><tt><br>
    </tt><tt>PEM=/sd/sddexter/files/server/ovms_server.pem</tt><tt><br>
    </tt><tt><br>
    </tt><tt>if [[ $UID -ne 0 ]] ; then</tt><tt><br>
    </tt><tt>  echo "$0 needs to be run as root"</tt><tt><br>
    </tt><tt>  exit 1</tt><tt><br>
    </tt><tt>fi</tt><tt><br>
    </tt><tt><br>
    </tt><tt>if [[ $CERT -nt $PEM ]] ; then</tt><tt><br>
    </tt><tt>  echo "OVMS SSL certificate renewal detected,
      installing..."</tt><tt><br>
    </tt><tt>  cat $PKEY $CERT >$PEM</tt><tt><br>
    </tt><tt>  chmod 0600 $PEM</tt><tt><br>
    </tt><tt>  chown $USER. $PEM</tt><tt><br>
    </tt><tt>  service ovms restart</tt><tt><br>
    </tt><tt>fi</tt><tt><br>
    </tt><br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 13.07.18 um 10:33 schrieb Michael
      Balzer:<br>
    </div>
    <blockquote type="cite"
      cite="mid:91a250d2-66df-d2e0-8fdd-41fd2a9aee5f@expeedo.de">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      Hi Tim,<br>
      <br>
      my server offers the standard OVMS server APIs…<br>
      <ul>
        <li>TCP:
          <a class="moz-txt-link-freetext"
href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System/raw/master/docs/OVMS-Protocol.pdf"
            moz-do-not-send="true">https://github.com/openvehicles/Open-Vehicle-Monitoring-System/raw/master/docs/OVMS-Protocol.pdf</a></li>
        <li>REST/JSON: <a class="moz-txt-link-freetext"
href="http://lists.openvehicles.com/pipermail/ovmsdev/2013-October/001667.html"
            moz-do-not-send="true">http://lists.openvehicles.com/pipermail/ovmsdev/2013-October/001667.html</a></li>
        <ul>
          <li>Test: <a class="moz-txt-link-freetext"
              href="http://ovms.dexters-web.de/f/simpleclient.htm"
              moz-do-not-send="true">http://ovms.dexters-web.de/f/simpleclient.htm</a></li>
          <li>Note: no SSL support<br>
          </li>
        </ul>
      </ul>
      …plus an additional stateless REST API on http/https:<br>
      <ul>
        <li>Text command: <br>
          <pre style="padding: 8.5px; font-family: Monaco, Menlo, Consolas, "QuickType Mono", "Lucida Console", "Roboto Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Droid Sans Mono", monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; display: block; margin: 0px 0px 9px; line-height: 18px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.15); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><a class="moz-txt-link-freetext" href="https://dexters-web.de/api/call?fn.name=ovms/cmd&fn.vehicleid=…&fn.carpass=…&fn.cmd=…" moz-do-not-send="true">https://dexters-web.de/api/call?fn.name=ovms/cmd&fn.vehicleid=…&fn.carpass=…&fn.cmd=…</a></pre>
        </li>
      </ul>
      <ul>
        <li>CSV data export:
          <pre style="padding: 8.5px; font-family: Monaco, Menlo, Consolas, "QuickType Mono", "Lucida Console", "Roboto Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Droid Sans Mono", monospace; font-size: 12px; color: rgb(51, 51, 51); border-radius: 4px; display: block; margin: 0px 0px 9px; line-height: 18px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.15); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><a class="moz-txt-link-freetext" href="https://dexters-web.de/api/call?fn.name=ovms/export&fn.vehicleid=…&fn.carpass=…" moz-do-not-send="true">https://dexters-web.de/api/call?fn.name=ovms/export&fn.vehicleid=…&fn.carpass=…</a>

Optional parameters:
- fn.format: "csv" (=inline) / "zip" (default)
- fn.types: string, data types to download; comma separated list or SQL LIKE pattern
- fn.since: ISO format timestamp, filter newer records
- fn.last: integer, output last n records

Example:
<a class="moz-txt-link-freetext" href="https://dexters-web.de/api/call?fn.name=ovms/export&fn.vehicleid=…&fn.carpass=…&fn.format=csv&fn.types=D,S&fn.last=3" moz-do-not-send="true">https://dexters-web.de/api/call?fn.name=ovms/export&fn.vehicleid=…&fn.carpass=…&fn.format=csv&fn.types=D,S&fn.last=3</a></pre>
        </li>
      </ul>
      <br>
      Regards,<br>
      Michael<br>
      <br>
      <br>
      <div class="moz-cite-prefix">Am 13.07.2018 um 08:12 schrieb Tim
        Jackson:<br>
      </div>
      <blockquote type="cite"
        cite="mid:BB85C7A0-D437-48F4-8CF5-6F2C9017FA6E@gmail.com">
        <meta http-equiv="Content-Type" content="text/html;
          charset=windows-1252">
        Hi there all,
        <div class=""><br class="">
        </div>
        <div class="">I have 2 of the latest units, and I am running a
          Nissan Leaf and e-NV200..</div>
        <div class=""><br class="">
        </div>
        <div class="">I have 2 questions</div>
        <div class=""><br class="">
        </div>
        <div class="">1. Is there an API for <a
            href="http://dexter-web.de" class="" moz-do-not-send="true">dexter-web.de</a> site?</div>
        <div class="">2. Is there any updated documentation on the
          current API on TMC?</div>
        <div class=""><br class="">
        </div>
        <div class="">Thanks</div>
        <div class=""><br class="">
        </div>
        <div class="">Tim</div>
        <!--'"--><br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="160">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
</pre>
  </body>
</html>