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
73.22k stars 30.58k forks source link

Error Requesting Stream: Camera is off (but it isn't) #55755

Closed GaryOkie closed 3 years ago

GaryOkie commented 3 years ago

The problem

Upon upgrading to 2021.9.2 one of my Amcrest Cameras (IP2M-851B) is now unable to stream. Error says it is off, but it definitely is online and accessible. Status is Idle, not streaming. All other Amcrest cameras (different models) are streaming fine. This camera also streams RTSP via VLC and SmartPSS apps/

Enabled debug on camera and amcrest components and it shows that all API calls to this camera are connecting, except for the Stream request.

What is version of Home Assistant Core has the issue?

2021.9.2

What was the last working version of Home Assistant Core?

2021.8.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

camera (or amcrest)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/camera/

Example YAML snippet

logger:
  logs:
    amcrest: debug
    homeassistant.components.amcrest: debug
    homeassistant.components.camera: debug

amcrest:  
  - host: 192.168.0.16    
    name: "Papa_Driveway"
    username: !secret cam2_id
    password: !secret cam2_pw
    resolution: high
    stream_source: rtsp
    port: 80

Anything in the logs that might be useful for us?

2021-09-04 16:59:17 DEBUG (SyncWorker_10) [homeassistant.components.amcrest.camera] Updating Papa_Driveway camera
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 5: http://192.168.0.16:80/cgi-bin/magicBox.cgi?action=getVendor
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 5 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 5 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 6: http://192.168.0.16:80/cgi-bin/magicBox.cgi?action=getDeviceType
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 6 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 6 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [homeassistant.components.amcrest.camera] Device_type=IP2M-851B
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 7: http://192.168.0.16:80/cgi-bin/magicBox.cgi?action=getSerialNo
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 7 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 7 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [homeassistant.components.amcrest.camera] Assigned unique_id=AMC029C56700A5D99B
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 8: http://192.168.0.16:80/cgi-bin/configManager.cgi?action=getConfig&name=Encode
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 8 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 8 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 9: http://192.168.0.16:80/cgi-bin/configManager.cgi?action=getConfig&name=RecordMode
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 9 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 9 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 10: http://192.168.0.16:80/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 10 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 10 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 11: http://192.168.0.16:80/cgi-bin/configManager.cgi?action=getConfig&name=Encode
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 11 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 11 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 12: http://192.168.0.16:80/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 12 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 12 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 13: http://192.168.0.16:80/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptions
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 13 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 13 worked. Exit code: <200>
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> HTTP query 14: http://192.168.0.16:80/cgi-bin/configManager.cgi?action=getConfig&name=RTSP
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Running query 14 attempt 1
2021-09-04 16:59:17 DEBUG (SyncWorker_10) [amcrest.http] <PapaDriveCam:AMC029C56700A5D99B> Query 14 worked. Exit code: <200>

2021-09-04 16:59:44 DEBUG (Amcrest Papa_Driveway) [amcrest.event] <PapaDriveCam:AMC029C56700A5D99B> event info: 'Code=RtspSessionDisconnect;action=Stop;index=0'
2021-09-04 16:59:44 DEBUG (Amcrest Papa_Driveway) [amcrest.event] <PapaDriveCam:AMC029C56700A5D99B> generate new event, code: RtspSessionDisconnect , payload: {'Code': 'RtspSessionDisconnect', 'action': 'Stop', 'index': '0'}

2021-09-04 17:00:24 INFO (MainThread) [homeassistant.components.camera] Entity_id: camera.papa_driveway
2021-09-04 17:00:24 ERROR (MainThread) [homeassistant.components.camera] Error requesting stream: Camera is off
2021-09-04 17:00:24 DEBUG (MainThread) [homeassistant.components.camera] Camera is off

Logger: homeassistant.components.camera
Source: components/camera/__init__.py:696
Integration: Camera (documentation, issues)
First occurred: 5:00:24 PM (1 occurrences)
Last logged: 5:00:24 PM

Error requesting stream: Camera is off

Additional information

probot-home-assistant[bot] commented 3 years ago

camera documentation camera source (message by IssueLinks)

GaryOkie commented 3 years ago

Solved this issue by manually issuing the camera: turn on service.

How the heck the camera stream got turned off on this camera, and none other after the update is a mystery.

flacjacket commented 3 years ago

Hi Gary, there was a bug where the camera would report as being off if the substream was off, even if the main stream is on. When you issued the turn on service command, you turned on the camera substream, which worked around the problem. A fix for this is available by using an updated version of the amcrest package, which is included in the 2021.9.6 release.

GaryOkie commented 3 years ago

great - thanks for the update and letting me know!