Remote_rpi_gpio Integration problem, connection lost after a while

Hi,

I am making a full automated irrigation control and therefore I have installed a raspberry pi and connected a platine with 4 relays on it.
I have configured remote_rpi_gpio on both components(home assistant and pi), restarted the service and it worked.

I followed the tutorial on this page: remote_rpi_gpio - Home Assistant
This is the config.yml in home assistant.

switch:
  - platform: remote_rpi_gpio
    host: 10.0.200.22
    invert_logic: true
    ports:
      17: Relay_RB_A
      18: Relay_RB_B
      27: Relay_tbd1
      22: Relay_tbd2

Pretty straight forward and I was super excited. But after some time, it is not possible to switch the GPIOs from home assistant and it is necessary to restart home assistant core to get it working again. Same after a reboot from the pi.

UPDATE:
I have found the following entry in the logs. Does anyone know how to fix this? All components are up2date.

2022-04-02 13:18:21 WARNING (MainThread) [homeassistant.util.executor] Thread[SyncWorker_3] is still running at shutdown: File "/usr/local/lib/python3.9/threading.py", line 930, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 83, in _worker
    work_item.run()
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/switch.py", line 83, in turn_on
    remote_rpi_gpio.write_output(self._switch, 1)
  File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/__init__.py", line 57, in write_output
    switch.on()
  File "/usr/local/lib/python3.9/site-packages/gpiozero/output_devices.py", line 229, in on
    self._write(True)
  File "/usr/local/lib/python3.9/site-packages/gpiozero/output_devices.py", line 106, in _write
    self.pin.state = self._value_to_state(value)
  File "/usr/local/lib/python3.9/site-packages/gpiozero/pins/__init__.py", line 305, in <lambda>
    lambda self, value: self._set_state(value),
  File "/usr/local/lib/python3.9/site-packages/gpiozero/pins/pigpio.py", line 267, in _set_state
    elif self.function == 'input':
  File "/usr/local/lib/python3.9/site-packages/gpiozero/pins/__init__.py", line 283, in <lambda>
    lambda self: self._get_function(),
  File "/usr/local/lib/python3.9/site-packages/gpiozero/pins/pigpio.py", line 240, in _get_function
    return self.GPIO_FUNCTION_NAMES[self.factory.connection.get_mode(self.number)]
  File "/usr/local/lib/python3.9/site-packages/pigpio.py", line 1402, in get_mode
    return _u2i(_pigpio_command(self.sl, _PI_CMD_MODEG, gpio, 0))
  File "/usr/local/lib/python3.9/site-packages/pigpio.py", line 1026, in _pigpio_command
    dummy, res = struct.unpack('12sI', sl.s.recv(_SOCK_CMD_LEN))
Found 2 non-daemonic threads.
[finish] process exit code 0
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.

I also receive now another error [Error 32: Broken Pipe]

What am I doing wrong or missing out?
Thank you in advance
Best regards Thomas

I will skip this integration I think i wont get any answer here, rpi_gpio on pi is working like expected, home assistant cant handle it properly. I will use some sort of ssh login and a command. Sad that this is not working any better.

hi, i’m experiencing same prob since a couple of days. Can’t get the hang of it. Do you have any update?

I have almost the same kind of issue, but my uptime on the rpi hasn’t been so long yet :smiley: . Everything works fine in HA, but if I restart my rpi, gpio remote control wont work until I restart HA. If I restart HA, everything works fine again. I have other stuff on the rpi through RS-485, and those integrations works fine after restarting the rpi.

Running HA in a docker container on a NAS.

Error log:

2023-10-11 23:19:10.840 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140169385936704] [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1322, in async_turn_on
    await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/switch.py", line 82, in turn_on
    remote_rpi_gpio.write_output(self._switch, 1)
  File "/usr/src/homeassistant/homeassistant/components/remote_rpi_gpio/__init__.py", line 49, in write_output
    switch.on()
  File "/usr/local/lib/python3.11/site-packages/gpiozero/output_devices.py", line 219, in on
    self._write(True)
  File "/usr/local/lib/python3.11/site-packages/gpiozero/output_devices.py", line 96, in _write
    self.pin.state = self._value_to_state(value)
    ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gpiozero/pins/__init__.py", line 285, in <lambda>
    lambda self, value: self._set_state(value),
                        ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gpiozero/pins/pigpio.py", line 249, in _set_state
    elif self.function == 'input':
         ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gpiozero/pins/__init__.py", line 262, in <lambda>
    lambda self: self._get_function(),
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/gpiozero/pins/pigpio.py", line 222, in _get_function
    return self.GPIO_FUNCTION_NAMES[self.factory.connection.get_mode(self.number)]
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pigpio.py", line 1402, in get_mode
    return _u2i(_pigpio_command(self.sl, _PI_CMD_MODEG, gpio, 0))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pigpio.py", line 1025, in _pigpio_command
    sl.s.send(struct.pack('IIII', cmd, p1, p2, 0))
BrokenPipeError: [Errno 32] Broken pipe

rpi code:

switch:
  - platform: remote_rpi_gpio
    host: 192.168.1.9
    invert_logic: true
    ports:
      5: Gen24 Export block
      6: Gen24 something
      12: Gen24 something2
      13: Gen24 something3
      19: Nibe something
      16: Nibe somthing2
      26: Nibe something3
      20: Bastu

Has anyone solved this, or knows how to restart the intergration.

Brand new and also running into this problem.

Same Problem…
Has anyone found a workaround?