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

Amcrest camera not showing up #55550

Closed ijustlikeit closed 3 years ago

ijustlikeit commented 3 years ago

The problem

Have two Amcrest cameras. One is working and the other is not showing up or working. The working one is the cam1_camera (192.168.x.239). The one not working is the cam2 (192.168.x.118).

Error message shows "Error requesting stream: Camera is off" but it is indeed on and working. Tested with VLC with the full rtsp stream and works fine.

Was working fine in core-2021.8

What is version of Home Assistant Core has the issue?

core-2021.9.0

What was the last working version of Home Assistant Core?

core-2021.8

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Amcrest

Link to integration documentation on our website

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

Example YAML snippet

amcrest:
# Amcrest IP4M-xxx camera

  - host: !secret ip4m_ip_address
    port: !secret ip4m_port
    username: !secret ip4m_username
    password: !secret ip4m_password  
    name: cam1_camera
    stream_source: rtsp

#Amcrest ip8m-xxx camera      

  - host: !secret ip8m_ip_address
    port: !secret ip8m_port
    username: !secret ip8m_username
    password: !secret ip8m_password  
    name: cam2
    stream_source: rtsp

Anything in the logs that might be useful for us?

2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> Trying Basic Authentication
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> HTTP query 1: http://192.168.x.239:6080/cgi-bin/magicBox.cgi?action=getMachineName
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> Running query 1 attempt 1
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> Trying Basic Authentication
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> HTTP query 1: http://192.168.x.218:6181/cgi-bin/magicBox.cgi?action=getMachineName
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> Running query 1 attempt 1
2021-09-01 15:03:40 INFO (MainThread) [homeassistant.components.light] Setting up light.neviweb130
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> Query 1: Unauthorized (401)
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> Trying Digest Authentication
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> HTTP query 2: http://192.168.x.218:6181/cgi-bin/magicBox.cgi?action=getMachineName
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> Running query 2 attempt 1
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> Query 1: Unauthorized (401)
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> Trying Digest Authentication
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> HTTP query 2: http://192.168.x.239:6080/cgi-bin/magicBox.cgi?action=getMachineName
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> Running query 2 attempt 1
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <Unconnected @ 192.168.x.239> Query 2 worked. Exit code: <200>
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <xxx:CONNECTING> Retrieving serial number
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <xxx:CONNECTING> HTTP query 3: http://192.168.x.239:6080/cgi-bin/magicBox.cgi?action=getSerialNo
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <xxx:CONNECTING> Running query 3 attempt 1
2021-09-01 15:03:40 INFO (MainThread) [homeassistant.setup] Setting up sensor
2021-09-01 15:03:40 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.0 seconds
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <Unconnected @ 192.168.x.218> Query 2 worked. Exit code: <200>
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <cam2:CONNECTING> Retrieving serial number
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <cam2:CONNECTING> HTTP query 3: http://192.168.x.218:6181/cgi-bin/magicBox.cgi?action=getSerialNo
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <cam2:CONNECTING> Running query 3 attempt 1
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <xxx:CONNECTING> Query 3 worked. Exit code: <200>
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <xxx:xxx> HTTP query 4: http://192.168.x.239:6080/cgi-bin/eventManager.cgi?action=attach&codes=[All]
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <xxx:xxx> Running query 4 attempt 1
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <cam2:CONNECTING> Query 3 worked. Exit code: <200>
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <cam2:xxx> HTTP query 4: http://192.168.x.218:6181/cgi-bin/eventManager.cgi?action=attach&codes=[All]
2021-09-01 15:03:40 DEBUG (Amcrest cam2) [amcrest.http] <cam2:xxx> Running query 4 attempt 1
2021-09-01 15:03:40 DEBUG (Amcrest cam1_camera) [amcrest.http] <xxx:xxx> Query 4 worked. Exit code: <200>
021-09-01 15:38:36 DEBUG (Amcrest cam2) [amcrest.event] <cam2:xxx> event info: '\r\nCode=TimeChange;action=Pulse;index=0;data={\n "BeforeModifyTime" : "2021-09-01 15:38:36",\n "ModifiedTime" : "2021-09-01 15:38:35"\n'
2021-09-01 15:38:36 DEBUG (Amcrest cam2) [amcrest.event] <cam2:xxx> generate new event, code: TimeChange , payload: {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2021-09-01 15:38:36', 'ModifiedTime': '2021-09-01 15:38:35'}}
2021-09-01 15:38:36 DEBUG (Amcrest cam2) [amcrest.event] <cam2:xxx> event info: '\r\nCode=NTPAdjustTime;action=Pulse;index=0;data={\n "Address" : "pool.ntp.org",\n "Before" : "2021-09-01 15:38:35",\n "result" : true\n'
2021-09-01 15:38:36 DEBUG (Amcrest cam2) [amcrest.event] <cam2:xxx> generate new event, code: NTPAdjustTime , payload: {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': 'pool.ntp.org', 'Before': '2021-09-01 15:38:35', 'result': 'true'}}
2021-09-01 15:42:57 DEBUG (Amcrest cam1_camera) [amcrest.event] <xxx:xxx> event info: '\r\nCode=TimeChange;action=Pulse;index=0;data={\n "BeforeModifyTime" : "2021-09-01 14:42:57",\n "ModifiedTime" : "2021-09-01 14:42:57"\n'
2021-09-01 15:42:57 DEBUG (Amcrest cam1_camera) [amcrest.event] <xxx:xxx> generate new event, code: TimeChange , payload: {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2021-09-01 14:42:57', 'ModifiedTime': '2021-09-01 14:42:57'}}
2021-09-01 15:42:57 DEBUG (Amcrest cam1_camera) [amcrest.event] <xxx:xxx> event info: '\r\nCode=NTPAdjustTime;action=Pulse;index=0;data={\n "Address" : "pool.ntp.org",\n "Before" : "2021-09-01 14:42:56",\n "result" : true\n'
2021-09-01 15:42:57 DEBUG (Amcrest cam1_camera) [amcrest.event] <xxx:xxx> generate new event, code: NTPAdjustTime , payload: {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': 'pool.ntp.org', 'Before': '2021-09-01 14:42:56', 'result': 'true'}}
2021-09-01 15:42:58 INFO (MainThread) [homeassistant.components.stream] Started stream: rtsp://****:****@192.168.x.239:554/cam/realmonitor?channel=1&subtype=0
2021-09-01 15:42:58 ERROR (MainThread) [homeassistant.components.camera] Error requesting stream: Camera is off
2021-09-01 15:42:58 DEBUG (Amcrest cam1_camera) [amcrest.event] <xxx:xxx> event info: '\r\nCode=RtspSessionDisconnect;action=Stop;index=0;data={\n "Device" : "192.168.x.105",\n "StreamType" : "Main",\n "UserAgent" : " Lavf58.76.100"\n'
2021-09-01 15:42:58 DEBUG (Amcrest cam1_camera) [amcrest.event] <xxx:xxx> generate new event, code: RtspSessionDisconnect , payload: {'Code': 'RtspSessionDisconnect', 'action': 'Stop', 'index': '0', 'data': {'Device': '192.168.x.105', 'StreamType': 'Main', 'UserAgent': ' Lavf58.76.100'}}

Additional information

No response

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

amcrest documentation amcrest source (message by IssueLinks)

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

Hey there @flacjacket, mind taking a look at this issue as it has been labeled with an integration (amcrest) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

ijustlikeit commented 3 years ago

I reverted back to the prior Release 2021.8.8. Both cameras are working as expected.

So just to be sure I AGAIN updated to 2021.9.0. Well this time the cameras are working properly!

Don't know what to make of this. Going to close this issue anyways. Thanks.

flacjacket commented 3 years ago

Hi @ijustlikeit, thanks for working your way through this issue, glad it is working for you!