Hi All,
I am verry new in HA and i am trying to make an connection to my S7-300 siemens PLC with ha-s7plc. And i get an error like above.
Connection with node-red is no problem.
[LOG File]
File “/usr/local/lib/python3.13/site-packages/pyS7/client.py”, line 244, in __send
header = self._recv_exact(4)
File “/usr/local/lib/python3.13/site-packages/pyS7/client.py”, line 275, in _recv_exact
chunk = self.socket.recv(expected_length - len(data))
ConnectionResetError: [Errno 104] Connection reset by peer
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/usr/local/lib/python3.13/site-packages/pyS7/client.py”, line 85, in connect
connection_bytes_response: bytes = self.__send(connection_request)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.13/site-packages/pyS7/client.py”, line 262, in __send
raise S7CommunicationError(
f"Socket error during communication: {e}."
) from e
pyS7.errors.S7CommunicationError: Socket error during communication: [Errno 104] Connection reset by peer.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py”, line 510, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py”, line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py”, line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/security_filter.py”, line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/forwarded.py”, line 87, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/request_context.py”, line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/ban.py”, line 86, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/headers.py”, line 41, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/http.py”, line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/decorators.py”, line 83, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/config/config_entries.py”, line 234, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/http/data_validator.py”, line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py”, line 121, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 346, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 393, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flow, cur_step[“step_id”], user_input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 493, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/config/custom_components/s7plc/config_flow.py”, line 256, in async_step_user
await self.hass.async_add_executor_job(coordinator.connect)
File “/usr/local/lib/python3.13/concurrent/futures/thread.py”, line 59, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/s7plc/coordinator.py”, line 147, in connect
self._ensure_connected()
~~~~~~~~~~~~~~~~~~~~~~^^
File “/config/custom_components/s7plc/coordinator.py”, line 130, in _ensure_connected
self._client.connect()
~~~~~~~~~~~~~~~~~~~~^^
File “/usr/local/lib/python3.13/site-packages/pyS7/client.py”, line 102, in connect
raise S7ConnectionError(f"Failed to complete connection setup: {e}") from e
pyS7.errors.S7ConnectionError: Failed to complete connection setup: Socket error during communication: [Errno 104] Connection reset by peer.