homeassistant-solax-modbus icon indicating copy to clipboard operation
homeassistant-solax-modbus copied to clipboard

[Bug]: socket.send() raised exception.

Open vitjurasek opened this issue 11 months ago • 27 comments

Describe the bug

After updating to the new version of core HA (2024.3.1), a problem with this integration started to appear - on the desktop, after a while the update of values from the inverter freezes and resumes only after restarting HA.

In log:

Logger: asyncio Zdroj: custom_components/solax_modbus/init.py:380 integrace: SolaX Inverter Modbus (dokumentace, problémy) První výskyt: 11:00:52 (192 výskyty) Naposledy logováno: 12:57:32

socket.send() raised exception.

Integration Version

2024.03.1

Homeassistant core version

2024.3.1

Inverter brand

solax g4 x3-hybrid

Plugin used

plugin_solax.py

Serial prefix

H34A10

Inverter firmware versions

?

Connection Method

Socket

Dongle firmware

?

Detailed Error Log

No response

Additional context

No response

vitjurasek avatar Mar 16 '24 12:03 vitjurasek

I have the exact same problem, but with a solax x1 hybrid 5.0

Joerivanrokeghem avatar Mar 16 '24 14:03 Joerivanrokeghem

Same here. But you can do a reload of the integration (iso complete HA reboot). But it will only function for a short while before it hangs again.

Karssi avatar Mar 16 '24 15:03 Karssi

I have just released 2024.03.2 which forces pyModbus to v3.6.6 v3.6.5 and v3.6.6 have quite a few fixes for various communication related issues by the look. I'm not getting any of these errors people are encounting so I don't know how much of an improvement v3.6.6 will make.

Edit: I would also recommend downloading the update through HACS removing the integration from the Integration page, restarting HA and adding it in again. To ensure there isn't any left over configuration prior to 2024.03.1 stored in the cache.

wills106 avatar Mar 16 '24 17:03 wills106

Hi @wills106

I juist dit the update 15 minutes ago and it is seems to work now.

Thanks!

Joerivanrokeghem avatar Mar 16 '24 18:03 Joerivanrokeghem

I still have the problem I have deleted Solax, then restart HA and download Solax again, but its still frezees after few min IMG_1653

https://github.com/wills106/homeassistant-solax-modbus/assets/127571142/5c53d7e2-7b16-488d-afb1-8811d08cbe75

WebberXX avatar Mar 17 '24 06:03 WebberXX

IMG_1656

WebberXX avatar Mar 17 '24 07:03 WebberXX

New version not work for me. The integration still freeze

vitjurasek avatar Mar 17 '24 08:03 vitjurasek

The error sounds to me like incorrect use of the lock() function

Zwer2k avatar Mar 17 '24 19:03 Zwer2k

Hi,

I experienced as well communicaiton problems with my SolaX inverter. I am using Core 2024.3.1 Supervisor 2024.03.0 and OS 12.1. I found that latest version without issue for me is 2024.02.5. I tested removing prior installing (with rebootings) without sucess.

Maybe it is unrelated but my other modbus sensors in configuration.yaml get freeze as well if I update SolaX component.

Not sure if this will help but SolaX component manifest states pymodbus>=3.6.6 however my installation reports pymodbus 3.6.5

I followed these commands to get pymodbus version:

docker exec -it homeassistant /bin/bash pip show pymodbus

Is it possible that there is some incompatibility around here?

Best regards,

PutoPunko avatar Mar 20 '24 11:03 PutoPunko

By forcing version 3.6.6 for the Solax integration, other integrations that use pymodbus and have not yet been adapted for 3.6.6 have problems. Here, for example, huawei_solar integration. However, this has now been adapted https://github.com/wlcrs/huawei_solar/pull/658

Zwer2k avatar Mar 20 '24 22:03 Zwer2k

HA is updating to pyModbus v3.6.6 as well 2024.3.2

wills106 avatar Mar 22 '24 06:03 wills106

The error sounds to me like incorrect use of the lock() function

I have been looking at other integrations using async and they don't seem to be using async with self._lock: as much as this Integration. So perhaps we are over using it?

wills106 avatar Mar 22 '24 06:03 wills106

I have released 2024.03.7b1 which only uses async with self._lock: on the refresh of the data and not each async_read element.

Tested ok on my SolaX Gen3 Hybrid, but I'm not having any issues with any of these releases?

wills106 avatar Mar 22 '24 07:03 wills106

Hi,

Updated to 2024.3.2 and SolaX 2024.03.07b1. It looks OK for now :) let's wait some hours to confirm.

@wills106 thanks for your great work.

PutoPunko avatar Mar 22 '24 12:03 PutoPunko

This looks to be the same issue as #816. I've updated to the latest version but I'm still getting frozen data.

simondrake avatar Mar 23 '24 06:03 simondrake

@vitjurasek how are you connecting to your Gen4? Waveshare or PocketWiFi?

wills106 avatar Mar 23 '24 09:03 wills106

Hi,

I had to go back again to 2024.02.05 after testing beta1. It got frozen again after few hours. Good news is that It was no longer freezing my other modbus connections.

PutoPunko avatar Mar 23 '24 09:03 PutoPunko

@PutoPunko How are you connecting to your SolaX Inverter? Waveshare or PocketWiFi?

wills106 avatar Mar 23 '24 09:03 wills106

Modbus TCP over CAT5E cable

PutoPunko avatar Mar 23 '24 09:03 PutoPunko

So your not using a Waveshare adaptor then?

wills106 avatar Mar 23 '24 10:03 wills106

no adaptor direct ETH connection

PutoPunko avatar Mar 23 '24 10:03 PutoPunko

O so you have an older Gen3 like me then. I'm surprised you are having an issue then, I haven't experienced a single issue with mine.

wills106 avatar Mar 23 '24 10:03 wills106

yes SolaX gen3 hybrid. I am experiencing freezes with anything newer than 2024.02.05. I tried uninstalling+rebooting and then installing again unsuccesfully. Maybe It is related to having several modbus TCP devices on my config. None of them are integracions,they are directly configured from my configuration.yaml

PutoPunko avatar Mar 23 '24 10:03 PutoPunko

@wills106 I still have problems!? And it doesn't matter if I use Solax 2024.03.2-2024.03.6 and even beta 2024.03.7b1/2/3

Other systems are Core = 2024.3.3 Supervisor = 2024.03.0 Operating System = 12.1 User interface = 20240307.0

When I reload it works anywhere from a few minutes to 10 minutes then it freezes and has to reload again

No changes were made to my setup between it working perfectly and it suddenly stopping If you're up for it, I'd be happy to create a user so you can log in yourself and look in my system

I'm saddened by this, I've loved your integration, but now I'm just losing my temper

image

WebberXX avatar Mar 23 '24 15:03 WebberXX

If yourself or anyone else is using a Waveshare have a look at this post https://github.com/wills106/homeassistant-solax-modbus/issues/804#issuecomment-2004783893

Either the "Maximum wait time of RS485" or "RS485 bus conflict" settings has helped others.

wills106 avatar Mar 23 '24 15:03 wills106

If people are still having the data freeze after trying the settings in the previous post then try 2024.03.8b1

wills106 avatar Mar 30 '24 08:03 wills106

yes SolaX gen3 hybrid. I am experiencing freezes with anything newer than 2024.02.05. I tried uninstalling+rebooting and then installing again unsuccesfully. Maybe It is related to having several modbus TCP devices on my config. None of them are integracions,they are directly configured from my configuration.yaml

Hi,

I can confirm it works OK for me (modbus TCP) with:

  • SolaX 2024.04.1
  • Core 2024.4.0
  • Supervisor 2024.03.1
  • OS 12.1

Best regards,

PutoPunko avatar Apr 04 '24 11:04 PutoPunko

Are people still having issue or can this be closed now?

wills106 avatar May 18 '24 12:05 wills106

Closing down as no further response. If people are still having an issue feel free to reopen.

wills106 avatar May 26 '24 09:05 wills106