Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: When trying to connect to EMMA with SUN2000-17K-MB0 I get the following errors #945

Closed
3 of 5 tasks
jgate opened this issue Feb 11, 2025 · 1 comment
Closed
3 of 5 tasks
Labels
bug Something isn't working

Comments

@jgate
Copy link

jgate commented Feb 11, 2025

Describe the issue

I tryied with Slave 0, 1 and AUTO

First error:
Logger: pymodbus.logging
Source: custom_components/huawei_solar/config_flow.py:204
integration: Huawei Solar (documentation, issues)
First occurred: 07:06:40 (4 occurrences)
Last logged: 10:50:28

Failed to connect [Errno 111] Connect call failed ('192.168.1.101', 502)
Failed to connect [Errno 111] Connect call failed ('192.168.1.101', 6607)

Second error:
Logger: huawei_solar.huawei_solar
Source: /usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py:146
First occurred: 07:05:35 (10 occurrences)
Last logged: 10:50:33

Timeout while waiting for connection. Reconnecting
Traceback (most recent call last):
File "/usr/local/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.13/asyncio/locks.py", line 213, in wait
await fut
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 141, in _communication_lock
await asyncio.wait_for(
...<2 lines>...
)
File "/usr/local/lib/python3.13/asyncio/tasks.py", line 506, in wait_for
async with timeouts.timeout(timeout):
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in aexit
raise TimeoutError from exc_val
TimeoutError

Third error:
Logger: custom_components.huawei_solar.config_flow
Source: custom_components/huawei_solar/config_flow.py:536
integration: Huawei Solar (documentation, issues)
First occurred: 07:06:46 (4 occurrences)
Last logged: 10:50:33

Unexpected exception while connecting via ModbusTCP
Traceback (most recent call last):
File "/usr/local/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
return await fut
^^^^^^^^^
File "/usr/local/lib/python3.13/asyncio/locks.py", line 213, in wait
await fut
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/huawei_solar/config_flow.py", line 536, in async_step_setup_network
info = await validate_network_setup(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
)
^
File "/config/custom_components/huawei_solar/config_flow.py", line 204, in validate_network_setup
bridge = await create_tcp_bridge(
^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 659, in create_tcp_bridge
return await _create(await AsyncHuaweiSolar.create(host, port, slave_id), slave_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 685, in _create
product_info = await HuaweiSolarProductInfo.retrieve_from_device(client, slave_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/huawei_solar/bridge.py", line 67, in retrieve_from_device
) = await client.get_multiple(
^^^^^^^^^^^^^^^^^^^^^^^^^^
...<8 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 292, in get_multiple
response = await self._read_registers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 422, in _read_registers
async with self._communication_lock():
~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/contextlib.py", line 214, in aenter
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/huawei_solar/huawei_solar.py", line 141, in _communication_lock
await asyncio.wait_for(
...<2 lines>...
)
File "/usr/local/lib/python3.13/asyncio/tasks.py", line 506, in wait_for
async with timeouts.timeout(timeout):
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in aexit
raise TimeoutError from exc_val
TimeoutError

Last error:
Logger: pymodbus.logging
Source: runner.py:154
First occurred: 07:05:35 (10 occurrences)
Last logged: 10:50:33

Failed to connect [Errno 111] Connect call failed ('192.168.1.101', 502)
Failed to connect [Errno 111] Connect call failed ('192.168.1.101', 6607)

Describe your Huawei Solar Setup

Inverter Type: SUN2000-17K-MB0
Inverter Firmware version: V200R023C10SPC200
sDongle present: Yes
sDongle Type: EMMA-A02
sDongle Connectivitiy: Ethernet
sDongle Firmware: SmartHEMS V100R024C00SPC101
Power meter present: three phase
Optimizers Present: Yes
Battery: LUNA2000-15KW-C0
Battery Firmware version: V100R002C00SPC624
Huawei Solar integration version:

How do you connect to the inverter?

Via the SDongle, wired connection

Upload your Diagnostics File

Drag & Drop your Diagnostics File here.

Upload your relevant debug logs

I can not turn on debug mode

Please confirm the following:

  • I'm running the latest release of Home Assistant.
  • I'm running the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)
@jgate jgate added the bug Something isn't working label Feb 11, 2025
@jgate jgate changed the title [Bug]: When trying to connect to EMMA with SUN2000-17K-MB0 I gett the following errors [Bug]: When trying to connect to EMMA with SUN2000-17K-MB0 I get the following errors Feb 11, 2025
@wlcrs
Copy link
Owner

wlcrs commented Feb 11, 2025

This issue seems to be caused by a connection failure or an unstable connection to the inverter. This integration already has already implemented a lot of logic to automatically recover from connection failures or unstable connections. The three most important ones are:

  • automatic reconnects if the connection to the inverter failed;
  • each Modbus request is retried for up to 6 times, with increasing waits between each attempt to allow the connection to recover;
  • after 3 failed Modbus requests the connection is reset to fix hanging connections.

Please understand that I cannot help you solve your connection failure or unstable connection. Consider an alternative connection method.
If you are convinced that there is no connectivity issue, then I invite you to debug and fix the problem yourself and submit a pull request to the underlying huawei-solar Python library. Your input would be greatly appreciated.

As there is nothing actionable for me to do in this issue, I'm closing it. You are welcome to open a topic in Discussions: Connecting to the inverter to get community support for your problem.

@wlcrs wlcrs closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants