<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <p>Hi again,</p>
    <p>Before I decide how to do this I would like to explore the other
      way: My home automation is polling the data from OVMS.</p>
    <p>I have had a look to the HTTP API. But it seems this is an API
      for the server on the internet and not for OVMS itself, correct?</p>
    <p>Next option: My home automation does a simple HTTP-GET to OVMS
      and reads data like this.<br>
      Is there a way to read metrics like this?<br>
      I have found the config->webserver site. I could point it to an
      own dir like /store/data. Now I could write/update one file there
      from my vehicle-module called "current" with all the data I need.
      Then simply to a http-get to 192.168.4.1/current and I get the
      data of the file. Is it easy - and most important: allowed - to
      write/update into a file in OVMS.</p>
    <p>thanks heaps for the input</p>
    <p>Soko<br>
    </p>
    <div class="moz-cite-prefix">On 24.08.2020 01:46, Mark Webb-Johnson
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:9D3C90E6-942D-4E41-BEE5-0E37579AA08F@webb-johnson.net">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      The vehicle module is definitely the wrong place to do this.
      <div class=""><br class="">
      </div>
      <div class="">If you really want to implement in C++, I suggest
        you look at the ovms_server_v3 module. You could use that as a
        template for what you need. It should periodically read from the
        metrics, and send what you need to your home automation.</div>
      <div class=""><br class="">
      </div>
      <div class="">You should also consider a javascript plugin to do
        this. That would probably be simpler and easier to update
        (without firmware changes). If it is a common home automation
        system, you could write it as a plugin and share for others with
        the same system.</div>
      <div class=""><br class="">
      </div>
      <div class="">Regards, Mark<br class="">
        <div><br class="">
          <blockquote type="cite" class="">
            <div class="">On 24 Aug 2020, at 12:00 AM, Soko <<a
                href="mailto:ovms@soko.cc" class=""
                moz-do-not-send="true">ovms@soko.cc</a>> wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <div class="">Hi Mark,<br class="">
                <br class="">
                I have my own home automation running at home. I want to
                push the current values (SoC, odometer, ...) once my car
                is in the driveway and OVMS is booked into my WiFi. My
                home automation has a TCP server running were I process
                the data further. <br class="">
                <br class="">
                I don't want to the OVMS Server functionality as I'm not
                a Linux guy, don't want the data in the internet and no
                SIM use on the OVMS. <br class="">
                <br class="">
                So does the canlog_tcpclient.cpp take care of the
                concurrency etc. correctly? I will do the same in my
                code. Or should I start a separate task from the vehicle
                task for every push?<br class="">
                <br class="">
                thx<br class="">
                Soko<br class="">
                <br class="">
                <div class="gmail_quote">On 23 August 2020 16:37:46
                  CEST, Mark Webb-Johnson <<a
                    href="mailto:mark@webb-johnson.net" class=""
                    moz-do-not-send="true">mark@webb-johnson.net</a>>
                  wrote:
                  <blockquote class="gmail_quote" style="margin: 0pt 0pt
                    0pt 0.8ex; border-left: 1px solid rgb(204, 204,
                    204); padding-left: 1ex;">
                    <pre class="k9mail">What are you trying to do?

>From a design point of view, it seems strange to have an outgoing tcp connection from a vehicle module. Those modules need to be very responsive and realtime.

Mongoose is the correct approach. But take care, because most of the work is done in the network (not vehicle) task, so you need to deal with mutex and other concurrency issues.

Regards, Mark

<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">On 23 Aug 2020, at 7:54 PM, Soko <<a href="mailto:ovms@soko.cc" class="" moz-do-not-send="true">ovms@soko.cc</a>> wrote:

Hey everyone,

I'm trying to send a simple tcp msg to a remote tcp-server. I've looked into the FreeRTOS example (esp-idf\examples\protocols\sockets\tcp_client\) which works (kinda) but OVMS behaves weirdly when I do it like that.

Thomas pointed me to mongoose...

So is this the way to go? I would take canlog_tcpclient.cpp as a model...

Ohh... and is it OK if I send my tcp msg in the vehcile task? Mongoose should take care of unforeseen errors so the task shouldn't block, right?

thx

Soko<hr class="">OvmsDev mailing list
<a href="mailto:OvmsDev@lists.openvehicles.com" class="" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" class="" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</blockquote><hr class="">OvmsDev mailing list
<a href="mailto:OvmsDev@lists.openvehicles.com" class="" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" class="" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
                  </blockquote>
                </div>
              </div>
              _______________________________________________<br
                class="">
              OvmsDev mailing list<br class="">
              <a href="mailto:OvmsDev@lists.openvehicles.com" class=""
                moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a><br
                class="">
              <a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br
                class="">
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
      <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>
  </body>
</html>