SAIC-iSmart-API / saic-python-mqtt-gateway

MIT License
67 stars 20 forks source link

FR: Report Error "Remote Instruction Failed," in an MQTT topic #102

Open cybersmart-eu opened 11 months ago

cybersmart-eu commented 11 months ago

Hi,

Yesterday, I just added a second MG (MG4 XPOWER) to my existing MG5 Comfort SR in my SAIC account. Today I found out that no new data is available for the MG5 anymore. Data fo the MG4 is coming in.

My iSmart App also does not scan the MG5 anymore although it worked yesterday. I had a similar issue some weeks ago with no scan possible for 5 days.

The Container Log (I forced a poll) shows the following data: 2023-10-27 20:09:49,738 [ ERROR ] handle_vehicle loop failed during SAIC API call - __main__ Traceback (most recent call last): File "/usr/src/app/./mqtt_gateway.py", line 90, in handle_vehicle vehicle_status = self.update_vehicle_status() File "/usr/src/app/./mqtt_gateway.py", line 110, in update_vehicle_statu vehicle_status_rsp_msg = self.saic_api.get_vehicle_status_with_retry(self.vin_info) File "/usr/local/lib/python3.10/site-packages/saic_ismart_client/saic_api.py", line 193, in get_vehicle_status_with_retry return self.handle_retry(self.get_vehicle_status, vin_info) File "/usr/local/lib/python3.10/site-packages/saic_ismart_client/saic_api.py", line 457, in handle_retry return self.__handle_retry_with_app_data(func, vin_info=vin_info, max_retries=max_retries) File "/usr/local/lib/python3.10/site-packages/saic_ismart_client/saic_api.py", line 499, in __handle_retry_with_app_data raise SaicApiException(f'API request failed after {iteration} retries{additional_info}') saic_ismart_client.exceptions.SaicApiException: API request failed after 4 retries, error message: Die Fernanweisung ist fehlgeschlagen, bitte versuchen Sie es später erneut. 2023-10-27 20:09:49,744 [ INFO ] Updating vehicle status - __main__ 2023-10-27 20:10:06,770 [ INFO ] Updating charging status - __main__

cybersmart-eu commented 11 months ago

New findings, it seems to be independent of second car. However, every now and then this failure message is there for a couple of hours, then it suddenly works again.

What would be great is, whenever this error is identified, a dedicated "Fernanweisung " error topic is set to true unless the error disapears. Thi would allow to identify such an error (which then also means the iSmart App does not allow to scan the car) and track ho long this error persists to maybe find a root cause?

Just an idea. Currently it seems I am the only one with this error (howver, other users already mentioned in other user groups that the iSmart App stopped scanning the car although login was successful).

tosate commented 11 months ago

Hi there,

how often do you drive with the cars? Two weeks ago I was sick and did not leave the house. After a couple of days, the Gateway was always showing me the error message above (Die Fernanweisung ist fehlgeschlagen, bitte versuchen Sie es später erneut.). Even the iSMART App wasn't able to communicate with the car. After the first drive everything went back to normal.

I think the same happens if you query the API too often. This might happen earlier if you are using two cars. Maybe you try to change the values of the refresh intervals.

cybersmart-eu commented 10 months ago

I am driving the car on a regular basis, no idea what the root cause of this (always temporary) issue is.

My FR would be to send message to a dedicated topic for this error, allowing to check that the error occured and record the error and in a database (which then might help better understanding the root cause).

Error detection feature for this specific error

Currently it is more by chance that you detect the error as you need to check the logs.

At least I am not alone with this error.