Re: [Ovmsdev] Twizy 45 and ovms firmware
Ok Michael thank you for your answer. I've registered at the forum (waiting for admin approval) even if the forum is german language and I don't understand any german word but Warum ist die banane krumm? :-) Ok for ods (at least I'll do some reading when my ovms box will arrive....). For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that) About the lack of app specific twizy features I do not know the app very well (as user) and I will check it asap. I did a brief tour and I had the feeling the app is a little bit "rough". I can support the dev team for the vehicle specific part (if needed) and/or the android version of the app (don't know if drupal modules/extension will be affected by app customising for twizy due to MIM model for the server). As stated in my first message, here in Italy M2M sim card are not common and data plans are provided for business only (at reasonable price, otherwise you have to buy full featured sim at higher prices). If some sort of "extension modules" can be provided to ovms by means of expansion pins maybe a short range wireless module (i.e. bluetooth) would be great for pairing with phones to use its data plan. Don't know if ovms architecture can allow this or a V3 is needed, but is outo f scope of the thread... :-) Il giorno 04/giu/2014, alle ore 06:00, Michael Balzer ha scritto:
Date: Tue, 03 Jun 2014 11:09:42 +0200 From: Michael Balzer <dexter@expeedo.de> Subject: Re: [Ovmsdev] Twizy 45 and ovms firmware To: ovmsdev@lists.teslaclub.hk Message-ID: <538D90D6.1040607@expeedo.de> Content-Type: text/plain; charset="iso-8859-15"; Format="flowed"
Gianluca,
welcome :-)
Branch "master" is the current main branch, if there is a beta version available in another branch, there will be a note on this list.
You don't need to rebuild yourself, I provide flashable releases in the german Twizy forum: http://www.vectrix-forum.de/index.php?option=com_kunena&Itemid=72&func=view&...
The Twizy 45 default settings have been provided by another german forum member, so I cannot check them myself. The values for T80 are definitely correct. The T45 TSMAP brake/neutral rpm values seem to be right, as the T45 has a higher gear ratio. I thought the drive rpms could be wrong, but as the drive map is normally flat 100% that normally has no effect so could have slipped through at Renault/SEVCON.
There is no formal roadmap, and my firmware todo list only contains nice2haves, most of them maybe not implementable. I'll write an extract later on.
What's lacking most from my point of view is Twizy specific support on the App. The remaining firmware ROM space will probably also be needed to implement the necessary CFG commands for the App.
Regards, Michael
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is. If other Twizy drivers would like to add their ideas, you're welcome. I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback. Regards, Michael -- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
Hi Michael, I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server? Have you uploaded the code somewhere? I have been playing around with C# client and was thinking of using it on an asp.net server... Nikolay On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote: Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is. If other Twizy drivers would like to add their ideas, you're welcome. I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback. Regards, Michael -- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Nikolay, that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server. A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client. The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell. Try yourself, I've attached it. Regards, Michael Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
Thanks Michael, I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> wrote: Nikolay, that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server. A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client. The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell. Try yourself, I've attached it. Regards, Michael Am 05.06.2014 11:26, schrieb Nikolay Shishkov: Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I
have my personal
list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Nikolay, you found an API server bug :-) Solution: delete all domain cookies for "openvehicles.com" from your browser before using the API. The API server gets confused by multiple cookies. If you visit www.openvehicles.com before using the API, you get a persistent PHP session cookie like this: Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com Pfad / As the host defines ".openvehicles.com" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e. Name ovmsapisession Host tmc.openvehicles.com Pfad /api/ Regards, Michael Am 05.06.2014 23:46, schrieb Nikolay Shishkov:
Thanks Michael, I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> <mailto:dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
Bug squished. Live on tmc now (and pushed to github). Neat web page. Shows promise. Regarding the CORS, I’m very willing to make the changes - just not really sure what headers exactly need to be added. Anyone here know what I would need to add? Regards, Mark. On 6 Jun, 2014, at 3:03 pm, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
you found an API server bug :-)
Solution: delete all domain cookies for "openvehicles.com" from your browser before using the API.
The API server gets confused by multiple cookies. If you visit www.openvehicles.com before using the API, you get a persistent PHP session cookie like this:
Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com Pfad /
As the host defines ".openvehicles.com" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e.
Name ovmsapisession Host tmc.openvehicles.com Pfad /api/
Regards, Michael
Am 05.06.2014 23:46, schrieb Nikolay Shishkov:
Thanks Michael, I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
I believe the following two headers should do it: Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true But needs to be tested. On Friday, June 6, 2014 2:31 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote: Bug squished. Live on tmc now (and pushed to github). Neat web page. Shows promise. Regarding the CORS, I’m very willing to make the changes - just not really sure what headers exactly need to be added. Anyone here know what I would need to add? Regards, Mark. On 6 Jun, 2014, at 3:03 pm, Michael Balzer <dexter@expeedo.de> wrote: Nikolay, you found an API server bug :-) Solution: delete all domain cookies for "openvehicles.com" from your browser before using the API. The API server gets confused by multiple cookies. If you visit www.openvehicles.com before using the API, you get a persistent PHP session cookie like this: Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com Pfad / As the host defines ".openvehicles.com" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e. Name ovmsapisession Host tmc.openvehicles.com Pfad /api/ Regards, Michael Am 05.06.2014 23:46, schrieb Nikolay Shishkov: Thanks Michael,
I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait
for your list (I have my personal
list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Hi Michael, I think what you have done with the html page is crying for the CORS and an angularjs, single page app. Here is an open source project with such app that could "easily" be modified to do the work. Check out a working sample here: http://angular-client-side-auth.herokuapp.com/login/ Nikolay On Saturday, June 7, 2014 12:42 AM, Nikolay Shishkov <nshishkov@yahoo.com> wrote: I believe the following two headers should do it: Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true But needs to be tested. On Friday, June 6, 2014 2:31 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote: Bug squished. Live on tmc now (and pushed to github). Neat web page. Shows promise. Regarding the CORS, I’m very willing to make the changes - just not really sure what headers exactly need to be added. Anyone here know what I would need to add? Regards, Mark. On 6 Jun, 2014, at 3:03 pm, Michael Balzer <dexter@expeedo.de> wrote: Nikolay, you found an API server bug :-) Solution: delete all domain cookies for "openvehicles.com" from your browser before using the API. The API server gets confused by multiple cookies. If you visit www.openvehicles.com before using the API, you get a persistent PHP session cookie like this: Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com Pfad / As the host defines ".openvehicles.com" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e. Name ovmsapisession Host tmc.openvehicles.com Pfad /api/ Regards, Michael Am 05.06.2014 23:46, schrieb Nikolay Shishkov: Thanks Michael,
I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait
for your list (I have my personal
list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Nikolay, I don't need CORS for the auth, that's already working without. I would need CORS to automatically process the data. And I'd like to do it with minimal changes to the existing API server. My CORS research result was: maybe AnyEvent::HTTPD has some CORS support yet? If not, these are the headers: Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE" Access-Control-Allow-Origin "*$ORIGIN*" Access-Control-Allow-Credentials "true" Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type" ...static values except for the "ORIGIN" variable, which needs to echo back the "Origin:" header from the request. I'm not familiar with AnyEvent::HTTPD, maybe something like $req->header('Origin') There's a bit more to do: method OPTIONS also needs to be supported for "preflight requests" (access control negotiation), see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for detailed request/response examples. I suppose that will need a separate handler function, but one for the /api root should be sufficient. Btw, methods "PUT", "PATCH" + "DELETE" can be omitted I think. But if you'd like to build a Node.js based solution, go ahead, sounds cool :-) Regards, Michael Am 07.06.2014 23:37, schrieb Nikolay Shishkov:
Hi Michael,
I think what you have done with the html page is crying for the CORS and an angularjs, single page app. Here is an open source project with such app that could "easily" be modified to do the work. Check out a working sample here: http://angular-client-side-auth.herokuapp.com/login/
Nikolay
On Saturday, June 7, 2014 12:42 AM, Nikolay Shishkov <nshishkov@yahoo.com> wrote:
I believe the following two headers should do it: Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true
But needs to be tested.
On Friday, June 6, 2014 2:31 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote:
Bug squished. Live on tmc now (and pushed to github).
Neat web page. Shows promise.
Regarding the CORS, I'm very willing to make the changes - just not really sure what headers exactly need to be added. Anyone here know what I would need to add?
Regards, Mark.
On 6 Jun, 2014, at 3:03 pm, Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>> wrote:
Nikolay,
you found an API server bug :-)
Solution: delete all domain cookies for "openvehicles.com <http://openvehicles.com/>" from your browser before using the API.
The API server gets confused by multiple cookies. If you visit www.openvehicles.com <http://www.openvehicles.com/> before using the API, you get a persistent PHP session cookie like this:
Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com <http://openvehicles.com/> Pfad /
As the host defines ".openvehicles.com <http://openvehicles.com/>" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e.
Name ovmsapisession Host tmc.openvehicles.com <http://tmc.openvehicles.com/> Pfad /api/
Regards, Michael
Am 05.06.2014 23:46, schrieb Nikolay Shishkov:
Thanks Michael, I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> <mailto:dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net <http://asp.net/> server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> <mailto:dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
Looking at the references mozilla document, it seems that our API use cases fall within the 'simple' approach. I have changed the tmc.openvehicles.com server to return "Access-Control-Allow-Origin: *" for all requests, and that is live now. I have also put up the simpleclient.htm for testing at: http://www.openvehicles.com/simpleclient.htm It seems to work for me. But, then www.openvehicles.com and tmc.openvehicles.com are somewhat related so this is not a true test. Regards, Mark. On 9 Jun, 2014, at 5:52 am, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
I don't need CORS for the auth, that's already working without.
I would need CORS to automatically process the data. And I'd like to do it with minimal changes to the existing API server.
My CORS research result was:
maybe AnyEvent::HTTPD has some CORS support yet?
If not, these are the headers: Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE" Access-Control-Allow-Origin "$ORIGIN" Access-Control-Allow-Credentials "true" Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"
...static values except for the "ORIGIN" variable, which needs to echo back the "Origin:" header from the request. I'm not familiar with AnyEvent::HTTPD, maybe something like $req->header('Origin')
There's a bit more to do: method OPTIONS also needs to be supported for "preflight requests" (access control negotiation), see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for detailed request/response examples.
I suppose that will need a separate handler function, but one for the /api root should be sufficient.
Btw, methods "PUT", "PATCH" + "DELETE" can be omitted I think.
But if you'd like to build a Node.js based solution, go ahead, sounds cool :-)
Regards, Michael
Am 07.06.2014 23:37, schrieb Nikolay Shishkov:
Hi Michael,
I think what you have done with the html page is crying for the CORS and an angularjs, single page app. Here is an open source project with such app that could "easily" be modified to do the work. Check out a working sample here: http://angular-client-side-auth.herokuapp.com/login/
Nikolay
On Saturday, June 7, 2014 12:42 AM, Nikolay Shishkov <nshishkov@yahoo.com> wrote:
I believe the following two headers should do it: Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true
But needs to be tested.
On Friday, June 6, 2014 2:31 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote:
Bug squished. Live on tmc now (and pushed to github).
Neat web page. Shows promise.
Regarding the CORS, I’m very willing to make the changes - just not really sure what headers exactly need to be added. Anyone here know what I would need to add?
Regards, Mark.
On 6 Jun, 2014, at 3:03 pm, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
you found an API server bug :-)
Solution: delete all domain cookies for "openvehicles.com" from your browser before using the API.
The API server gets confused by multiple cookies. If you visit www.openvehicles.com before using the API, you get a persistent PHP session cookie like this:
Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com Pfad /
As the host defines ".openvehicles.com" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e.
Name ovmsapisession Host tmc.openvehicles.com Pfad /api/
Regards, Michael
Am 05.06.2014 23:46, schrieb Nikolay Shishkov:
Thanks Michael, I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 <dexter.vcf>_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Mark, simpleclient.htm currently does no attempt at a CORS request. I'll prepare a CORS version. To test CORS compliance until then, you can use: http://client.cors-api.appspot.com/client The test currently does not succeed, I think because we also need at least... |Access-Control-Allow-Credentials: true| ...for the cookie. Regards, Michael Am 09.06.2014 03:06, schrieb Mark Webb-Johnson:
Looking at the references mozilla document, it seems that our API use cases fall within the 'simple' approach.
I have changed the tmc.openvehicles.com <http://tmc.openvehicles.com> server to return "Access-Control-Allow-Origin: *" for all requests, and that is live now. I have also put up the simpleclient.htm for testing at:
http://www.openvehicles.com/simpleclient.htm
It seems to work for me. But, then www.openvehicles.com <http://www.openvehicles.com> and tmc.openvehicles.com <http://tmc.openvehicles.com> are somewhat related so this is not a true test.
Regards, Mark.
On 9 Jun, 2014, at 5:52 am, Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>> wrote:
Nikolay,
I don't need CORS for the auth, that's already working without.
I would need CORS to automatically process the data. And I'd like to do it with minimal changes to the existing API server.
My CORS research result was:
maybe AnyEvent::HTTPD has some CORS support yet?
If not, these are the headers:
Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE"
Access-Control-Allow-Origin "*$ORIGIN*"
Access-Control-Allow-Credentials "true"
Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"
...static values except for the "ORIGIN" variable, which needs to echo back the "Origin:" header from the request. I'm not familiar with AnyEvent::HTTPD, maybe something like
$req->header('Origin')
There's a bit more to do: method OPTIONS also needs to be supported for "preflight requests" (access control negotiation), see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for detailed request/response examples.
I suppose that will need a separate handler function, but one for the /api root should be sufficient.
Btw, methods "PUT", "PATCH" + "DELETE" can be omitted I think.
But if you'd like to build a Node.js based solution, go ahead, sounds cool :-)
Regards, Michael
Am 07.06.2014 23:37, schrieb Nikolay Shishkov:
Hi Michael,
I think what you have done with the html page is crying for the CORS and an angularjs, single page app. Here is an open source project with such app that could "easily" be modified to do the work. Check out a working sample here: http://angular-client-side-auth.herokuapp.com/login/
Nikolay
On Saturday, June 7, 2014 12:42 AM, Nikolay Shishkov <nshishkov@yahoo.com> wrote:
I believe the following two headers should do it: Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true
But needs to be tested.
On Friday, June 6, 2014 2:31 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote:
Bug squished. Live on tmc now (and pushed to github).
Neat web page. Shows promise.
Regarding the CORS, I'm very willing to make the changes - just not really sure what headers exactly need to be added. Anyone here know what I would need to add?
Regards, Mark.
On 6 Jun, 2014, at 3:03 pm, Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>> wrote:
Nikolay,
you found an API server bug :-)
Solution: delete all domain cookies for "openvehicles.com <http://openvehicles.com/>" from your browser before using the API.
The API server gets confused by multiple cookies. If you visit www.openvehicles.com <http://www.openvehicles.com/> before using the API, you get a persistent PHP session cookie like this:
Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com <http://openvehicles.com/> Pfad /
As the host defines ".openvehicles.com <http://openvehicles.com/>" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e.
Name ovmsapisession Host tmc.openvehicles.com <http://tmc.openvehicles.com/> Pfad /api/
Regards, Michael
Am 05.06.2014 23:46, schrieb Nikolay Shishkov:
Thanks Michael, I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> <mailto:dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net <http://asp.net/> server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> <mailto:dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti:
For nice2have features I'll wait for your list (I have my personal list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 <dexter.vcf>_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
Michael, Can you try to put your simpleclient.htm up on a website you run, then access it? From what I can see that now works (using the simple SORS response recommended by that mozilla article). It seems to me that we fit into the simple CORS model, and it should work. But, I guess it depends on how individual browsers implement the request. Regards, Mark. On 11 Jun, 2014, at 2:25 am, Michael Balzer <dexter@expeedo.de> wrote:
Mark,
simpleclient.htm currently does no attempt at a CORS request. I'll prepare a CORS version.
To test CORS compliance until then, you can use: http://client.cors-api.appspot.com/client
The test currently does not succeed, I think because we also need at least...
Access-Control-Allow-Credentials: true
...for the cookie.
Regards, Michael
Am 09.06.2014 03:06, schrieb Mark Webb-Johnson:
Looking at the references mozilla document, it seems that our API use cases fall within the 'simple' approach.
I have changed the tmc.openvehicles.com server to return "Access-Control-Allow-Origin: *" for all requests, and that is live now. I have also put up the simpleclient.htm for testing at:
http://www.openvehicles.com/simpleclient.htm
It seems to work for me. But, then www.openvehicles.com and tmc.openvehicles.com are somewhat related so this is not a true test.
Regards, Mark.
On 9 Jun, 2014, at 5:52 am, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
I don't need CORS for the auth, that's already working without.
I would need CORS to automatically process the data. And I'd like to do it with minimal changes to the existing API server.
My CORS research result was:
maybe AnyEvent::HTTPD has some CORS support yet?
If not, these are the headers: Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE" Access-Control-Allow-Origin "$ORIGIN" Access-Control-Allow-Credentials "true" Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type"
...static values except for the "ORIGIN" variable, which needs to echo back the "Origin:" header from the request. I'm not familiar with AnyEvent::HTTPD, maybe something like $req->header('Origin')
There's a bit more to do: method OPTIONS also needs to be supported for "preflight requests" (access control negotiation), see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for detailed request/response examples.
I suppose that will need a separate handler function, but one for the /api root should be sufficient.
Btw, methods "PUT", "PATCH" + "DELETE" can be omitted I think.
But if you'd like to build a Node.js based solution, go ahead, sounds cool :-)
Regards, Michael
Am 07.06.2014 23:37, schrieb Nikolay Shishkov:
Hi Michael,
I think what you have done with the html page is crying for the CORS and an angularjs, single page app. Here is an open source project with such app that could "easily" be modified to do the work. Check out a working sample here: http://angular-client-side-auth.herokuapp.com/login/
Nikolay
On Saturday, June 7, 2014 12:42 AM, Nikolay Shishkov <nshishkov@yahoo.com> wrote:
I believe the following two headers should do it: Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true
But needs to be tested.
On Friday, June 6, 2014 2:31 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote:
Bug squished. Live on tmc now (and pushed to github).
Neat web page. Shows promise.
Regarding the CORS, I’m very willing to make the changes - just not really sure what headers exactly need to be added. Anyone here know what I would need to add?
Regards, Mark.
On 6 Jun, 2014, at 3:03 pm, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
you found an API server bug :-)
Solution: delete all domain cookies for "openvehicles.com" from your browser before using the API.
The API server gets confused by multiple cookies. If you visit www.openvehicles.com before using the API, you get a persistent PHP session cookie like this:
Name SESS619b2b3f204291df32506531f8b446dd Host .openvehicles.com Pfad /
As the host defines ".openvehicles.com" and path "/", this cookie also gets sent to the API host, which then confuses this one with the "ovmsapisession" cookie, i.e.
Name ovmsapisession Host tmc.openvehicles.com Pfad /api/
Regards, Michael
Am 05.06.2014 23:46, schrieb Nikolay Shishkov:
Thanks Michael, I am getting "login ok" when pressing on the login button, but then all the other buttons are giving "authentication error" message. I could check that the cookie is sent with the request, but the server seems to respond with the 400 code. I tried in Chrome. Where, how do you use the page? Nikolay
On Thursday, June 5, 2014 10:59 PM, Michael Balzer <dexter@expeedo.de> wrote:
Nikolay,
that's right, I intend to get this running without an otherwise necessary proxy, i.e. for local HTML pages on mobile devices or the like. I've been in contact with Mark about CORS on the perl server.
A server could of course be used, most simply the HTTP API itself could deliver the client page, but CORS should now enable to cope without and open possible cross origin data/control integrations. Not sure about static pages for this though, not yet tested. I think it would be cool to just load some HTML file in your browser and have a graphical OVMS client.
The "code" is currently just a first test bed HTML page to interact with the HTTP API. No graphics, just a simple table view. Works, but is clumsy as hell.
Try yourself, I've attached it.
Regards, Michael
Am 05.06.2014 11:26, schrieb Nikolay Shishkov:
Hi Michael,
I am very interested in the "Browser client using HTTP API and jQuery/Flot for visualization". From the comment that CORS is needed I suspect you want to have the html5 page locally and then fetch data from the server while using other sources for context data. Have you considered running this on a separate server that serves as a gateway to the TMC server?
Have you uploaded the code somewhere?
I have been playing around with C# client and was thinking of using it on an asp.net server...
Nikolay
On Wednesday, June 4, 2014 11:22 PM, Michael Balzer <dexter@expeedo.de> wrote:
Am 04.06.2014 07:38, schrieb Gianluca Magalotti: > For nice2have features I'll wait for your list (I have my personal > list too but maybe we'll have a later focus on that)
So here it is.
If other Twizy drivers would like to add their ideas, you're welcome.
I'll do my best to check new ideas against my collected knowledge of what's possible up to now and give you some feedback.
Regards, Michael
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 <dexter.vcf>_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Paradestr. 8 * D-42107 Wuppertal Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 <dexter.vcf>_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
participants (4)
-
Gianluca Magalotti -
Mark Webb-Johnson -
Michael Balzer -
Nikolay Shishkov