SAIC-iSmart-API/saic-home-assistant-addon

gmqtt warning: "Trying write to closed socket"

Opened this issue · 2 comments

Hi there,

I'm seeing a repeating warning in the logs, the line looks as follows:
2024-07-07 15:25:40,383 [WARNING ] [TRYING WRITE TO CLOSED SOCKET] - gmqtt.mqtt.protocol
For more detail refer to the full log below, taken directly after restarting the addon. The part after [CONNECTION MADE] repeats every 5-6 seconds.
Can I do something to get rid of this warning? Does it indicate something going wrong?
I'm specifically asking because I'm not seeing the correct values in the mqtt topics, while the MG iSmart app actually displays the correct SOC for once.

2024-07-07 15:25:39,433 [  INFO  ] Logging in to SAIC API - __main__
2024-07-07 15:25:40,018 [  INFO  ] Logged in as my.account@email.provider - __main__
2024-07-07 15:25:40,018 [  INFO  ] Fetching vehicle list - __main__
2024-07-07 15:25:40,168 [  INFO  ] Registering for ['ALARM_TYPE_VEHICLE_FAULT', 'ALARM_TYPE_GEOFENCE', 'ALARM_TYPE_VEHICLE_START'] messages. vin=LXXXX0000XX000000 - __main__
2024-07-07 15:25:40,249 [  INFO  ] Registered for ['ALARM_TYPE_VEHICLE_FAULT', 'ALARM_TYPE_GEOFENCE', 'ALARM_TYPE_VEHICLE_START'] messages. vin=LXXXX0000XX000000 - __main__
2024-07-07 15:25:40,250 [ DEBUG  ] SoC of LXXXX0000XX000000 for charging station will be published over MQTT topic: evcc/loadpoints/1/vehicleSoc - __main__
2024-07-07 15:25:40,284 [  INFO  ] Adding job tentatively -- it will be properly scheduled when the scheduler starts - apscheduler.scheduler
2024-07-07 15:25:40,287 [  INFO  ] [CONNECTION MADE] - gmqtt.mqtt.protocol
2024-07-07 15:25:40,381 [ DEBUG  ] [CMD 0x48] b'TP/1.0 403 Forbidden\r\ncontent-type: text/html\r\ncontent-length: 173\r\n\r\n<html><head><m' - gmqtt
2024-07-07 15:25:40,381 [ DEBUG  ] [RECEIVED PUBACK FOR] 21584 - gmqtt
2024-07-07 15:25:40,381 [ DEBUG  ] FREE MID: 21584 - gmqtt.mqtt.utils
2024-07-07 15:25:40,381 [ DEBUG  ] [REMOVE MESSAGE] 21584 - gmqtt
2024-07-07 15:25:40,382 [ DEBUG  ] [CMD 0x65] b'a charset=utf-8 http-equiv="Content-Language" content="en"/><link rel="stylesheet" type="text/css" href="/error.css"' - gmqtt
2024-07-07 15:25:40,382 [ DEBUG  ] [RECEIVED PUBREL FOR] 24864 - gmqtt
2024-07-07 15:25:40,382 [ DEBUG  ] FREE MID: 24864 - gmqtt.mqtt.utils
2024-07-07 15:25:40,382 [ DEBUG  ] [RECV EMPTY] Connection will be reset automatically. - gmqtt.mqtt.protocol
2024-07-07 15:25:40,382 [  INFO  ] [CONN CLOSE NORMALLY] - gmqtt.mqtt.protocol
2024-07-07 15:25:40,382 [ DEBUG  ] [CMD 0xe0] b'' - gmqtt
2024-07-07 15:25:40,383 [WARNING ] [TRYING WRITE TO CLOSED SOCKET] - gmqtt.mqtt.protocol
2024-07-07 15:25:46,392 [  INFO  ] [CONNECTION MADE] - gmqtt.mqtt.protocol

Are more details needed? Please let me know.

Looks like your SAIC credentials are wrong, please remove any special characters from the password and try again.

Thanks for your answer.
The password already consists of only alphanumeric characters (in regex it would be matched by [A-Za-z0-9]). Also I organize my passwords with a password manager and only copy + paste them, so no typos can sneak in. The very same password works alright with the MG iSmart app.

I just reapplied the password setting and restarted the addon, but the log still shows the exact same problem.

Is there anything I can do to further debug the problem? (When programming I like to set breakpoints to see more closely what happens when the problem occurs - but I guess that's not quite possible in this case...)