<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
<div>Hi, </div><div>I am working on the Think City EV code and have some questions.</div><div>- what is the best way to signal that the charging connector is plugged? ms_v_charge_pilot?</div><div>previously it was cardoorbits1. </div><div><br></div><div>- what is the best way to compare OvmsMetricStrings? Or should I dublicate the state in an enum and use that?</div><div><br></div><div>- what is the best way to compare the OvmsMetricFloat to a literal float?</div><div><br></div><div>- what is the current way of doing <span>net_req_notification</span></div><div><br></div><div>Thanks in advance,</div><div>Nikolay</div>
</div></div><div id="yahoo_quoted_1950539485" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Tuesday, July 17, 2018, 3:37:49 AM GMT+2, Mark Webb-Johnson <mark@webb-johnson.net> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">Jacob,<br clear="none"><br clear="none">> Is there a reason why OVMS bundles three different SSL libraries?<br clear="none"><br clear="none"><br clear="none">I think wolfSSL is there (but WOLFCRYPT_ONLY) because wolfSSH needs it.<br clear="none"><br clear="none">The ESP-IDF offers mbedtls and openssl libraries, but we don’t currently use either.<br clear="none"><br clear="none">> Also why is there a custom HTTP implementation when mongoose already has one?<br clear="none"><br clear="none"><br clear="none">Primarily because we wrote those before we included mongoose into the project. But also because the mongoose http_client code sucks. It reads the entire message body into RAM, before passing it on to the client; that just won’t work for something like a firmware image.<br clear="none"><br clear="none">To complicate the choice further, ESP now includes a esp_http_client in their latest 3.x IDF (which wasn’t there before).<br clear="none"><br clear="none">I did try to convert our TCP and HTTP client libraries to mongoose a while ago, but failed. Those libraries are blocking (with i/o done in the context of the thread calling them), but the mongoose library is event-based non-blocking (with i/o output in the context of the calling thread, and i/o input in the context of the mongoose thread). Mongoose didn’t use to be thread safe, and that caused us all sorts of issues (now solved, by the work Michael and others did to make it thread safe).<br clear="none"><br clear="none">> IMO the best way would be to rewrite ovms_net and<br clear="none">> ovms_http to use mongoose and configure mongoose to compile with SSL<br clear="none">> support (probably mbedtls as the other two don't work).<br clear="none"><br clear="none">I agree. In general, I prefer the mongoose approach, and we are trying to standardise on that (for good or bad).<br clear="none"><br clear="none">Probably the best would be to fix the http client in mongoose to work properly (or at least have an option to deliver the body block by block as they arrive), then convert our stuff that uses ovms tcp/http libraries, then drop the tcp and http libraries. Not trivial given the different models (blocking vs non-blocking events).<br clear="none"><br clear="none">Between openssl vs mbedtls, I don’t really care. I think we’re going to have to manage certificate loading ourselves anyway (as we need to load from a combination of statically defined (in flash using COMPONENT_EMBED_TXTFILES and asm(“_binary_* start/end) and dynamic (in /store/tls/trustedca/* or somewhere like that).<br clear="none"><br clear="none">Regards, Mark.<br clear="none"><br clear="none">> On 17 Jul 2018, at 1:02 AM, Jakob Löw <<a shape="rect" ymailto="mailto:ovms@m4gnus.de" href="mailto:ovms@m4gnus.de">ovms@m4gnus.de</a>> wrote:<br clear="none">> <br clear="none">> Hey,<br clear="none">> <br clear="none">> I've been playing around a bit with implementing SSL/TLS support. For<br clear="none">> starters I wanted to implement an OvmsNetTlsConnection class which<br clear="none">> could then be used for https requests. At first I tried using wolfSSL<br clear="none">> but it turns out wolfSSL is compiled with WOLFCRYPT_ONLY. OpenSSL also<br clear="none">> didn't work as SSL_CTX_load_verify_locations is missing in ESP-IDF's<br clear="none">> OpenSSL. I didn't try mbedtls yet. Is there a reason why OVMS bundles<br clear="none">> three different SSL libraries? Also why is there a custom HTTP<br clear="none">> implementation when mongoose already has one? Speaking of mongoose, it<br clear="none">> seems to have an abstraction layer which allows to use one of the three<br clear="none">> SSL/TLS libraries. IMO the best way would be to rewrite ovms_net and<br clear="none">> ovms_http to use mongoose and configure mongoose to compile with SSL<br clear="none">> support (probably mbedtls as the other two don't work).<br clear="none">> <br clear="none">> - Jakob<br clear="none">> <br clear="none">> On Mon, 2018-07-16 at 12:47 +0800, Mark Webb-Johnson wrote:<br clear="none">>> Drupal authentication is done, and working against mosquitto now on<br clear="none">>> the live api.openvehicles.com site. Plain text MQTT only at the<br clear="none">>> moment (I still need to get mosquitto and OVMS module firmware<br clear="none">>> supporting SSL).<br clear="none">>> <br clear="none">>> To configure OVMS v3 to use Server V3 protocol:<br clear="none">>> <br clear="none">>> config set:<br clear="none">>> vehicle id <vehicleid><br clear="none">>> server.v3 server api.openvehicles.com<br clear="none">>> server.v3 port 1883<br clear="none">>> server.v3 user <openvehicles.com username><br clear="none">>> password server.v3 <openvehicles.com password><br clear="none">>> <br clear="none">>> server v3 start<br clear="none">>> <br clear="none">>> Can also 'config set auto server.v3 yes’ to auto-start at boot<br clear="none">>> <br clear="none">>> If you have an MQTT client, you can connect to the same server to<br clear="none">>> query the metrics, issue commands, etc. The default topic hierarchy<br clear="none">>> is ovms/<username>/<vehicleid>.<br clear="none">>> <br clear="none">>> I think we are close now. Just need SSL support. And then Apps…<br clear="none">>> <br clear="none">>> Feedback appreciated.<br clear="none">>> <br clear="none">>> Regards, Mark.<br clear="none">>> <br clear="none">>>> On 10 Jul 2018, at 2:42 PM, Mark Webb-Johnson <<a shape="rect" ymailto="mailto:mark@webb-johnson.ne" href="mailto:mark@webb-johnson.ne">mark@webb-johnson.ne</a><br clear="none">>>> t> wrote:<br clear="none">>>> <br clear="none">>>> I’ve just pushed the support for notifications in OVMS Server v3.<br clear="none">>>> <br clear="none">>>> With that, the server v3 is functionally complete (at least on the<br clear="none">>>> car side). We can:<br clear="none">>>> <br clear="none">>>> Connect/disconnect<br clear="none">>>> Handle lists of apps connecting/disconnecting<br clear="none">>>> Send metrics<br clear="none">>>> Send events<br clear="none">>>> Send notifications (including info, error, alert, and historical<br clear="none">>>> data)<br clear="none">>>> Receive commands, run them, and return the results<br clear="none">>>> <br clear="none">>>> I’m still struggling against drupal authentication at the server<br clear="none">>>> side; once that is done we can open this up to wider testing.<br clear="none">>>> <br clear="none">>>> Overall, I’m pretty happy with it. We need SSL/TLS support, but at<br clear="none">>>> least functionally now it works and is complete.<br clear="none">>>> <br clear="none">>>> Regards, Mark<br clear="none">>>> <br clear="none">>>>> On 6 Jul 2018, at 4:16 PM, Mark Webb-Johnson <<a shape="rect" ymailto="mailto:mark@webb-johnson.n" href="mailto:mark@webb-johnson.n">mark@webb-johnson.n</a><br clear="none">>>>> et> wrote:<br clear="none">>>>> <br clear="none">>>>>>>> I suppose the following topic names:<br clear="none">>>>>>>> metrics: <prefix>/metric/#<br clear="none">>>>>>>> events: <prefix>/event/#<br clear="none">>>>>>>> notifications: <prefix>/notify/#<br clear="none">>>>>>>> config: <prefix>/config/#<br clear="none">>>>>>>> logs: <prefix>/log/<tag><br clear="none">>>>>>>> active: <prefix>/client/<clientid>/active<br clear="none">>>>>>>> requests: <prefix>/client/<clientid>/request/#<br clear="none">>>>>>>> commands: <prefix>/client/<clientid>/command/<command<br clear="none">>>>>>>> id><br clear="none">>>>>>>> cmd responses: <prefix>/client/<clientid>/response/<command<br clear="none">>>>>>>> id><br clear="none">>>>>>> <br clear="none">>>>>>> All ok. I am fine with this, and looks clean. I will make the<br clear="none">>>>>>> changes today, as I want to get this into some cars asap so<br clear="none">>>>>>> we can get a feel for how it behaves.<br clear="none">>>>> <br clear="none">>>>> Ok. Now implemented, and tested:<br clear="none">>>>> <br clear="none">>>>> <prefix>/metric/#<br clear="none">>>>> <prefix>/client/<clientid>/active<br clear="none">>>>> <prefix>/client/<clientid>/command/<command id><br clear="none">>>>> <prefix>/client/<clientid>/response/<command id><br clear="none">>>>> <br clear="none">>>>> I don’t think config, logs, and requests are critical or urgent.<br clear="none">>>>> So, I will try to finish events tonight (as that is relatively<br clear="none">>>>> simple). Notifications over the weekend (more tricky, especially<br clear="none">>>>> for historical data). It can go in my car with tonight’s nightly<br clear="none">>>>> ota, for real world testing.<br clear="none">>>>> <br clear="none">>>>> I’m still trying to get the authentication working for drupal vs<br clear="none">>>>> mosquitto. Once that is done, I can open up<br clear="none">>>>> api.openvehicles.com MQTT for public use. If I can’t get it done<br clear="none">>>>> within the next couple of days, I’ll try another broker (lua<br clear="none">>>>> scripting, anyone?).<br clear="none">>>>> <br clear="none">>>>> P.S. Commands over MQTT are pretty cool:<br clear="none">>>>> <br clear="none">>>>> <PastedGraphic-2.tiff><br clear="none">>>>> <PastedGraphic-3.tiff><br clear="none">>>>> <br clear="none">>>>> Regards, Mark.<br clear="none">>>>> _______________________________________________<br clear="none">>>>> OvmsDev mailing list<br clear="none">>>>> <a shape="rect" ymailto="mailto:OvmsDev@lists.openvehicles.com" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a><br clear="none">>>>> <a shape="rect" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><div class="yqt4699584052" id="yqtfd16403"><br clear="none">>>> <br clear="none">>>> _______________________________________________<br clear="none">>>> OvmsDev mailing list<br clear="none">>>> <a shape="rect" ymailto="mailto:OvmsDev@lists.openvehicles.com" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a><br clear="none">>>> <a shape="rect" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br clear="none">>> <br clear="none">>> _______________________________________________<br clear="none">>> OvmsDev mailing list<br clear="none">>> <a shape="rect" ymailto="mailto:OvmsDev@lists.openvehicles.com" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a><br clear="none">>> <a shape="rect" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br clear="none">> _______________________________________________<br clear="none">> OvmsDev mailing list<br clear="none">> <a shape="rect" ymailto="mailto:OvmsDev@lists.openvehicles.com" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a><br clear="none">> <a shape="rect" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br clear="none"><br clear="none">_______________________________________________<br clear="none">OvmsDev mailing list<br clear="none"><a shape="rect" ymailto="mailto:OvmsDev@lists.openvehicles.com" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a><br clear="none"><a shape="rect" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br clear="none"></div></div></div>
</div>
</div></div></body></html>