Closed jlayec closed 1 year ago
Hello, For me it works well. Does it work in the past ?
Hello Yeah ! I did some modifications in the code and started the hybrid car work đ I dont know what happened! But these fields are now empty. Hope that peugeot is not removing fields that are not mandatory for their mobile app. Hope i will get back position soon! But to be honest i m pessimistic
The app use swagger codegen to generate the sdk to connect to the API. In some case if the openapi spec isn't correct it can lead to the problem you describe. Can you use a proxy like mitmproxy to see if the message received by the app is received without those informations ? You just have to install and launch it, then edit config.json file to add the proxy :
"proxies": {
"http": "http://localhost:8080",
"https": "http://localhost:8080"
}
Then test a request to see if information's are missing.
Thanks for your reply. Just checked the proxy dump and "kinetic" and "last_position" fields are not present in the answer from psa servers.
GET https://api.groupe-psa.com/connectedcar/v4/user/vehicles/xxx/status?extension=odometer&client_id=xxx
{
"preconditionning": {
"airConditioning": {
"updatedAt": "2021-03-23T18:07:55Z",
"status": "Disabled"
}
},
"energy": [
{
"updatedAt": "2021-03-23T18:07:55Z",
"type": "Electric",
"level": 62,
"autonomy": 32,
"charging": {
"plugged": false,
"status": "Disconnected",
"chargingRate": 0,
"chargingMode": "Slow",
"nextDelayedTime": "PT0S"
}
},
{
"updatedAt": "2021-03-23T18:07:55Z",
"type": "Fuel",
"level": 0,
"autonomy": 470
}
],
"createdAt": "2021-03-23T18:07:55Z",
"battery": {
"voltage": 87.5,
"current": 0,
"createdAt": "2021-03-23T18:07:55Z"
},
"privacy": {
"createdAt": "2021-03-23T18:07:55Z",
"state": "None"
},
"service": {
"type": "Hybrid",
"updatedAt": "2021-03-22T11:32:35Z"
},
"_links": {
"self": {
"href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/xxx/status"
},
"vehicles": {
"href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/xxx"
}
},
"timed.odometer": {
"createdAt": null,
"mileage": xxxxx.x
},
"updatedAt": "2021-03-23T18:07:55Z"
}
Ok, can you try the request without the extension=odometer parameter?
I already tried last weekend as per the note in the API documentation. I did it again today and the result is the same unfortunately. Apparently the extension request is not needed as we still receive the odometer.
2021-03-24 07:36:09 GET https://api.groupe-psa.com/connectedcar/v4/user/vehicles/xxx/status?client_id=xxx
â 200 OK application/hal+json 1.3k 1.42s
Host: api.groupe-psa.com
Accept-Encoding: identity
Accept: application/hal+json
User-Agent: Swagger-Codegen/4.0/python
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxx
x-introspect-realm: clientsB2CPeugeot
Content-Type: application/json
client_id: xxxxxxxxxxxxxxxxxxxxx
{
"preconditionning": {
"airConditioning": {
"updatedAt": "2021-03-23T23:56:55Z",
"status": "Disabled"
}
},
"energy": [
{
"updatedAt": "2021-03-23T23:56:55Z",
"type": "Electric",
"level": 64,
"autonomy": 32,
"charging": {
"plugged": false,
"status": "Disconnected",
"chargingRate": 0,
"chargingMode": "Slow",
"nextDelayedTime": "PT0S"
}
},
{
"updatedAt": "2021-03-23T23:56:55Z",
"type": "Fuel",
"level": 0,
"autonomy": 470
}
],
"createdAt": "2021-03-23T23:56:55Z",
"battery": {
"voltage": 87.5,
"current": 0,
"createdAt": "2021-03-23T18:07:55Z"
},
"privacy": {
"createdAt": "2021-03-23T23:56:55Z",
"state": "None"
},
"service": {
"type": "Hybrid",
"updatedAt": "2021-03-22T11:32:35Z"
},
"_links": {
"self": {
"href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/xxx/status"
},
"vehicles": {
"href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/xxx"
}
},
"timed.odometer": {
"createdAt": null,
"mileage": xxxxx.x
},
"updatedAt": "2021-03-23T23:56:55Z"
}
What's the car model?
here it is. What is strange : it was working before :â(
[
{
"vin": "VF3xxx",
"vehicle_id": "xxx",
"label": "SUV 3008",
"brand": "Peugeot",
"battery_power": 10.8,
"fuel_capacity": 43,
"max_elec_consumption": 70,
"max_fuel_consumption": 30
}
]
Ok so it can be related to hybrid or 3008. . .
yes... at least mine but maybe other cars soon...
I suppose you don't have your position in mypeugeot?
When you start the server you should received an mqtt message on this topic: mqtt msg psa/RemoteServices/to/cid/XXXXXXXXX/VehicleState Does this message contains the car position ?
I suppose you don't have your position in mypeugeot?
I observed that the position in the app is updated through bluetooth and not through the API. Easy test - switch off bluetooth.
When you start the server you should received an mqtt message on this topic: mqtt msg psa/RemoteServices/to/cid/XXXXXXXXX/VehicleState Does this message contains the car position ?
python3 server.py -l 0.0.0.0 --debug DEBUG
2021-03-26 09:43:51,301 :: INFO :: server start
2021-03-26 09:43:53,810 :: INFO :: ["{'vin': 'VF3xxx', 'vehicle_id': 'xxx', 'label': 'SUV 3008', 'brand': 'Peugeot', 'battery_power': 10.8, 'fuel_capacity': 43, 'max_elec_consumption': 70, 'max_fuel_consumption': 30}"]
2021-03-26 09:43:55,847 :: DEBUG :: refresh_remote_token: {'scope': 'psaCustomerId psaMqttService', 'expires_in': 899, 'token_type': 'Bearer', 'access_token': 'xxx', 'refresh_token': 'xxx'}
2021-03-26 09:43:55,920 :: INFO :: ask state to VF3xxx
2021-03-26 09:43:56,060 :: INFO :: Connected with result code {'session present': 0}
2021-03-26 09:43:56,060 :: INFO :: subscribe to psa/RemoteServices/to/cid/xxx/#
2021-03-26 09:43:56,061 :: INFO :: subscribe to psa/RemoteServices/events/MPHRTServices/VF3xxx
2021-03-26 09:43:56,163 :: INFO :: {"access_token": "xxx", "customer_id": "xxx", "correlation_id": "xxx", "req_date": "2021-03-26T09:43:56Z", "vin": "VF3xxx", "req_parameters": {"action": "state"}}
2021-03-26 09:43:56,166 :: INFO :: save config change
2021-03-26 09:43:56,168 :: WARNING :: Can't get language
2021-03-26 09:43:56,417 :: INFO :: mqtt msg psa/RemoteServices/to/cid/xxx/VehicleState/ProcessManagement b'{"process_date":"2021-03-26T09:43:56Z","vin":"VF3xxx","correlation_id":"xxx","process_code":"900","process_message":"Your request has been accepted and is being processed"}'
2021-03-26 09:43:56,418 :: DEBUG :: mqtt msg hasn't return code
2021-03-26 09:43:56,473 :: INFO :: mqtt msg psa/RemoteServices/to/cid/xxx/VehicleState b'
{
"resp_date": "2021-03-26T09:43:56Z",
"vin": "VF3xxx",
"correlation_id": "xxx",
"return_code": "0",
"location": {
"dop": {
"h": 1.7,
"p": 1.9,
"v": 0.9,
"valid_h": true,
"valid_p": true,
"valid_v": true
},
"dr": {
"heading": xxx.xxx,
"latitude": xxx.xxx,
"longitude": xxx.xxx,
"speed": 0,
"valid_hdg": true,
"valid_lat": true,
"valid_lng": true,
"valid_spd": true
},
"gnss": {
"altitude": xxx.xxx,
"error_altitude": 3.35,
"error_h_position": 3.65,
"error_v_speed": 0.09,
"fix_status": 3,
"heading": xxx.xxx,
"latitude": xxx.xxx,
"longitude": xxx.xxx,
"speed": 0,
"timestamp": "2021-03-19T14:46:13Z",
"valid_alt": true,
"valid_err_alt": true,
"valid_err_hps": true,
"valid_err_spd": true,
"valid_hdg": true,
"valid_lat": true,
"valid_lng": true,
"valid_spd": true
},
"satellites": {
"tracked": 24,
"used": 9,
"valid_trk": true,
"valid_usd": true,
"valid_vis": true,
"visible": 28
}
},
"resp_data": {
"date": "2021-03-26T09:15:22Z",
"etat_res_elec": 5,
"precond_state": {
"available": 1,
"programs": {
"program1": {
"hour": 34,
"minute": 7,
"on": 0,
"day": [
0,
0,
0,
0,
0,
0,
0
]
},
"program2": {
"hour": 34,
"minute": 7,
"on": 0,
"day": [
0,
0,
0,
0,
0,
0,
0
]
},
"program3": {
"hour": 34,
"minute": 7,
"on": 0,
"day": [
0,
0,
0,
0,
0,
0,
0
]
},
"program4": {
"hour": 34,
"minute": 7,
"on": 0,
"day": [
0,
0,
0,
0,
0,
0,
0
]
}
},
"asap": 0,
"status": 0,
"aff": 1
},
"charging_state": {
"program": {
"hour": 0,
"minute": 0
},
"available": 1,
"remaining_time": 635,
"rate": 0,
"cable_detected": 1,
"soc_batt": 79,
"autonomy_zev": 36,
"type": 0,
"aff": 1,
"hmi_state": 0,
"mode": 0
},
"vin": "VF3xxx",
"reason": 2,
"signal_quality": 5,
"sev_stop_date": "2021-03-26T09:15:22Z",
"fds": [
"xxx",
"xxx",
"xxx",
"xxx",
"xxx",
"xxx",
"xxx"
],
"sev_state": 0,
"timestamp_gnss": 1616165173, /* ===>>> 19/3/2021 Ă 14:46:13 */
"obj_counter": 11,
"privacy_customer": 0,
"privacy_applicable": 0,
"privacy_applicable_max": 1,
"superlock_state": 0
}
}
'
2021-03-26 09:43:59,053 :: INFO :: update_data
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
It seems that the location was not updated for a while.
And I mot alone now : https://github.com/flobz/psa_car_controller/issues/54
What are the privacy fields output for your car?
Mine are
"privacy_customer": 0,
"privacy_applicable": 0,
"privacy_applicable_max": 1,
"superlock_state": 0
I suppose you don't have your position in mypeugeot?
I observed that the position in the app is updated through bluetooth and not through the API. Easy test - switch off bluetooth.
I think it depends of your car. If you have the Peugeot SOS option, you have a gps.
I suppose you don't have your position in mypeugeot?
I observed that the position in the app is updated through bluetooth and not through the API. Easy test - switch off bluetooth.
I think it depends of your car. If you have the Peugeot SOS option, you have a gps.
I have Peugeot SOS option.
Everything was ok before in the API, the problem appeared 19/3/2021 Ă 14:46:13
Even when the API got the position, the app location was not updated if not connected with bluetooth. I m using 2 phones and the one not connected with bluetooth is able to remote control Preconditionning & Charge of the car and get level / autonomy but doesn't have car position updated.
Ok can you confirm that car position is present in mqtt messages? I will check my privacy settings later.
Ok can you confirm that car position is present in mqtt messages? I will check my privacy settings later.
well yes but values were not updated since I encountered the problem
"dr": {
"heading": xxx.xxx,
"latitude": xxx.xxx,
"longitude": xxx.xxx,
"speed": 0,
"valid_hdg": true,
"valid_lat": true,
"valid_lng": true,
"valid_spd": true
},
"gnss": {
"altitude": xxx.xxx,
"error_altitude": 3.35,
"error_h_position": 3.65,
"error_v_speed": 0.09,
"fix_status": 3,
"heading": xxx.xxx,
"latitude": xxx.xxx,
"longitude": xxx.xxx,
"speed": 0,
"timestamp": "2021-03-19T14:46:13Z",
There is a problem somewhere... and now seems that I m not alone...
My privacy settings:
"privacy_customer":0,"privacy_applicable":0,"privacy_applicable_max":2,"
my timestamp_gnss is old too : 27/1/2021:8:03:15 Well, it seems to be a car problem. You could maybe go see your mechanic.
I have the following error with your branch:
(.env) psa_remote@FLOAPP-PEUGEOT:/usr/local/src/psa_car_controller $ python3 app_decoder.py ~/mypeugeot_1.28.apk
APK loading...
Requested API level 29 is larger than maximum we have, returning API level 28 instead.
RES_TABLE_LIBRARY_TYPE chunk is not supported
RES_TABLE_LIBRARY_TYPE chunk is not supported
APK loaded !
MyPeugeot email: mail
MyPeugeot password: password
What is your country code ? (ex: FR, GB, DE, ES...)
BE
Can't get car model please check cars.json
Traceback (most recent call last):
File "app_decoder.py", line 151, in <module>
label = vehicle["short_label"].split(" ")[-1]
KeyError: 'short_label'
Any idea? Thanks. Florent
I have the following error with your branch:
(.env) psa_remote@FLOAPP-PEUGEOT:/usr/local/src/psa_car_controller $ python3 app_decoder.py ~/mypeugeot_1.28.apk APK loading... Requested API level 29 is larger than maximum we have, returning API level 28 instead. RES_TABLE_LIBRARY_TYPE chunk is not supported RES_TABLE_LIBRARY_TYPE chunk is not supported APK loaded ! MyPeugeot email: mail MyPeugeot password: password What is your country code ? (ex: FR, GB, DE, ES...) BE Can't get car model please check cars.json Traceback (most recent call last): File "app_decoder.py", line 151, in <module> label = vehicle["short_label"].split(" ")[-1] KeyError: 'short_label'
Any idea? Thanks. Florent
hello. please submit a new issue - it is not the same problem here. I don't know if flobz can hide the last message to keep a clean thread.
I used the branch that you mentioned to me and my issue was closed, it is why I posted here ;)
I have the following error with your branch:
(.env) psa_remote@FLOAPP-PEUGEOT:/usr/local/src/psa_car_controller $ python3 app_decoder.py ~/mypeugeot_1.28.apk APK loading... Requested API level 29 is larger than maximum we have, returning API level 28 instead. RES_TABLE_LIBRARY_TYPE chunk is not supported RES_TABLE_LIBRARY_TYPE chunk is not supported APK loaded ! MyPeugeot email: mail MyPeugeot password: password What is your country code ? (ex: FR, GB, DE, ES...) BE Can't get car model please check cars.json Traceback (most recent call last): File "app_decoder.py", line 151, in <module> label = vehicle["short_label"].split(" ")[-1] KeyError: 'short_label'
Any idea? Thanks. Florent
It's seems that's the car model isn't returned... I will changethe code to handle this error.
@jlayec still the same problem ?
I think there is a major issue with Peugeot API actually. In other services like Tronity.io, I can't see any trip information since Mar 23 because they are unable to retrieve location, maybe it could be related ?
In API reply I see this (timestamp is like yours) :
"gnss":{
"altitude":7.3,
"error_altitude":2.81,
"error_h_position":3.53,
"error_v_speed":0.09,
"fix_status":3,
"heading":**********,
"latitude":**********,
"longitude":**********,
"speed":0,
"timestamp":"2021-01-26T16:37:24Z",
In dashboard I see this :
last_position updated_at "2021-03-24 16:57:28+00:00"
Tronity.io support answer (regarding my support ticket for my own car) :
there is a problem with some cars at Peugeot. The problem is that we got the last GPS Update at
2021-03-24 17:57. This is the reason why no trips are created. We wrote Peugeot about this issue
but still no feedback. We can't do much about it.
I have similar issue: "last_position": null, "timed_odometer": null. In "gnss" (and in "dr") there is valid position, with "timestamp": "2021-03-15T12:35:06Z". But it didn't work before that either. My privacy settings are the same as flobz. It's a Peugeot e-208. The SatNav, Live traffic, My Peugeot app, etc has always worked, so I can't really complain at Peugeot. ( I tried, but they said everything is OK...). If anybody has found a possible solution, please let me know. Otherwise, as more and more people are affected, I hope PSA will do something on their side, which will solve it for everyone eventually.
On my side, I have "privacy": {"state": "None"} but it is activated on my car:
Well I opened a ticket last Friday through Peugeot customer service. They asked me to send some logs from MyPeugeot iOS app with a specific procedure.
I have similar issues on MyPeugeot app, so I'm quite sure that it is related to API v4 :
I will inform you as soon as I get some information from their technical support.
@Flodu31 Where do you see "privacy : None" ?
In my case, in resp_data section of the JSON, I have this :
"privacy_customer":0,
"privacy_applicable":0,
"privacy_applicable_max":2
When you change values on your screen capture, my "privacy_applicable" changes :
@CalicodesIles sur l'url http://localhost:5000/get_vehicleinfo/vin
OK so I have the same result as you with a "None" value.
I think that you should rely on what comes from PSA mqtt information (from activity.log) to confirm which privacy features are received from your car.
@jlayec still the same problem ?
Yes of course but didn t have time for further investigations last week. For sure now i m not alone and seems we are more everydays. I will not giveup so easily đ
Count me in. Newest version of the server successfully catches the missing data and now tells me with a sad ERROR: on the start of the line that the api is missing kinetic and last_position on my side. Peugeot e-208 GT, DE country code, all privacy settings correctly set aka same as flobz' ones. Rest works flawless. Last position update I got was from 2021-03-29T05:16:10Z. Then it stayed there for a few days. Now the data is gone completely. Android app does sort of work fine though. Sometimes it hangs with newer GPS data, but right now it shows correct data on Android app, but server aka API says null.
Hello All,
My car is a Peugeot e-208. I'm using a fairly old version of @flobz 's original psa_server (around late november) and was getting GPS position reliably through the get_vehicleinfo/VIN API (last_position object). Suddenly, on March 27th at around 4 pm....it stopped giving GPS position updates back: the last GPS position at the "freeze time" is still sent, but not updated (the other informations are still updated).
What might be of interest is that, around the same time, I received an email confirmation by Peugeot that the free "Télémanaintenance" service add been activated (I had subscribed to it the day before). Strange coincidence of events, no ?
I didn't do many investigations apart from checking and toggling the privacy settings on the car's UI (see @Flodu31's photo above) to see if it unlocked the situation : no result. Restarting the psa_server also has no effect either.
The trip information available in the MyPeugeot Andoid App seems to be correct (correct start and end positions)
Not sure this is decisive information, but I hope it can help. Rgds
The location data in the Smartphone App is trasmitted via Bluetooth which makes it completly independent from the one sent via the API.
I heard that disconnecting the 12V battery for some minutes helped some people when having connectivity issues for pre heating and charge control. Maybe this could also help here...
@xammmue Well already tried. Indeed the value changed (was 100%, went to 0% then later at a value which was not the real one).
@Pgr73 I subscribed this option "Télémaintenance" around the date where issues began. On a forum (AP), it seems that there are some people which got the same issue with their MyPeugeot app, so there are chances that it is related. One of them succeed in cancelling his subscription by calling the support, and he was able to make the app work again correctly within a few days.
Already mentioned that. But same here. Activated Telemaintenance and everything falls apart a few hours later...
Already mentioned that. But same here. Activated Telemaintenance and everything falls apart a few hours later...
Morning, same for me, New Peugeot e-208.
Quite funny as this is no flobz' server problem. Anyways. Maybe collecting here is a good idea for others coming by. Anyways, contacted german support and fired words like PSA API v4 and last_position = null and kintectic = null and he gave up. He collected some information and will send me a email in which I can add all information I have and then it will be passed over to their IT. Keeping you updated
Not much news yet.. Got a auto reply that my information were passed over to tech support and a mail that it's being processed now. That was 4 days ago. Nothing more and I am very sure not much more will come up. If they don't reply until Friday I will try the support disables Telemaintenance way. I was already told that this indeed is possible. Maybe someone wants to try who does not have to give Peugeot a reasonable response time first? ^^
@flobz What are all these other weblinks about, like https://api.groupe-psa.com/connectedcar/v4/user/vehicles/%ID%/lastPosition ? Any chance these give use some useful information? There are more like these. alerts, trips, telemetry, maintenance and status, Likely these are the ones the app uses, but that most likely will not help, too as the app on my Tablet and not BT connected to the car has no position at all all the time...
I had a look at the other endpoints. My car position is currently stuck since the services activated. I can confirm that https://api.groupe-psa.com/connectedcar/v4/user/vehicles/%ID%/lastPosition still returns the false position. Same for status. Alerts, trips and Telemetry return internal server error. Maintenance returns the following
{
"updatedAt": "2021-04-13T16:38:19Z",
"_links": {
"alerts": {
"href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/{vehicleId}/alerts"
},
"self": {
"href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/{vehicleId}/maintenance"
},
"vehicles": {
"href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/{vehicleId}"
}
}
}
Updated at is the time of the last car update (when I arrived home).
Hello
Chronology for my car is the following
As per my chronology : the activation or not of telemaintenance service is not related to last_position lost but maybe a major release upgarde in PSA servers (in relation with telemaintenance service availability?) deleted these precious fields in the API! My fear is that all cars will be impacted soon...
We have to wait PSA answer to @dreimer1986 's mail.
It was different for me
Just a little update đ
I received a mail 2 days ago from Peugeot, telling me that my problems will be solved. I just need to use my car for several 20-min trips, in order to update over-the-air my "Telematic box".
I have done this today, and starting the 2nd trip, MyPeugeot and psa_connected_car were able to retrieve vehicle status information as before (charging status, battery level), knowing that the "Télémaintenance" option still subscribed.
After few weeks without service, and several trips and charges, I confirm that it works better.
One thing seems to be still broken for the moment : Trips. Tronity and psa_connected_car doesn't seem to detect anything, maybe because GPS information is not retrieved correctly. In MyPeugeot app, it's still retrieved correctly as the information is downloaded from the car directly through Bluetooth.
Got a reply. Translated with DeepL.
Thank you for your patience.
From the technical department I have received the message that the problem is known and our technicians are working on a solution. This will be made available to you via the next update.
I hope to have helped you with this and wish you a nice day and a good trip.
With kind regards
So let's wait for the update then ^^
i hame tha same problem no position in get_vehicle request, when i start the server i have this privacy setting response
,"privacy_customer":0, "privacy_applicable":0, privacy_applicable_max":2
but in my car (E-C4) i have authorized everything (postion and data)
can you help me?
i hame tha same problem no position in get_vehicle request, when i start the server i have this privacy setting response
,"privacy_customer":0, "privacy_applicable":0, privacy_applicable_max":2
but in my car (E-C4) i have authorized everything (postion and data)
can you help me?
Hi, Unfortunately you are not alone. We are all waiting an answer from PSA tech support to dreimer1986. In the meantime you just have to wait and can't do nothing. The code was updated to handle this situation (most features are working).
Got a reply. Translated with DeepL.
Thank you for your patience.
From the technical department I have received the message that the problem is known and our technicians are working on a solution. This will be made available to you via the next update.
I hope to have helped you with this and wish you a nice day and a good trip.
With kind regards
So let's wait for the update then ^^
Well, I already got one. We wait for a fix in their car OS.
Also others have the problem. First post on this side: https://www.goingelectric.de/forum/viewtopic.php?f=317&t=66667&sid=09e74291f98d3cbec77f68d61d30386b&start=110
Describe the bug "kinetic" and "last_position" fields are empty in json answer of get_vehicleinfo/VIN Am I alone?
To Reproduce Steps to reproduce the behavior:
python3 server.py -l 0.0.0.0 --debug DEBUG
Here is the output of the API
I confirm that the privacy configuration in vehicle is share data and position (was not changed and was working before).