crtr0 / carwingsjs

Node bindings for the Nissan Leaf Carwings API
21 stars 5 forks source link

Error trying to use the module #1

Open nilsga opened 10 years ago

nilsga commented 10 years ago

I'm trying to use this module, but I just get an error while trying to login. I am certain that the username and password is correct. The error I get is

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns7:SmartphoneErrorType xmlns:ns4="urn:com:airbiquity:smartphone.reportservice:v1" xmlns:ns7="urn:com:airbiquity:smartphone.common:v1" xmlns:ns3="urn:com:hitachi:gdc:type:report:v1" xmlns:ns5="urn:com:hitachi:gdc:type:vehicle:v1" xmlns:ns2="urn:com:airbiquity:smartphone.userservices:v1" xmlns:ns6="urn:com:airbiquity:smartphone.vehicleservice:v1">
    <ErrorCode>9001</ErrorCode>
</ns7:SmartphoneErrorType>

Which results in

TypeError: Cannot read property 'ns4:SmartphoneLatestBatteryStatusResponse' of undefined
mrpjevans commented 10 years ago

I have exactly the same issue. I note on pycarwings that they don't believe it works in Europe (I'm in England). Maybe we have a different endpoint?

mrpjevans commented 10 years ago

Having done some sniffing, I've established that the European version of Carwings uses a different endpoint - https://mobileapps.prod.nissan.eu/android-carwings-backend-v2/2.0/carwingsServlet

Also, unlike the USA version, this endpoint is used for all calls

nilsga commented 10 years ago

Is the API the same, so it's enough to replace the endpoints?

mrpjevans commented 10 years ago

Seems to be yes, just working on an example

nilsga commented 10 years ago

Did you finish the example?

crtr0 commented 9 years ago

@mrpjevans were you able to get it working with the European endpoint? If so, I'm happy to add it as a configurable option for the Node module.

mrpjevans commented 9 years ago

Yes, I've written a PHP class that works with the European version (just for status updates). Not in js though I'm afraid. I've not uploaded it as Nissan now require an API key to be submitted with the headers and I'm unsure whether this is private information to me or not (I sniffed it from the iOS app). Let me know if you'd like to see it.

aminorjourney commented 9 years ago

This is interesting: I'm using the carwings python script, and I don't believe it does require the API key... (Haven't seen it in the code).

I hard-coded the European values in the python script though, so maybe I missed something. Been working fine for me!

On Mon Nov 17 2014 at 9:51:02 AM mrpjevans notifications@github.com wrote:

Yes, I've written a PHP class that works with the European version (just for status updates). Not in js though I'm afraid. I've not uploaded it as Nissan now require an API key to be submitted with the headers and I'm unsure whether this is private information to me or not (I sniffed it from the iOS app). Let me know if you'd like to see it.

— Reply to this email directly or view it on GitHub https://github.com/crtr0/carwingsjs/issues/1#issuecomment-63281135.

jensjakob commented 7 years ago

Did anyone found a solution?

mrpjevans commented 7 years ago

Haven't looked at it in a long time I'm afraid. It's undergone significant changes since as a result of some pretty hair-raising security issues. I found Carwings so unusable as a platform, I've not been prepared to any further work on it. :(

jensjakob commented 7 years ago

Looks like there is a Python solution and "Alexa" plugin that might have the code snippets to make this work again. Probably under another name, as Nissan seems to have changed the name. Would be nice to get it working in Node.js though...

https://github.com/ScottHelme/AlexaNissanLeaf

mrpjevans commented 7 years ago

Nice find. I've got an Echo here so I'll try it out. Alexa skill code basically is Node.js, so this shouldn't be too hard to adapt to work from the command line.

aminorjourney commented 7 years ago

I’ve actually put some modified code into the Alexa skill too.

https://www.youtube.com/watch?v=0F_-IAqlqQs

[image: --]

Nikki Gordon-Bloomfield [image: https://]about.me/aminorjourney https://about.me/aminorjourney?promo=email_sig

On Wed, Jul 12, 2017 at 7:40 AM, mrpjevans notifications@github.com wrote:

Nice find. I've got an Echo here so I'll try it out. Alexa skill code basically is Node.js, so this shouldn't be too hard to adapt to work from the command line.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/crtr0/carwingsjs/issues/1#issuecomment-314790710, or mute the thread https://github.com/notifications/unsubscribe-auth/ADCbIwLNBUVqGhD6HPMsircDB_1uyWRcks5sNNrygaJpZM4B6uR8 .

jensjakob commented 7 years ago

Just made this public; https://github.com/jensjakob/charge-cheap

The code is not perfect. I just wanted to make it work in the first version.