Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evcc Nissan Leaf Login failed: code not found #13941

Closed
gorman553 opened this issue May 17, 2024 · 28 comments · Fixed by #13962
Closed

evcc Nissan Leaf Login failed: code not found #13941

gorman553 opened this issue May 17, 2024 · 28 comments · Fixed by #13962
Labels
bug Something isn't working devices Specific device support

Comments

@gorman553
Copy link

Describe the bug

cannot query my Nissan Leaf.

Steps to reproduce

  1. evcc -l vehicle

...

Configuration details

vehicles:
- name: leaf
  type: nissan
  title: Leaf # display name for UI
  capacity: 40 # kWh
  user: email@addr.com
  password: "my-secret-words"
  cache: 15m
  phases: 1

Log details

pi@raspberrypi:~ $ /usr/bin/evcc -l vehicle
[main  ] INFO 2024/05/17 08:16:21 evcc 0.126.2 (940ce81a)
[main  ] INFO 2024/05/17 08:16:21 using config file: /home/pi/evcc.yaml
[main  ] ERROR 2024/05/17 08:16:23 creating vehicle leaf failed: cannot create vehicle type 'nissan': login failed: code not found
[main  ] FATAL 2024/05/17 08:16:23 failed configuring site: missing either grid or pv meter
[main  ] FATAL 2024/05/17 08:16:23 will attempt restart in: 5m0s
[server] FATAL 2024/05/17 08:16:23 unlinkat /tmp/evcc: operation not permitted

What type of operating system are you running?

Linux

Version

evcc version 0.126.2 (940ce81)

@gorman553
Copy link
Author

Hi Andi,

since yesterday (16.05.2024) I can not query my nissan leaf. the days before it worked fine. The Android Nissan Tool works, so I think Nissan changed something in their setup :(.

thanks for having a look on it.

gorman

@docolli
Copy link
Sponsor Contributor

docolli commented May 17, 2024

Yes, I can confirm that the carwings API might have changed, since I cannot query my Leaf either. I can see the problem with the carwings implementation of FHEM also. Android APP works, so no server problem on Nissan side.

Someone needs to run apktool and find out the changes, hopefully they only have changed some URLs, like 4 years ago: https://gitlab.com/tobiaswkjeldsen/dartcarwings/-/issues/15

@andig
Copy link
Member

andig commented May 17, 2024

Gibts eine Lösung mit der das noch funktioniert? Welche?

@andig andig added bug Something isn't working devices Specific device support labels May 17, 2024
@docolli
Copy link
Sponsor Contributor

docolli commented May 17, 2024

Bislang kann man im Netz noch keine Infos dazu finden. Ich hoffe es wurde nur die baseURL geändert. Ich werden nachher mal die Aufruf von meiner NissanConnected App auf dem Handy sniffen, welche URLs aktuell abgefragt werden.

@docolli
Copy link
Sponsor Contributor

docolli commented May 17, 2024

Sniffen geht nicht, die Aufrufe werden über Port 443 geroutet. Da komm ich nicht ran. Zumindest sehe ich, dass die Aufrufe noch an gdcportalgw.its-mo.com gesendet werden, leider keinen weiteren Teil der URL. Wenn ich versuche den HTTPS Verkehr zu entschlüsseln verweigert die Nissan APP die Mitarbeit mit "Dienst steht gerade nicht zur Verfügung". 🤔

Auch beim Versuch die NissanConnected APK aus einem APK-Store zu laden und zu dekompilieren finde ich keine URL. Habe das aber zum ersten Mal versucht. Kann also an mir liegen.

Edit: Lag an mir, hab zuerst die falsche APK runtergeladen, dann eine alte Version. 🤣

@docolli
Copy link
Sponsor Contributor

docolli commented May 17, 2024

@andig
Nissan hat nur die Base URL geändert -> https://gdcportalgw.its-mo.com/api_v230317_NE/gdc/
Ich glaube wir sind damit die Ersten mit dieser Info 😎

https://github.com/joeshaw/carwings/blob/195f7e10e96699915c18cf10dfafdccad2870aca/carwings.go#L53

@geert-claes
Copy link

same problem (with an Ariya)

[main  ] INFO 2024/05/17 20:11:28 evcc 0.124.10
[main  ] INFO 2024/05/17 20:11:28 using config file: /etc/evcc.yaml
[db    ] INFO 2024/05/17 20:11:29 using sqlite database: /root/.evcc/evcc.db
[main  ] ERROR 2024/05/17 20:11:31 creating vehicle ev1 failed: cannot create vehicle type 'template': cannot create vehicle type 'nissan': login failed: code not found
.Soc:     vehicle not available: cannot create vehicle type 'template': cannot create vehicle type 'nissan': login failed: code not found
Capacity: 63.0kWh
Features: [Offline]

@docolli
Copy link
Sponsor Contributor

docolli commented May 17, 2024

@andig
Fix in carwings go library ist raus: joeshaw/carwings@cf29a18

Ich habe dennoch einen fork von carwings gemacht und habe versucht einen PR zu machen, der auf mein Repository verweist. Bin aber zu unerfahren, das bekomme ich nicht hin. 😟

@docolli
Copy link
Sponsor Contributor

docolli commented May 18, 2024

Test mit neuer Bibliothek von joeshaw (github.com/joeshaw/carwings v0.0.0-20240517194654-cf29a185820c) unter Windows & Linux erfolgreich:
grafik

@andig
Copy link
Member

andig commented May 18, 2024

Carwings ist im master aktualisiert. Ich sehe lokal keinen Unterschied, kann aber am Testfahrzeug liegen. Nightly baut.

Bitte kurzes OK, dann würde ich nochmal releasen.

@andig andig closed this as completed May 18, 2024
@docolli
Copy link
Sponsor Contributor

docolli commented May 18, 2024

Nightly baut.

d.h. ich kann die binary nachher bei cloudsmith runterladen und testen?

@docolli
Copy link
Sponsor Contributor

docolli commented May 18, 2024

Ok, Paket ist fertig und erfolgreich getestet:
evcc 0.126.3 (562c702)

grafik

@geert-claes
Copy link

geert-claes commented May 18, 2024

correct paste

[main  ] INFO 2024/05/18 11:36:54 evcc 0.126.3 (562c702c)
[main  ] INFO 2024/05/18 11:36:54 using config file: /etc/evcc.yaml
[main  ] INFO 2024/05/18 11:36:54 starting ui and api at :7070
[db    ] INFO 2024/05/18 11:36:54 using sqlite database: /root/.evcc/evcc.db
[main  ] ERROR 2024/05/18 11:36:54 creating vehicle ev1 failed: cannot create vehicle type 'template': cannot create vehicle type 'nissan': login failed: code not found```

@andig
Copy link
Member

andig commented May 18, 2024

Tja...

@geert-claes
Copy link

Not working for me.

@gorman553
Copy link
Author

For me also not working, sorry...

pi@raspberrypi:~ $ evcc -l debug vehicle
[main ] INFO 2024/05/18 11:56:49 evcc 0.126.3 (562c702)
[main ] INFO 2024/05/18 11:56:49 using config file: /home/pi/evcc.yaml
[db ] INFO 2024/05/18 11:56:49 using sqlite database: /home/pi/.evcc/evcc.db
[main ] ERROR 2024/05/18 11:56:50 creating vehicle leaf failed: cannot create vehicle type 'nissan': login failed: code not found
.Soc: vehicle not available: cannot create vehicle type 'nissan': login failed: code not found
Capacity: 40.0kWh
Features: [Offline Retryable]

@docolli
Copy link
Sponsor Contributor

docolli commented May 18, 2024

Strange.... 🤔

Mai 18 11:56:31 fhem-heizung evcc[19475]: [main  ] INFO 2024/05/18 11:56:31 evcc 0.126.3 (562c702c)
Mai 18 11:56:31 fhem-heizung evcc[19475]: [main  ] INFO 2024/05/18 11:56:31 using config file: /etc/evcc.yaml
Mai 18 11:56:31 fhem-heizung evcc[19475]: [main  ] INFO 2024/05/18 11:56:31 starting ui and api at :7070
Mai 18 11:56:32 fhem-heizung evcc[19475]: [db    ] INFO 2024/05/18 11:56:32 using sqlite database: /var/lib/evcc/evcc.db
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41 site config:
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41   meters:      grid ✓ pv ✓ battery ✓
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41     grid:      power ✓ energy ✗ currents ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41     pv 1:      power ✓ energy ✗ currents ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41     battery 1: power ✓ energy ✗ currents ✗ soc ✓ capacity ✓
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41   vehicles:
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41     vehicle 1: range ✗ finish ✗ status ✗ climate ✗ wakeup ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41     vehicle 2: range ✓ finish ✗ status ✓ climate ✓ wakeup ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] INFO 2024/05/18 11:56:41     vehicle 3: range ✗ finish ✗ status ✗ climate ✗ wakeup ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:41 loadpoint 1:
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:41   mode:        pv
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:41   charger:     power ✓ energy ✓ currents ✓ phases ✗ wakeup ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:41   meters:      charge ✓
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:41     charge:    power ✓ energy ✓ currents ✓
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-2  ] INFO 2024/05/18 11:56:41 loadpoint 2:
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-2  ] INFO 2024/05/18 11:56:41   mode:        off
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-2  ] INFO 2024/05/18 11:56:41   charger:     power ✓ energy ✓ currents ✗ phases ✗ wakeup ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-2  ] INFO 2024/05/18 11:56:41   meters:      charge ✓
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-2  ] INFO 2024/05/18 11:56:41     charge:    power ✓ energy ✓ currents ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-3  ] INFO 2024/05/18 11:56:41 loadpoint 3:
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-3  ] INFO 2024/05/18 11:56:41   mode:        off
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-3  ] INFO 2024/05/18 11:56:41   charger:     power ✓ energy ✗ currents ✗ phases ✗ wakeup ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-3  ] INFO 2024/05/18 11:56:41   meters:      charge ✓
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-3  ] INFO 2024/05/18 11:56:41     charge:    power ✓ energy ✗ currents ✗
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] DEBUG 2024/05/18 11:56:41 set buffer soc: 70
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] DEBUG 2024/05/18 11:56:41 set buffer start soc: 75
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] DEBUG 2024/05/18 11:56:41 set priority soc: 40
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 phase timer inactive
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 pv timer inactive
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:41 vehicle updated: unknown -> Nissan Leaf
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 max charge current: 6A
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] WARN 2024/05/18 11:56:41 interval <30s can lead to unexpected behavior, see https://docs.evcc.io/docs/reference/configuration/interval
Mai 18 11:56:41 fhem-heizung evcc[19475]: [site  ] DEBUG 2024/05/18 11:56:41 ----
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 charge power: 4888W
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 charge currents: [23 0 0]A
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 charge voltages: [220 237 235]V
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 detected connected phases: 3p
Mai 18 11:56:41 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:41 charge total import: 3708.847kWh
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:42 charger status: C
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:42 charge start energy: 3.71e+03kWh
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:42 car connected
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:42 pv timer elapse
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:42 pv timer inactive
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:42 charge total import: 3708.847kWh
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:42 charge start energy: 3.71e+03kWh
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] INFO 2024/05/18 11:56:42 start charging ->
Mai 18 11:56:42 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:42 wake-up timer: stop
Mai 18 11:56:44 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:44 max charge current: 22A
Mai 18 11:56:51 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:51 charge power: 4894W
Mai 18 11:56:51 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:56:51 charge currents: [23 0 0]A
Mai 18 11:57:01 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:01 charge power: 4882W
Mai 18 11:57:01 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:01 charge currents: [22 0 0]A
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 charge power: 4895W
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 charge currents: [23 0 0]A
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 charge voltages: [220 237 235]V
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 detected connected phases: 3p
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 detected active phases: 1p
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 !! session: chargeRater.chargedEnergy=0.0 - chargedAtStartup=0.0
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 charge total import: 3708.885kWh
Mai 18 11:57:11 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:11 charger status: C
Mai 18 11:57:14 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:14 vehicle status: C
Mai 18 11:57:14 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:14 vehicle soc: 78%
Mai 18 11:57:14 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:14 vehicle range: 175km
Mai 18 11:57:14 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:14 pv charge current: 12.1A = 22A + -9.88A (2273W @ 1p)
Mai 18 11:57:14 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:14 pv timer reset
Mai 18 11:57:14 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:14 pv timer inactive
Mai 18 11:57:14 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:14 max charge current: 12.1A
Mai 18 11:57:21 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:21 charge power: 2709W
Mai 18 11:57:21 fhem-heizung evcc[19475]: [lp-1  ] DEBUG 2024/05/18 11:57:21 charge currents: [12 0 0]A

Hier noch mit trace

Mai 18 12:01:29 fhem-heizung evcc[19498]: {"status":200,"VoltLabel":{"HighVolt":"240","LowVolt":"120"},"BatteryStatusRecords":{"OperationResult":"START","OperationDateAndTime":"2024\/05\/18 11:56","BatteryStatus":{"BatteryChargingStatus":"NORMAL_CHARGING","BatteryCapacity":"240","BatteryRemainingAmount":"188","BatteryRemainingAmountWH":"26960","BatteryRemainingAmountkWH":"","SOC":{"Value":"78"}},"PluginState":"CONNECTED","CruisingRangeAcOn":"175000","CruisingRangeAcOff":"188000","TimeRequiredToFull200_6kW":{"HourRequiredToFull":"3","MinutesRequiredToFull":"0"},"NotificationDateAndTime":"2024\/05\/18 09:56","TargetDate":"2024\/05\/18 09:56"}}
Mai 18 12:01:29 fhem-heizung evcc[19498]: [carwings] TRACE 2024/05/18 12:01:29 POST https://gdcportalgw.its-mo.com/api_v230317_NE/gdc/BatteryStatusCheckRequest.php
/usr/bin/evcc -l debug vehicle
[main  ] INFO 2024/05/18 12:05:42 evcc 0.126.3 (562c702c)
[main  ] INFO 2024/05/18 12:05:42 using config file: /etc/evcc.yaml
[db    ] INFO 2024/05/18 12:05:43 using sqlite database: /var/lib/evcc/evcc.db
[mqtt  ] INFO 2024/05/18 12:05:43 connecting 653555047 at tcp://localhost:1883
[mqtt  ] DEBUG 2024/05/18 12:05:44 tcp://localhost:1883 connected
ebike1
------
Soc:      0%
Capacity: 0.5kWh
Features: [Offline]

ev1
---
Soc:            79%
Capacity:       40.0kWh
Charge status:  C
Range:          178km
Climate active: false
OnIdentified:   MinCurrent:6, MaxCurrent:25
Features:       []

heating1
--------
Soc:      22%
Capacity: 0.0kWh
Features: []

I am using "linux" with "arm" architecture (Raspi 4).
Which one do you have?
Where are you located?

@andig

This comment was marked as resolved.

@docolli
Copy link
Sponsor Contributor

docolli commented May 18, 2024

Please do a log with debug infos and search for this line:

[carwings] TRACE 2024/05/18 12:01:29 POST https://gdcportalgw.its-mo.com/api_v230317_NE/gdc/BatteryStatusCheckRequest.php

I want to verify which URL your evcc carwings is using.

@gorman553
Copy link
Author

ich bin auch unter raspberry Pi 4 arm (Raspbian/buster)

ein strings /usr/bin/evcc | grep api_v230317_NE matched.. also die neue API ist enthalten

was mich aber etwas wundert.

wenn ich ein strace -s 2048 -f -o /tmp/strace evcc -l debug vehicle laufen lasse... dann kann ich im strace den Aufruf auf die URL nicht finden .... strange ... ich hätte erwartet dass ich da im strace irgendwo den Aufruf finde

@andig was genau brauchst Du an debug Info, dann kann ich versuchen das bereit zu stellen?

Danke

@gorman553
Copy link
Author

Was mir eben noch auffällt.

ich nutze template: nissan
und nicht template: carwings

ist die URL nur für carwings evtl. geändert?

@docolli
Copy link
Sponsor Contributor

docolli commented May 18, 2024

Ich bin bei template: carwings. Guter Hinweis!

Der Fix ist NUR für Carwings.
Dann hat Nissan vermutlich auch die URLs für den anderen Zugang geändert. 🙈

Welche Android App nutzt du dafür auf dem Handy? Dann schau ich mir hier die aktuelle Version noch an.

@andig
Copy link
Member

andig commented May 18, 2024

Also: behoben wurde Carwings. Bei Nissan hat sich nichts geändert. Es ist auch weiterhin unklar, was zu ändern wäre. Siehe #13941 (comment)

@andig andig reopened this May 18, 2024
@andig
Copy link
Member

andig commented May 18, 2024

@andig
Copy link
Member

andig commented May 18, 2024

Nightly baut

@gorman553
Copy link
Author

so type: nissan funktioniert wieder.

Vielen lieben Dank @andig

@geert-claes
Copy link

Confirmation : working now.

@tm-107
Copy link
Sponsor

tm-107 commented May 18, 2024

Auch hier läuft es mit der unstable wieder ... Danke!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devices Specific device support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants