Closed richarddu07 closed 1 year ago
Hey there @starkillerog, mind taking a look at this issue as it has been labeled with an integration (reolink
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
reolink documentation reolink source (message by IssueLinks)
@richarddu07 this might be related to https://github.com/home-assistant/core/issues/103226 Which is also using a firmware from June 2023, whith simular sympthoms.
Could you enable debug logging of the reolink integration, restart the reolink integration, wait 2 minutes, disable debug logging again and post the restulting log.txt file here?
The already posted debug log does not include the request and responds where I am searching for. (needed to wait a bit longer after restart to gether more debug logs).
@richarddu07 Indeed I see this request:
2023-11-02 20:28:01.841 DEBUG (MainThread) [reolink_aio.api] Cellier/192.168.1.93:443::send() HTTP Request body =
[{'cmd': 'GetEnc', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetRtspUrl', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetChnTypeInfo', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetMdState', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetAiState', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetEvents', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetIsp', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetWhiteLed', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetIrLights', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetAudioCfg', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetOsd', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetZoomFocus', 'action': 1, 'param': {'channel': 0}}, {'cmd': 'GetEmail', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetPush', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetFtp', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetRec', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetAudioAlarm', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetAlarm', 'action': 0, 'param': {'Alarm': {'channel': 0, 'type': 'md'}}}]
With this response:
2023-11-02 20:28:17.839 DEBUG (MainThread) [reolink_aio.api.data] Cellier/192.168.1.93:443::send() HTTP Response data:
[
{
"cmd" : "Unknown",
"code" : 1,
"error" : {
"detail" : "timeout",
"rspCode" : -8
}
}
]
So this indeed is the same problem as reported here: https://github.com/home-assistant/core/issues/103226
Could you run the following python script (also see other issue) on your camera at IP 192.168.1.93?: https://github.com/home-assistant/core/issues/103226#issuecomment-1790521768 https://github.com/home-assistant/core/issues/103226#issuecomment-1790611211
import logging
import asyncio
from reolink_aio import api
_LOGGER = logging.getLogger(__name__)
#logging.basicConfig(level="INFO")
logging.basicConfig(level="DEBUG")
IP = '192.168.1.93'
username = 'admin'
password = 'PASSWORD'
async def asyncio_demo(loop):
# Create a host-object (representing either a camera, or NVR with several channels)
host = api.Host(host=IP, username=username, password=password)
# Obtain/cache NVR or camera settings and capabilities, like model name, ports, HDD size, etc:
await host.get_host_data()
commands = [
{'cmd': 'GetEnc', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetRtspUrl', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetChnTypeInfo', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetMdState', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetAiState', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetEvents', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetIsp', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetWhiteLed', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetIrLights', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetAudioCfg', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetOsd', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetZoomFocus', 'action': 1, 'param': {'channel': 0}},
{'cmd': 'GetEmail', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetPush', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetFtp', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetRec', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetAudioAlarm', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetAlarm', 'action': 0, 'param': {'Alarm': {'channel': 0, 'type': 'md'}}},
]
for cmd in commands:
body = [cmd]
print(await host.send(body))
# Logout and disconnect
await host.logout()
if __name__ == "__main__":
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(asyncio_demo(loop))
@richarddu07 Thank you very much for the log! So sending the requests one at a time works as expected for all requests, that is very good to know and already a possible solution. As a last test, I would like to know what happens If I split the big request in two parts, could you please run this modified script?
import logging
import asyncio
from reolink_aio import api
_LOGGER = logging.getLogger(__name__)
#logging.basicConfig(level="INFO")
logging.basicConfig(level="DEBUG")
IP = '192.168.1.93'
username = 'admin'
password = 'PASSWORD'
async def asyncio_demo(loop):
# Create a host-object (representing either a camera, or NVR with several channels)
host = api.Host(host=IP, username=username, password=password)
# Obtain/cache NVR or camera settings and capabilities, like model name, ports, HDD size, etc:
await host.get_host_data()
body_1 = [
{'cmd': 'GetEnc', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetRtspUrl', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetChnTypeInfo', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetMdState', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetAiState', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetEvents', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetIsp', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetWhiteLed', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetIrLights', 'action': 0, 'param': {'channel': 0}},
]
body_2 = [
{'cmd': 'GetAudioCfg', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetOsd', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetZoomFocus', 'action': 1, 'param': {'channel': 0}},
{'cmd': 'GetEmail', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetPush', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetFtp', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetRec', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetAudioAlarm', 'action': 0, 'param': {'channel': 0}},
{'cmd': 'GetAlarm', 'action': 0, 'param': {'Alarm': {'channel': 0, 'type': 'md'}}},
]
print(await host.send(body_1))
print(await host.send(body_2))
# Logout and disconnect
await host.logout()
if __name__ == "__main__":
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(asyncio_demo(loop))
It would be more efficient to split in 2 when receiving the timeout response than sending all requests seperately (takes longer).
Bonjour, ci-joint le nouveau fichier debug. Bonne journée. reolink_test-debug2.txt
Thanks, so splitting in 2 did not work for one of the requests. I now have enough info, I will start working on a fix.
@richarddu07 I have released reolink-aio 0.7.14 which should fix the issue, the HomeAssistant PR to start using this version has also already been merged and will be included in HA 2023.11.2 which is expected to be released on November 10th.
Please wait for HA 2023.11.2 and once updated to that version, let me know if the issue is fixed.
If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library or purchase Reolink products through this affiliate link.
@richarddu07 I just noticed the fix already made it into HA 2023.11.1, anyway HA 2023.11.2 is now also released. Could you update and let me know if all the entities come back online?
Merci pour le correctif, tout fonctionne parfaitement. Bonnr soirée.
The problem
Reolink integration works partially since updating the latest firmware of my RLC-511 and RLC-511W cameras (3.0.0.2356_23062003). Only the following functions work: Motion, Substream, Firmware, Audio Record, Restart.
What version of Home Assistant Core has the issue?
core-2023.11.0
What was the last working version of Home Assistant Core?
core-2023.11.0
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Reolink IP NVR/camera
Link to integration documentation on our website
https://www.home-assistant.io/integrations/reolink/
Diagnostics information
Debug log
``` 2023-11-02 13:34:06.197 DEBUG (MainThread) [reolink_aio.api] Cellier/192.168.1.93:443::send() HTTP Request params = {'cmd': 'Snap', 'channel': 0, 'snapType': 'sub', 'token': 'a0365aca2676830'} 2023-11-02 13:34:06.801 DEBUG (MainThread) [reolink_aio.api] Cellier/192.168.1.93:443::send() HTTP Response status = 200, content-type = (image/jpeg). 2023-11-02 13:34:06.801 DEBUG (MainThread) [reolink_aio.api.data] Cellier/192.168.1.93:443::send() HTTP Response (snapshot/download) data scrapped because it's too large. 2023-11-02 13:34:08.912 DEBUG (MainThread) [reolink_aio.api] Host 192.168.1.93:443: subscription got response status: 200. Payload:Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response