home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.26k stars 29.86k forks source link

Yi outdoor camera #24989

Closed IlTeo285 closed 4 years ago

IlTeo285 commented 5 years ago

Home Assistant release with the issue: 0.93.1

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): arch | armv7l dev | false docker | false hassio | false os_name | Linux python_version | 3.6.8 version | 0.93.1 virtualenv | true

Component/platform:

yi camera

Description of problem: This problem appears every time I try to get an image from the camera.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

  - platform: yi
    name: retro
    host: '192.168.1.50'
    password: ******
    path: /tmp/sd/record
    ffmpeg_arguments: -vf scale=800:450

Traceback (if applicable):

Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 115, in handle
    result = await result
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 468, in get
    return await self.handle(request, camera)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 504, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/yi/camera.py", line 147, in handle_async_mjpeg_stream
    await stream.close()
  File "/srv/homeassistant/lib/python3.6/site-packages/haffmpeg/core.py", line 158, in close
    await self._loop.run_in_executor(None, _close)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/haffmpeg/core.py", line 153, in _close
    self._proc.stdin.write(b"q")
BrokenPipeError: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 447, in start
    await resp.prepare(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_response.py", line 353, in prepare
    return await self._start(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_response.py", line 667, in _start
    return await super()._start(request)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/web_response.py", line 410, in _start
    await writer.write_headers(status_line, headers)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 112, in write_headers
    self._write(buf)
  File "/srv/homeassistant/lib/python3.6/site-packages/aiohttp/http_writer.py", line 67, in _write
    raise ConnectionResetError('Cannot write to closing transport')
ConnectionResetError: Cannot write to closing transport

Additional information: Into the camera is running the firmware https://github.com/TheCrypt0/yi-hack-v4. FTP with FileZilla is tested and working

bachya commented 5 years ago

This looks like an FFMPEG issue, not an issue particular to Yi.

That said, since you're using yi-hack-v4, why not configure this as an RTSP camera?

IlTeo285 commented 5 years ago

yes could be a good idea

manny199 commented 5 years ago

My camera Yi 1080p dome with yi-hack-v4 is configured as an RTSP but the issue is always present. Anyone can help me? I have Home assistant 0.95.4

bachya commented 5 years ago

@manny199 Unsure what you mean: if you're using the RTSP platform, this issue won't apply.

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.