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

DC1接入进来后,过段时间报异常:socket is not connected #1

Open
chainone opened this issue Sep 22, 2019 · 2 comments
Open

Comments

@chainone
Copy link

然后观察了下hass机器的netstat,发现DC1不再主动连hass了,很可能是引发DC1官方固件的问题导致不再连接。这块你有碰到类似的情况么?

@chainone
Copy link
Author

相关log日志:

2019-09-22 09:24:23 ERROR (SyncWorker_18) [custom_components.phicomm_dc1m.switch] sock except:[Errno 57] Socket is not connected sock:<socket.socket fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.50.145', 8000)>
2019-09-22 09:24:23 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.dc1 fails
Traceback (most recent call last):
  File "/usr/local/homeassistant/custom_components/phicomm_dc1m/switch.py", line 294, in update
    elif sockA.getpeername() is None:
OSError: [Errno 57] Socket is not connected

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 261, in async_update_ha_state
    await self.async_device_update()
"home-assistant.log" 323L, 38536C                                                                                                                       1,1           Top
        40005,
        "Display Is Turned off"
    ],
    "id": 1
}
2019-09-22 09:24:23 ERROR (SyncWorker_18) [custom_components.phicomm_dc1m.switch] sock except:[Errno 57] Socket is not connected sock:<socket.socket fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.50.145', 8000)>
2019-09-22 09:24:23 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.dc1 fails
Traceback (most recent call last):
  File "/usr/local/homeassistant/custom_components/phicomm_dc1m/switch.py", line 294, in update
    elif sockA.getpeername() is None:
OSError: [Errno 57] Socket is not connected

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 261, in async_update_ha_state
    await self.async_device_update()
  File "/usr/local/share/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 441, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/homeassistant/custom_components/phicomm_dc1m/switch.py", line 326, in update
    sockA.shutdown(2)
OSError: [Errno 57] Socket is not connected
2019-09-22 09:24:43 WARNING (SyncWorker_10) [custom_components.phicomm_dc1m.switch] PhicommDC1Switch Client list is empty
2019-09-22 09:25:04 WARNING (SyncWorker_1) [custom_components.phicomm_dc1m.switch] PhicommDC1Switch Client list is empty
2019-09-22 09:25:24 WARNING (SyncWorker_2) [custom_components.phicomm_dc1m.switch] PhicommDC1Switch Client list is empty

@chainone
Copy link
Author

确认应该是DC1的问题,一旦socket error后,DC1就不会再进行连接,上报信息了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant