<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Tom,<div><br></div><div>Sorry, wrong port. Try 6868 for HTTP and 6869 for HTTPS.</div><div><br></div><div>This should now work on both tmc and www sites.</div><div><br></div><div>Regards, Mark.</div><div><br><div><div>On 15 Jun, 2014, at 1:50 am, Tom Saxton <<a href="mailto:tom@idleloop.com">tom@idleloop.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;"><div>Mark,</div><div><br></div><div>I just tried connecting via HTTPS and got this:</div><div><br></div><div><div>tom$ curl -s -X GET -c ~/Downloads/ovms-cookie -v "<a href="https://tmc.openvehicles.com:6969/api/cookie?username=USER&password=PASS">https://tmc.openvehicles.com:6969/api/cookie?username=USER&password=PASS</a>"</div><div>* Adding handle: conn: 0x7fd343804000</div><div>* Adding handle: send: 0</div><div>* Adding handle: recv: 0</div><div>* Curl_addHandleToPipeline: length: 1</div><div>* - Conn 0 (0x7fd343804000) send_pipe: 1, recv_pipe: 0</div><div>* About to connect() to <a href="http://tmc.openvehicles.com">tmc.openvehicles.com</a> port 6969 (#0)</div><div>*   Trying 64.111.70.40...</div><div>* Failed connect to <a href="http://tmc.openvehicles.com">tmc.openvehicles.com</a>:6969; Connection refused</div><div>* Closing connection 0</div></div><div><br></div><div>The same thing works as expected using <a href="http://tmc.openvehicles.com:6868/">http://tmc.openvehicles.com:6868/</a></div><div><br></div><div>Am I doing something wrong?</div><div><br></div><div>   Tom</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div>On 6/12/14, 10:23 PM, "Mark Webb-Johnson" <<a href="mailto:mark@webb-johnson.net">mark@webb-johnson.net</a>> wrote:</div><div><br></div><div><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Tom,<div><br></div><div>The code does support HTTPS (port 6969). I've just been too lazy to get a cert for <a href="http://tmc.openvehicles.com/">tmc.openvehicles.com</a>. I'll handle that.</div><div><br></div><div>Regards, Mark.</div><div><br></div><div style=""><div>On 13 Jun, 2014, at 12:35 am, Tom Saxton <<a href="mailto:tom@idleloop.com">tom@idleloop.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif;"><div>I agree that moving to OATH for the HTTP protocol would be great, but we could make a huge improvement in security by simply switching to using HTTPS on <a href="http://tmc.openvehicles.com/">tmc.openvehicles.com</a>. I just did that for a site I built and administer, it was easy and inexpensive, $50 per year. For my PHP site, it was all just server config stuff and totally invisible to the code.</div><div><br></div><div>Two small improvements I'd be happy to work on when Mark is done with his work:</div><div><br></div><div>1. Use POST instead of GET to log in so URLs with usernames and passwords don't get stored in local and server logs.</div><div><br></div><div>2. Add a timestamp parameter to the methods that retrieve charge, drive, and server logs to only retrieve records with that timestamp or larger. In order to retrieve new records, I have to download all records, which means 130K of transfer when I really only need a tiny fraction of that.</div><div><br></div><div>   Tom</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div>On 6/11/14, 10:19 PM, "Mark Webb-Johnson" <<a href="mailto:mark@webb-johnson.net">mark@webb-johnson.net</a>> wrote:</div><div><br></div><div><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Chris, Lee,<div><br></div><div>Here's an overview:</div><div><br></div><div><ol class="MailOutline"><li>The 'raw' protocol is a binary protocol car<->server and server<->apps. The same protocol is used for both, with the server primarily being a relay with store-and-forward capabilities.  The protocol itself is binary, but the data transmitted looks more like CSV records.<br><br></li><li>The current vehicle module uses the raw protocol to talk to the server.<br><br></li><li>The current iOS and Android apps use the raw protocol to talk to the server.<br><br></li><li>The raw protocol uses a vehicleid+serverpassword authentication scheme, where the serverpassword is a shared secret between the vehicle, server and apps, and is used for both authentication and encryption. The raw protocol also supports a 'paranoid mode' where a second modulepassword is used in the apps and vehicle module to double-encrypt the data so that even the server cannot decode it.<br><br></li><li>There is an experimental HTTP protocol (API) that runs on the server and is used to read the vehicle data and communicate with the vehicle. We want to use this as the basis for future apps. With this api, the data returned is in JSON format and is structured as human/machine readable (for example 'SOC', rather than 1st field in the 'D' message).<br><br></li><li>The HTTP API currently uses OVMS username+password for authentication, and returns an authentication cookie. That is fine for experimental use, but suffers when trying to get third parties involved (as the user would need to give their OVMS username + password to the third party for storage). We would like to migrate that to an OAUTH style scheme.<br><br></li><li>It seems sensible to use a variant/extension of the HTTP API for this work on charge event distribution.</li></ol></div><div><br></div><div>The OVMS <a href="http://www.openvehicles.com/">www.openvehicles.com</a> site is in PHP (Drupal) and the OVMS server itself is in perl (AnyEvent and AnyEvent::HTTP based).</div><div><br></div><div>My issue is (a) time, and (b) lack of experience with OAUTH. We would presumably need an OAUTH server (either within the OVMS server or hosted by <a href="http://www.openvehicles.com/">www.openvehicles.com</a>), and an OAUTH capability within the HTTP API on the OVMS server. Quite frankly, I am not sure where to start with this. I've read the background documents, and have an understanding of what is required, but it is very hard to find implementation examples that make sense for what we are doing, in Drupal/PHP or Perl.</div><div><br></div><div>Regards, Mark.</div><div><br><div><div>On 12 Jun, 2014, at 12:58 pm, Christopher Cook <<a href="mailto:christopher.cook@webprofusion.com">christopher.cook@webprofusion.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Yes, sounds like it to me. So the OVMS web side needs help implementing OAUTH so that other app/services can make authenticated requests to the server over HTTP.<br><br>I believe from my quick glance over it that the main server protocol is currently binary encrypted comms over UDP which is generally both harder to parse, impossible to use from a browser client (no UDP) and presumably more difficult to extend for operations unrelated to streaming car state.<br><br>I assume the http API is php? Not really my bag but I'm sure there are plenty of oauth modules/libraries for you to choose from. Assuming you need OAuth 1. OAuth 2 always requires presenting the user with an authentication page which isn't ideal for server side stuff.<br><br>Chris<br><br>Lee Howard <<a href="mailto:lee.howard@mainpine.com">lee.howard@mainpine.com</a>> wrote:<br><br><blockquote type="cite">If I understand correctly, the GPS data is sent from the module in the <br>car encrypted through the server to the handheld app.  (Correct?)  Or <br>maybe that was outdated information that I read (README files in the <br>code).  Hence, I do not understand how OCM would reliably "pull" data <br>from either the module or the app.  A "push" from module to OCM seems <br>burdensome and inappropriate.<br><br>So, if the GPS data is encrypted all the way from the module to the app, <br>then I can really only sensibly imagine the app pushing data to OCM.<br><br>I must have misunderstood or read outdated information in the READMEs... <br>because it seems much more-sensible for OCM to be communicating with the <br>OVMS server... whether it be a push or a pull.  But... if the data is <br>encrypted passing through the server... then that's out of the question.<br><br>And, I presume, then, *that* is where you are looking for help: <br>implementing the authentication model on the OVMS server. (?)<br><br>Thanks,<br><br>Lee.<br><br><br>On 06/11/2014 05:25 PM, Mark Webb-Johnson wrote:<br><blockquote type="cite">Where I'm really looking for help is the authentication model for the HTTP API. What we have now is kludgy, and it would be good to support OAUTH.<br><br>Regards, Mark.<br><br>On 11 Jun, 2014, at 5:25 am, Lee Howard <<a href="mailto:lee.howard@mainpine.com">lee.howard@mainpine.com</a>> wrote:<br><br><blockquote type="cite">Mark,<br><br>Has there been any work done in regards to submitting charging data out to OCM? I'm ready to start tinkering on this, and if some work is already being done then I want to attempt to do so collaboratively.<br><br>Thanks,<br><br>Lee.<br><br><br>On 05/23/2014 01:19 AM, Mark Webb-Johnson wrote:<br><blockquote type="cite">So, given that we will be ‘giving away’ the data, it comes to the ‘black box’ question of how to do that. My own personal preference is just to provide an api to either PUSH or PULL the data, and the reason for that is I don’t want to be extending the server code to support ten different third-party APIs. That said, I did suggest a PUSH option in the original RFQ, and the thinking behind that is we can format a URL+formdata with parameter-substitution (based on server.conf settings for a particular provider - no code) and just fire it off. I see no problem with a single API key for OVMS to submit to such an external service. For ‘user credit’, it would be nice to have an option where the user could enter an optional username+pin for each service, and we can provide it as part of the PUSHed/PULLed data.<br></blockquote></blockquote></blockquote><br>-- <br>*Lee Howard*<br>*Mainpine, Inc. Chief Technology Officer*<br>Tel: +1 866 363 6680 | Fax: +1 360 462 8160<br><a href="mailto:lee.howard@mainpine.com">lee.howard@mainpine.com</a> | <a href="http://www.mainpine.com/">www.mainpine.com</a><br>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br><a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br></blockquote>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br><a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br></blockquote></div><br></div></div></div>_______________________________________________
OvmsDev mailing list
<a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a></span></div>
_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br><a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br></blockquote></div><br></div></div>_______________________________________________
OvmsDev mailing list
<a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a>
<a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a>
</span></div>
_______________________________________________<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>