philliphoff / carwings2

A Node.js client library for the Nissan Leaf "Carwings" API
MIT License
12 stars 6 forks source link

404 Error #20

Open Todd1561 opened 5 years ago

Todd1561 commented 5 years ago

Is this project still active? When attempting to run the sample script I get a http 404 not found error, see below. Has maybe the carwings URL changed?

Error: Response was status code: 404 (Not Found)
    at Request._callback (C:\Users\Todd\Desktop\node_modules\carwings2\release\Api.js:29:33)
    at Request.self.callback (C:\Users\Todd\Desktop\node_modules\request\request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.<anonymous> (C:\Users\Todd\Desktop\node_modules\request\request.js:1161:10)
    at Request.emit (events.js:198:13)
    at IncomingMessage.<anonymous> (C:\Users\Todd\Desktop\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:286:20)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
philliphoff commented 5 years ago

@Todd1561 Yes, depending on your definition of "active". I had to give up my beloved Leaf--with the second child it became more practical to have one larger vehicle rather than two smaller ones--so I'm now dependent on other users of the library to identify problems and test fixes.

Nissan tends to change endpoints from time to time, so that's entirely possible. Did you have an application that was working and now does not, or were you simply trying the sample? Also, where in the world are you, as the vehicles are tied to specific regions and their individual endpoints?

Todd1561 commented 5 years ago

Sorry to hear you're no longer a Leaf owner! Ironically, we got the Leaf BECAUSE we're having a second child. But we have a second car, so it makes it a little more doable.

This is my first time using your code, so no previous project that's been operational. After doing some more experimenting it seems my car (a 2019) is only compatible with the new variant of the API (the one with the infiniti.com address). I stumbled across another project on GitHub (https://github.com/Tobiaswk/dartnissanconnectna) that seems to be the only one that implements this new variant of the API in use in the USA where I am. I've been able to use that one flawlessly.

philliphoff commented 5 years ago

@Todd1561 For us, we moved to the city from the suburbs and parking for two vehicles (especially one electric one) became an issue.

Anyway, yes, it looks like Nissan has shifted to an entirely new API and endpoints, at least for the 2018+ models. It'd probably be simple enough to do a Node.js port of the Dart library by @tobiaswk, but without a Nissan account of my own, testing would be problematic. I'd have to look more closely at the two APIs to see whether it'd make sense to have separate, specialized libraries or create a single, generalized library that supported both.

Tobias-Georg commented 3 years ago

Hi, I own a Leaf 2018, live in Belgium and for me Carwings2 works most of the time.

knutta commented 3 years ago

AFAIK Nissan has changed the nav-unit on newer Leafs, but it’s the same on 2018/19 and older(depending on where you are located I guess). I seem to remember they use both a new app and a new unit in the car, but I could be mistaken. For me, I’ve got the e-NV200, and they still use the same old Carwings-system. It’s basically an 40kWh 2016 Leaf in a van-size. Works beautifully with two dogs, strollers and kids. Even able to squeeze some luggage in, but my mother in law can mysteriously not fit🤪😅

I’ve been looking at this project as something to implement in a MagicMirror with a touch-screen. It would be super to set it to check battery status/range at certain times, lets say 23.00 and 06.00, and give me the opportunity to start the HVAC by pushing a button on the screen when I hit the shower (especially now with working from home, and not needing to use the car every day at a specific time). It’s going to take some time though, as I’m not exactly tech-savvy enough to build everything from scratch, and need to dissect a few modules to be able to Frankenstein something😂🙈

Tobias-Georg commented 3 years ago

@knutta Just to confirm: this carwings2 library works fine for daily use for my Nissan Leaf 2018. I use it to read out the charging and plug-in status, but don't use the HVAC function. The only thing is that I had to add some error handling - I am not sure anymore if it was only in the routines that call the carwings2 functions, or whether I had to add something within the carwings2 library. This is because the Nissan API sometimes is down (I saw it down for up to 1.5 days or so) or gives back unexpected errors, and I did not want my program to stop working in these cases. Also, I skipped the step reading out the last known status, as I am only interested in the actual charge and not in something that might be a week old. It is a good idea to read out the status at fixed times, because getting the charging status takes about a minute, just like in the Nissan App.