nissan-connect-php icon indicating copy to clipboard operation
nissan-connect-php copied to clipboard

New Leaf 2019 Protocol

Open cedric222 opened this issue 5 years ago • 15 comments

Hi,

I replace my old leaf 2016, with a very new 2019, and the new apps is "Nissan Connect Services" and no more "Nissan Connect EV". Unfortunately, I have now a http 408 error with nissan-connect-php... do you know if someone already try to reverse engineering this new apps ?

thanks

cedric

cedric222 avatar Aug 29 '19 21:08 cedric222

Use the New API, I have a 2018 and it works fine!

Raiden38 avatar Aug 29 '19 21:08 Raiden38

https://github.com/gboudreau/nissan-connect-php/tree/new-api

gboudreau avatar Aug 29 '19 21:08 gboudreau

I will try. @Raiden38 do your cars works with "Nissan Connect Services" ? ( and not "Nissan Connect EV" ) Since April 2019, and the new 8 inch screen, seems there is some change.

cedric222 avatar Aug 29 '19 21:08 cedric222

It written Nissan Connect EV & Services lol. Should be the latest version. I have the 8 inch screen also. Try the new API and let us know

Raiden38 avatar Aug 29 '19 22:08 Raiden38

2019 uses a new API from May onwards ("Nissan Connect Services"), which nobody has yet decoded and implemented yet to my knowledge. Tobias at MyLeaf is on with it, with my credentials for testing.

howartp84 avatar Aug 31 '19 08:08 howartp84

Sorry for the delay ! I don't have many time recently

Thanks @howartp84 for the info, let us know.

I test with the branch "new-api", and the result here is [2019-09-29 00:09:39][DEBUG] : [NissanConnect] Request: POST https://gdcportalgw.its-mo.com/api_v190426_NE/gdc/InitialApp_v2.php {"custom_sessionid":"","initial_app_str":"9s5rfKVuMrT03RtzajWNcA","RegionCode":"NE","lg":"en-US","DCMID":"","VIN":"","tz":"Europe/Paris"} [2019-09-29 00:09:49][DEBUG] : [NissanConnect] Response: {"status":200,"message":"success","baseprm":"88dSp7wWnV3xxxxxxxxxxx"} [2019-09-29 00:09:49][DEBUG] : [NissanConnect] Request: POST https://gdcportalgw.its-mo.com/api_v190426_NE/gdc/UserLoginRequest.php {"UserId":"[email protected]","Password":"toto","custom_sessionid":"","initial_app_str":"9s5rfKVuMrT03RtzajWNcA","RegionCode":"NE","lg":"en-US","DCMID":"","VIN":"","tz":"Europe/Paris"} [2019-09-29 00:09:53][DEBUG] : [NissanConnect] Found resultKey in response: [2019-09-29 00:09:53][DEBUG] : [NissanConnect] Request for 'UserLoginRequest.php' failed. Response received: {"status":"-2010","message":"INVALID PARAMS","resultKey":""} Will retry. [20

The good new is the 2019 official apps is now usable, you can start heater in less then 20 seconds.. ( was more than 2 minutes with the 2016 Leaf apps )

cedric222 avatar Sep 28 '19 22:09 cedric222

I have this error

Request for 'UserLoginRequest.php' failed. Response received: {"status":"-2010","message":"INVALID PARAMS","resultKey":""}

Is it fixed in any realese?

pirracas77 avatar Sep 30 '20 14:09 pirracas77

I am myself using the new-api branch, which stopped working a while ago (see #32). The master branch, I can't use for quite a while. Not sure if it is working for anyone.

gboudreau avatar Sep 30 '20 14:09 gboudreau

Thanks for the quick answer. With the new-api I get Login failed, or failed to find car VIN, authToken or accountID in response of login request: {"errorMessage":"Authentication Failure","errorCode":910,"status":200}

pirracas77 avatar Sep 30 '20 14:09 pirracas77

I'm developing a PV-controlled EV charger at https://github.com/andig/evcc and would like to support the newer Nissans. If I understand correctly the protocol has not been decoded yet? Are you aware of https://github.com/gboudreau/LEAF_Carwings_EasyAccess/issues/8#issuecomment-520143453 and does that work? Also here is an explicit reference to Nissan Connect which seems to be the "new" api: https://github.com/Tobiaswk/dartnissanconnectna

andig avatar Oct 24 '20 08:10 andig

@andig The correct code to use to connect to the API might depend on region (EU, North America, Japan), and MY of the LEAF. I'm in Canada, have a 2011 MY, and was using the new-api branch until it stopped working a while ago. I didn't take the time to reverse engineer the Android app, to see what was wrong with my code. I was recently told that the code available at https://gitlab.com/tobiaswkjeldsen/carwingsflutter is working. You might look there to get a working code example; I didn't yet take the time to look myself.

gboudreau avatar Oct 24 '20 11:10 gboudreau

Follow up: so the new-api branch is working now; that branch should fix it for North America (it is working for my 2011 MY in Canada). For 2019+, I think a completely different API is required, but I'm not sure if it applies worldwide, or only in specific regions. Anyone has a 2019+ LEAF, and could test the new-api branch, and report if it works, and in which region they are?

gboudreau avatar Oct 24 '20 12:10 gboudreau

Follow up: so the new-api branch is working now; that branch should fix it for North America (it is working for my 2011 MY in Canada). For 2019+, I think a completely different API is required, but I'm not sure if it applies worldwide, or only in specific regions. Anyone has a 2019+ LEAF, and could test the new-api branch, and report if it works, and in which region they are?

For me is still not working (2019+ , Europe)

×Login failed, or failed to find car VIN, authToken or accountID in response of login request: {"errorMessage":"Authentication Failure","errorCode":910,"status":200}

pirracas77 avatar Oct 24 '20 20:10 pirracas77

OK, so I guess you'd need completely new code, something like this: https://github.com/Tobiaswk/dartnissanconnect/tree/master/lib/src That code connects to Kamereon platform in EU. If anyone wants to modify the code to replicate Tobiaswk's code, I'd be happy to review any PR.

gboudreau avatar Oct 24 '20 20:10 gboudreau

Here there is a TypeScript port if anyone is interested.

https://github.com/sebjsmith/kamereon

pirracas77 avatar Oct 26 '20 11:10 pirracas77