openLuup plugin: Volkswagen CarNet

Hi,

I created a new plugin to get more control over managing charging my Hybrid Volkswagen. I managed to create LUA code that emulates how you would access the VW CarNet portal using a web browser. This portal has oauth2 based authentication and to make that work i had to install LuaSec version 0.7 in my PI. With the standard LuaSec 0.5 there is a TLS protocol error and after a bit of googling around it seems to be related to sslv3 and Server Name Identification support. All modern browsers and languages have that, but not LUA. This is also why it will only work with openLuup and not on Vera for now.

The plugin is in the App store and here you can find the code https://github.com/reneboer/openLuup-CarNet.

If any of you can find a way how I can make this work with LuaSec 0.5 I would be very very interested.

Cheers Rene

Oh, that’s interesting!

Not sure I can help with the LuaSec issue, although I’ll try and read up a bit about it.

Good to hear that here’s another way in which openLuup is better than Vera, though!

Hi akbooer,

Yes having openLuup gives the rubberband you can fix nearly anything with :).

It was an interesting exercise and mostly new techniques to reverse engineer a web session, then poor that in to LUA with https that has no cookie or other more advanced session support, and no example code to do all that on the client side. But, he it’s winter and a man needs a hobby ;D

Cheers Rene

Is there something I should add? The WSAPI connector for Lua CGIs that’s built in to openLuup has limited server-side support for cookies, but I wouldn’t know what should be done for client-side stuff.

Is there something I should add? The WSAPI connector for Lua CGIs that’s built in to openLuup has limited server-side support for cookies, but I wouldn’t know what should be done for client-side stuff.[/quote]
I do not think so. It is really only if you want/need to emulate a browser for some portal as I did here. I have found some java based examples and the RFC describes how you should determine what received cookies to return to the server when. For this plugin I just mapped them all out and add them in the header as needed. If VW changes something, I will likely need to do too and maybe then I make it smart. For now it works.

Cheers Rene