phev2mqtt icon indicating copy to clipboard operation
phev2mqtt copied to clipboard

2020 PHEV connection issues.

Open SelfDestructor opened this issue 2 years ago • 4 comments

Hi!

I've just set up phev2mqtt and have gotten it connected to Home Assistant and everything shows up and seems to be reading properly for about a minute or two but after that it all becomes unavailable.

I'm also not able to turn on anything. If I do, it flips back off and the logs says the following:

level=info msg="Topic: [phev/set/parkinglights] Payload: [on]" level=info msg="Error setting register 0xb: timed out attempting to set register 0b"

It eventually fails and disconnects.

level=error msg="Disconnecting due to too many errors" level=info msg="Error setting register 0xb: timed out attempting to set register 0a" level=info msg="%PHEV_TCP_CONNECTED%" level=debug msg="%%PHEV_START_AWAIT%%"

Once it connects again, it runs and endless loop of level=debug msg="%PHEV_TCP_SEND_MSG%: [00] PING REQ (id 1)" and the "id" keeps going up and up until it does level=debug msg="%%PHEV_START_TIMEOUT%%" and level=error msg="timed out waiting for start"

While watching the logs, I also noticed that this just popped in:

level=debug msg="%%PHEV_TCP_READER_ERROR%%: read tcp 192.168.8.47:40010->192.168.8.46:8080: i/o timeout" level=debug msg="%PHEV_TCP_READER_CLOSE%" level=debug msg="%PHEV_TCP_SEND_MSG%: [00] PING REQ (id 3b)" level=error msg="%PHEV_TCP_WRITER_ERROR%: write tcp 192.168.8.47:40010->192.168.8.46:8080: use of closed network connection" level=debug msg="%PHEV_TCP_WRITER_CLOSE%"

After rebooting I randomly get level=error msg="dial tcp 192.168.8.46:8080: connect: connection refused" and it doesn't reconnect to the car unless I reboot the Pi.

Do you have any advice on how to troubleshoot this further or fix this?

SelfDestructor avatar Mar 28 '23 16:03 SelfDestructor

I have made various stability/mqtt/log fixes in my repo https://github.com/altserg/phev2mqtt The repo is not yet synced with main but it already has most of recent fixes ported manually. Can you try it and let me know if it works better for you ? If confirmed to work stable, I will re-create the branch from scratch and push my changes in a nice manner

altserg avatar Mar 14 '25 09:03 altserg

Hello! I will spin up a Pi this weekend or some time next week and give it a try. I'll keep you updated :)

SelfDestructor avatar Mar 14 '25 14:03 SelfDestructor

I have not been able to find my spare Pi so I haven't been able to test it yet. :(

SelfDestructor avatar Mar 24 '25 18:03 SelfDestructor

This issue should be solved by placing RPi close to the vehicle (in my case distance about 6m and 3 walls in between caused very instable connection with similar symptoms), and series of latest patches.

Please check and close the issue if it's solved

altserg avatar May 16 '25 08:05 altserg