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

Add support for Lorex W452ASD Floodlight Camera #331

Open
vittorio88 opened this issue Jan 24, 2024 · 2 comments
Open

Add support for Lorex W452ASD Floodlight Camera #331

vittorio88 opened this issue Jan 24, 2024 · 2 comments

Comments

@vittorio88
Copy link

Using up-to-date Home Assistant, and latest trunk 7b038ee. I am unable to connect to a Lorex W452ASD Floodlight Camera. I am able to sucessfully connect to separate Lorex NVR N845A62 in the same network using the dahua custom component.

While adding the device, the connection times-out. I attempted bumping the timeout from 20 sec to 40 sec in https://github.com/rroller/dahua/blob/main/custom_components/dahua/client.py#L13, but this did not stop the Timeout from occuring.
I believe the issue is that the Floodlight never responds to the requests from python, however it does respond when I access it locally using the Desktop application LorexCloud provided by Lorex on port 35000. Port 35000 and 554 TCP are the only ports found open on the device from a port scan.

Here is the Traceback that when it timesout. Any help appreciated!

2024-01-24 17:36:31.510 WARNING (MainThread) [custom_components.dahua] TimeoutError fetching information from http:https://192.168.33.32:35000/cgi-bin/magicBox.cgi?action=getMachineName
2024-01-24 17:36:31.511 ERROR (MainThread) [custom_components.dahua] Could not connect to Dahua device. For iMou devices see https://github.com/rroller/dahua/issues/6
Traceback (most recent call last):
  File "/config/custom_components/dahua/client.py", line 774, in get
    response = await auth.request("GET", url)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/digest.py", line 46, in request
    response = await self.session.request(method, url, headers=headers, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 601, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 965, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/streams.py", line 622, in read
    await self._waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/config/custom_components/dahua/config_flow.py", line 188, in _test_credentials
    data = await client.get_machine_name()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 121, in get_machine_name
    return await self.get("/cgi-bin/magicBox.cgi?action=getMachineName")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 786, in get
    raise exception
  File "/config/custom_components/dahua/client.py", line 770, in get
    async with async_timeout.timeout(TIMEOUT_SECONDS):
  File "/usr/local/lib/python3.11/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.11/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError
@davidew98
Copy link

davidew98 commented May 28, 2024

go to a browser, goto this address:

http:https://camera-ip/cgi-bin/magicBox.cgi?action=getDeviceType

REPLACE camera-ip with your camera's IP

If that doesn't work change it from HTTP to HTTPS

Submit the response here!

@davidew98
Copy link

FYI the W452ASD mainboard looks the same as the Dahua IPC-L46N mainboard when looking at pics from FCC website. If this is in fact a rebadged IPC-L46N then it's firmware might work on this cam!! try at your own risk.

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

2 participants