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

Fiat: ignore HTTP 403 during deep refresh #13428

Merged
merged 1 commit into from
Apr 14, 2024
Merged

Fiat: ignore HTTP 403 during deep refresh #13428

merged 1 commit into from
Apr 14, 2024

Conversation

andig
Copy link
Member

@andig andig commented Apr 14, 2024

@andig andig added the enhancement New feature or request label Apr 14, 2024
@andig andig merged commit ab412b4 into master Apr 14, 2024
7 checks passed
@andig andig deleted the fix/fiat-2 branch April 14, 2024 13:52
@PanNwt
Copy link
Contributor

PanNwt commented Apr 14, 2024

I can confirm the solution with set PIN and an disconnected Fiat 500.

Fiat500e with PIN and Status A

@SolarPowerEV
Copy link
Sponsor Contributor

SolarPowerEV commented May 2, 2024

Unfortunately I can not confirm that the new version makes a difference. I now get a 500 error with the 0.126.0 instead of a 403 error:
grafik

The first request is with the PIN commented out in the evcc.yaml and works fine.
The second request is with the PIN active in the evcc.yaml and consistently produces an error.
I even went into the FIAT app and woke the car by requesting the SoC. Didn't change anything.

@andig
Copy link
Member Author

andig commented May 3, 2024

For the http 500 I'd need credentials sent to info@evcc.io. My local Fiat is working.

@andig
Copy link
Member Author

andig commented May 3, 2024

Looks like I can reproduce it. Error happens after the PIN auth:

POST /v1/accounts/.../vehicles/.../ev HTTP/1.1
X-Amz-Security-Token: ...

{"command":"DEEPREFRESH","pinAuth":"..."}

HTTP/2.0 500 Internal Server Error

Unfortunately its unclear why this happens. I can only suggest to deactivate PIN auth in this case. Sorry.

@SolarPowerEV
Copy link
Sponsor Contributor

Weird. Because PIN auth worked before in 0.125.0 and previous versions without producing this error. At least as long as the car was charging.

@andig
Copy link
Member Author

andig commented May 4, 2024

@SolarPowerEV could you try- when charging and with pin- 125 and 126? There should be no difference.

@SolarPowerEV
Copy link
Sponsor Contributor

SolarPowerEV commented May 5, 2024

I agree, there shouldn't be any difference with a PIN provided between 0.125.0 and 0.126.0. But that is also not the problem.

The current issue is the different behavior if no PIN is set in the evcc.yaml. It just went from producing a 403 to a 500 error instead of providing an error free output for those who haven't entered a PIN.

@andig
Copy link
Member Author

andig commented May 5, 2024

See #13428 (comment). Did you try 125 vs 126?

@SolarPowerEV
Copy link
Sponsor Contributor

SolarPowerEV commented May 5, 2024

No, because on my production system (Synology) I am still running 0.124.10. Because that works reliably.
Since the tests with no PIN already failed for 0.125.0, 0.126.0 and 0126.1, trying out any of those versions on my Synology is not an option for me, because reverting back in a Docker container isn't really fun. So I rather stick with what works.

I also get the impression that there might be a misunderstanding at the core of all of this:
The original problem with the 403 error only happened, when a PIN was used and the car was not charging.

So what should be fixed is the way evcc deals with the output from the FIAT-servers when no charging is going on. The charging part was always fine and needed no behavior change.

@SolarPowerEV
Copy link
Sponsor Contributor

SolarPowerEV commented May 5, 2024

Maybe this matrix makes it a bit clearer:

0.124.10:
1A: no pin & not charging → fine
1B: no pin & charging → ok - but no real time SoC update
2A: pin & not charging → 403-error message
2B: pin & charging → fine - and real time SoC updates

So what should be addressed is only the case 2A. So that one can have the PIN in the evcc.yaml without getting any error messages when the car is not connected and charging.

But it seems to me though as if you have worked on changing the behavior of 2B. Which doesn't solve the 403-issue I experience as a simple user of evcc.

@SolarPowerEV
Copy link
Sponsor Contributor

SolarPowerEV commented May 5, 2024

Addendum:
0.125.0:
2A: pin & not charging → 500-error message

0.126.0:
2A: pin & not charging → 500-error message

0.126.1:
complete template failure

0.126.2:
2A: pin & not charging → 500-error message

Before the handling of the "not-charging" status isn't fixed, installing the new version on my Synology doesn't make any sense for me, because I only risk messing up a working system and reverting back to a previous version is unfortunately a nasty endeavor in the Synology docker environment due to the way the Synology UI works.

@andig
Copy link
Member Author

andig commented May 5, 2024

Template was not created because of faulte PR- now reverted twice.

@andig
Copy link
Member Author

andig commented May 6, 2024

Kann ich leider nicht nachvollziehen. Sowohl 0.124.10 als auch 0.126.2 liefern bei meinem Testfahrzeug mit PIN den gleichen HTTP 500. Mangels Logfile und Zugangsdaten zu dem oben beschriebenen Verhalten gibts leider nichts zu tun :(

@SolarPowerEV
Copy link
Sponsor Contributor

Ich gebe mich geschlagen: Ich habe keine Ahnung, wieso mein Pull-Request faulty sein soll. Die 8 automatischen Checks hat er bestanden. Anscheinend hat auch niemand Interesse daran, mir zu erklären, wo das Problem konkret liegt, das zum "revert" führt.

Selbsterklärend ist das Doku-System definitiv nicht, wenn man selbst als Mensch mit abgeschlossenem Studium und Jahrzehnten in der IT an so vielen Details scheitert. Daher bin ich raus und werde auch nicht wieder versuchen, zur Verbesserung der Doku beizutragen, da Aufwand und Nutzen in keinem vernünftigen Verhältnis stehen, weil selbst so eine kleine und simple Textänderung einen derartigen Rattenschwanz nach sich zieht. Schade, denn ich hätte gerne geholfen, die Doku zu ergänzen. Aber so funktioniert es definitiv nicht.

@SolarPowerEV
Copy link
Sponsor Contributor

SolarPowerEV commented May 7, 2024

Zu dem Fiat-Template selbst:
In der Tat zeigt mir inzwischen auch die alte 0.124.10 einen 500er Error und keinen 403-Error mehr an, wenn man eine PIN einträgt und der Fiat 500e nicht auflädt. Vielleicht hat sich ja auch auf Seite der Fiat-Server diesbezüglich etwas geändert? Früher wurde definitiv ein 403-Fehler angezeigt.

Ist aber auch egal, am Ende ist eine Fehlermeldung eine Fehlermeldung und aus Nutzersicht unschön und die angezeigte Zahl nicht wirklich kriegsentscheidend. Ich verzichte daher weiterhin auf die PIN in meiner evcc.yaml, um Fehlermeldungen zu vermeiden. Und triggere den Refresh des SoC über das Aufrufen der FIAT-App gegen Ende des Ladevorgangs, was dazu führt, dass ein oder zwei Intervalle später dann auch evcc diesen genaueren SoC von den FIAT-Servern übermittelt bekommt.

Da aber anscheinend nicht der Code von evcc nach der 0.124.10 für die neue 500-Fehlermeldung verantwortlich ist, traue ich mich jetzt vermutlich doch daran, auf die 0.126.2 zu updaten. Ich kann dann gerne nochmal Tests mit und ohne PIN durchführen und ein Logfile übermitteln, sobald wieder genug Sonne scheint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants