flobz / psa_car_controller

Control psa car with connected_car v4 API.
GNU General Public License v3.0
403 stars 210 forks source link

OTP not more working at least for my Citroen account #545

Closed lvenditti closed 1 year ago

lvenditti commented 1 year ago

Describe the bug when containerized version start have these errors on log:

Containerised psa_car_controller loading...

2023-05-03 11:48:49,023 :: INFO :: ["{'vin': 'VR7BCZKXCMEXXXXX', 'vehicle_id': '18fc49fc8645bb7696ac42d881c6820ab5ae428a9a6XXXXXXXXXXc86c38f8de8fa7eb213a6f77fefa0886afb2a93774e67ff0716c126e2324c0cfaf234e7d7edd095afa3ab25608adade5bce5yyyyyyyyyyyyyyyyyyyyyyyyyyy', 'label': 'E-C4', 'brand': 'Citroën', 'abrp_name': 'citroen:ec4:21:50', 'battery_power': 46, 'fuel_capacity': 0, 'max_elec_consumption': 70, 'max_fuel_consumption': 0}"]

2023-05-03 11:48:49,509 :: ERROR :: remote_refresh_token isn't defined

2023-05-03 11:48:50,569 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'}

2023-05-03 11:48:50,570 :: ERROR :: get_otp_code:

Traceback (most recent call last):

File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 193, in get_otp_code

otp_code = self.otp.get_otp_code()

File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/otp/otp.py", line 276, in get_otp_code

raise ConfigException("Can't get otp code")

psa_car_controller.psa.otp.otp.ConfigException: Can't get otp code

2023-05-03 11:48:50,574 :: ERROR :: Please redo otp config

2023-05-03 11:48:51,550 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'}

2023-05-03 11:48:51,552 :: ERROR :: start_remote_control failed redo otp config

2023-05-03 11:48:51,555 :: INFO :: save config change

2023-05-03 11:48:51,564 :: WARNING :: Can't get language

2023-05-03 11:48:52,944 :: INFO :: update_data

2023-05-03 11:48:55,248 :: INFO :: * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

2023-05-03 11:49:19,642 :: INFO :: new position recorded for VR7BCZKXCMxxxxxxx

2023-05-03 11:49:19,644 :: INFO :: update_data

To Reproduce just restarting the docker container it persist after recreate config by going to http://server_address:port/config

Config file { "abrp": { "abrp_enable_vin": [], "token": "" }, "client_id": "5364defc-80e6-447b-bec6-4aXXXXXXXXXX", "client_secret": "iE0cD8bB0yJ0dS6rO3nN1hI2wU7uA5xR4gP7lD6vXXXXXXXXXX", "co2_signal_api": null, "country_code": "IT", "customer_id": "AC-ACNT2000050Zyzyzxzyz", "proxies": { "http": "", "https": "" }, "realm": "clientsB2CCitroen", "refresh_token": "416b99d8-887c-4827-8acd-kkkkkkkkkkkk", "remote_refresh_token": null, "weather_api": null }

Environment (please complete the following information):

Additional context nevertheless these log errors the battery level and mileage are correctly reported on control TAB ,but no position, non trips no charge are reported or partially reported.

lvenditti commented 1 year ago

I installed all things from scratch, did a new OTP (tried also a newer version of mycitroen APK). The OTP process goes fine, but on the log file I have: 2023-05-05 12:19:32,540 :: ERROR :: remote_refresh_token isn't defined 2023-05-05 12:19:33,384 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'} 2023-05-05 12:19:33,388 :: ERROR :: get_otp_code: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 193, in get_otp_code otp_code = self.otp.get_otp_code() File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/otp/otp.py", line 276, in get_otp_code raise ConfigException("Can't get otp code") psa_car_controller.psa.otp.otp.ConfigException: Can't get otp code 2023-05-05 12:19:33,390 :: ERROR :: Please redo otp config 2023-05-05 12:19:34,262 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'} 2023-05-05 12:19:34,264 :: ERROR :: start_remote_control failed redo otp config 2023-05-05 12:19:34,267 :: INFO :: save config change 2023-05-05 12:19:34,279 :: WARNING :: Can't get language 2023-05-05 12:19:34,279 :: WARNING :: Can't get language 2023-05-05 12:19:35,682 :: INFO :: update_data 2023-05-05 12:19:38,052 :: INFO :: * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

cgsyannick commented 1 year ago

Same here since two days but with Opel :

2023-05-10 12:18:11,002 :: INFO :: save config change
2023-05-10 12:18:24,788 :: ERROR :: Error during activation: {'newversion': '2.0.0', 'newversionurl': 'http://m.inwebo.com/', 'err': 'NOK:FORBIDDEN'}
2023-05-10 12:18:25,050 :: ERROR :: remote_refresh_token isn't defined
2023-05-10 12:18:25,470 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'}
2023-05-10 12:18:25,471 :: ERROR :: get_otp_code:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/RemoteClient.py", line 193, in get_otp_code
    otp_code = self.otp.get_otp_code()
  File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/otp/otp.py", line 276, in get_otp_code
    raise ConfigException("Can't get otp code")
psa_car_controller.psa.otp.otp.ConfigException: Can't get otp code
2023-05-10 12:18:25,474 :: ERROR :: Please redo otp config
2023-05-10 12:18:25,897 :: ERROR :: Error during activation: {'err': 'NOK:FORBIDDEN'}
2023-05-10 12:18:25,898 :: ERROR :: start_remote_control failed redo otp config

Of course, redoing the otp config dont fix anything, despite the "success" message. I think the OTP feature is dysfunctioning since the last Android app update (API change ?)...

Aapjedotinfo commented 1 year ago

Agree, i encounter the same issue since the new updates of PSA with an Opel Corsa.

Getting this error after i 'sucessfully' entered the otp code on a fresh Docker install... It did fetch the latest charge status (does it once), but does not record anything else nor is anything working without getting this error:

psa_car_controller.psa.otp.otp.ConfigException: Can't get otp code

lvenditti commented 1 year ago

Agree, i encounter the same issue since the new updates of PSA with an Opel Corsa.

Getting this error after i 'sucessfully' entered the otp code on a fresh Docker install... It did fetch the latest charge status (does it once), but does not record anything else nor is anything working without getting this error:

psa_car_controller.psa.otp.otp.ConfigException: Can't get otp code

Exactly the same behavior for my Citroen E-C4

flobz commented 1 year ago

read the FAQ

GeraldPape commented 1 year ago

Why do I get all green in User Config and OTP config, but still getting this error? Reading the FAQ does not help, as again in the UI everything is green, but the error keeps coming back. So reading the FAQ is not of any help. So what can I do, to redo the OTP and realy ensure that it worked this time? What should be in the log to declare success?