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

Reolink integration IP configuration #91493

Closed
RaveGun opened this issue Apr 16, 2023 · 17 comments
Closed

Reolink integration IP configuration #91493

RaveGun opened this issue Apr 16, 2023 · 17 comments

Comments

@RaveGun
Copy link

RaveGun commented Apr 16, 2023

The problem

Cannot connect to the Doorbell camera.

The first time I configured the camera was after the initial setup. Back then, the camera had the IP 192.168.1.102.

I changed the camera's IP to 192.168.1.76 and then, there was no connection possible, as expected.

Since I do not know how to change the IP of an integration, I removed the camera from HA and re-added it.
It works for a while (until I start the HA, I guess) and then it reverts back to the old ...102 IP.

image

Interesting is that if I navigate from the device menu (Visit link), it is opening the 192.168.1.76 IP webpage.

What version of Home Assistant Core has the issue?

core-2023.4.4

What was the last working version of Home Assistant Core?

?

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Reolink IP NVR/camera

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:1242
First occurred: April 15, 2023 at 19:23:15 (3 occurrences)
Last logged: 11:46:17
Config entry 'DoorRBell' for reolink integration not ready yet: Error while trying to setup 192.168.1.102:443: Client connector error during login of host 192.168.1.102:443: Cannot connect to host 192.168.1.102:443 ssl:default [Connect call failed ('192.168.1.102', 443)]; Retrying in background

Additional information

No response

@home-assistant
Copy link

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!

Code owner commands

Code owners of reolink can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign reolink Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


reolink documentation
reolink source
(message by IssueLinks)

@starkillerOG
Copy link
Contributor

I think the DHCP discovery might still be reporting the old IP adress causing this issue.
Did you now set a static IP adress for the doorbell in the router to prevent future issues?

I would recommand first removing the reolink integration for the doorbell from HomeAssistant, then restarting HomeAssistant, power cycle your router and the doorbell, then once everything has started again, add the doorbell back to HomeAssistant.

(Normally this schould not happen, but I think this is a issue in your router/network that is still remembering the old IP adress and reporting that to HomeAssistant).

@starkillerOG
Copy link
Contributor

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library.

@RaveGun
Copy link
Author

RaveGun commented Apr 17, 2023

Hmm, but if the integration only get configured with: admin, password and the IP address, then what is the role of the DHCP? All the involved parties have a static IP configured. The DNS is also not involved.

It's the mqtt used by the integration? Maybe there is a persistent configuration topic in the broker.

I will have to check this.

@RaveGun
Copy link
Author

RaveGun commented May 5, 2023

Hi,
It happened again and I had a look in the full log.
It looks like the camera when someone rings looses from time to time the connection.

At 7:50 there was somebody at the door and this happened in the log:

2023-05-05 07:50:00.640 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.doorrbell_sub] Error from stream worker: Error opening stream (INVALIDDATA, Invalid data found when processing input) rtsp://****:****@192.168.1.76:554/h264Preview_01_sub
2023-05-05 07:50:10.652 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.doorrbell_sub] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://****:****@192.168.1.76:554/h264Preview_01_sub
2023-05-05 07:51:13.644 ERROR (MainThread) [reolink_aio.api] Host 192.168.1.76:443: connection error: Cannot connect to host 192.168.1.76:443 ssl:default [Connect call failed ('192.168.1.76', 443)]
2023-05-05 07:51:13.653 ERROR (MainThread) [homeassistant.components.reolink] Error requesting reolink.DoorRBell data: Cannot connect to host 192.168.1.76:443 ssl:default [Connect call failed ('192.168.1.76', 443)]
2023-05-05 07:51:35.443 WARNING (MainThread) [reolink_aio.api] Host 192.168.1.76:443: subscription request got a response with wrong HTTP status 400: Bad Request
2023-05-05 07:51:39.364 ERROR (MainThread) [reolink_aio.api] Host 192.168.1.102:443: connection error: Cannot connect to host 192.168.1.102:443 ssl:default [Connect call failed ('192.168.1.102', 443)]
2023-05-05 07:51:39.367 WARNING (MainThread) [homeassistant.config_entries] Config entry 'DoorRBell' for reolink integration not ready yet: Error while trying to setup 192.168.1.102:443: Client connector error during login of host 192.168.1.102:443: Cannot connect to host 192.168.1.102:443 ssl:default [Connect call failed ('192.168.1.102', 443)]; Retrying in background
2023-05-05 07:51:42.436 ERROR (MainThread) [reolink_aio.api] Host 192.168.1.102:443: connection error: Cannot connect to host 192.168.1.102:443 ssl:default [Connect call failed ('192.168.1.102', 443)]
2023-05-05 07:51:42.439 WARNING (MainThread) [homeassistant.config_entries] Config entry 'DoorRBell' for reolink integration not ready yet: Error while trying to setup 192.168.1.102:443: Client connector error during login of host 192.168.1.102:443: Cannot connect to host 192.168.1.102:443 ssl:default [Connect call failed ('192.168.1.102', 443)]; Retrying in background
2023-05-05 07:51:50.916 ERROR (MainThread) [reolink_aio.api] Host 192.168.1.102:443: connection error: Cannot connect to host 192.168.1.102:443 ssl:default [Connect call failed ('192.168.1.102', 443)]
2023-05-05 07:52:04.068 ERROR (MainThread) [reolink_aio.api] Host 192.168.1.102:443: connection error: Cannot connect to host 192.168.1.102:443 ssl:default [Connect call failed ('192.168.1.102', 443)]

It lost the connection and after some retries to 192.168.1.76 the reolink_aio.api switched to the old IP, 192.168.1.112.

What is this with the config entry?

The current config entry locks like:

      {
        "entry_id": "9fd5684b2c1445ac51311eaa8719d2a7",
        "version": 1,
        "domain": "reolink",
        "title": "DoorRBell",
        "data": {
          "username": "admin",
          "password": "**************",
          "host": "192.168.1.76",
          "port": 443,
          "use_https": true
        },
        "options": {
          "protocol": "rtsp"
        },
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "user",
        "unique_id": "38:e7:c0:c3:5f:d8",
        "disabled_by": null
      }

@starkillerOG
Copy link
Contributor

@RaveGun no mqtt is not involved with the Reolink integration, only DHCP discovery.

If the Doorbell loses connection when you press it, it might be due to insuficient power.
How are you powering the doorbell?
PoE, or through a other power source and what kind of power source is it?

I am suspecting the doorbell reboots when you press it, and reconnects to you router due to a dip in power if you are using a power source that delivers insufficient power.

@RaveGun
Copy link
Author

RaveGun commented May 8, 2023

Thank you for the feedback.

The doorbell is connected to the previously available AC 12V transformer.
I will have to check the power specifications of the transformer. Maybe it does reboot.

This will still not explain from where is it getting the old IP information.

PS. It is a PKT 121 transformer that outputs 12V 1,3A. Is this too low?

@starkillerOG
Copy link
Contributor

@RaveGun did you use the jumbers to bridge your chime?
AC 12V is the minimum supported voltage for the doorbell, so it might be just barely to low.
But I don't know.

The old IP infromation is probably comming from the DHCP discovery from your router that has remembered the IP somewhere in its memory. Did you try power cyceling your router and acces points?

@RobinBeismann
Copy link

Hi @starkillerOG,

I'm facing the exact same issues, I have two reolink cameras (same model), both have a static configured IP on the cameras (not DHCP reservation) since over a year, none of them does exist in the DHCP server or reverse DNS zone, and both of them keep reverting to the wrong IP address (actually even the same one for both cameras).
I even checked the ARP cache of all switches in between and that doesn't list an old ARP entry for those cameras either..

Any idea where this comes from? Could you shed some light on how this DHCP Discovery works so we might be able to figure out more?

@RobinBeismann
Copy link

Hi @RaveGun / @starkillerOG,

I might just figured it out..
Reolink seems to have messed up their network configuration. Even if you configure a static IP on them, they keep sending DHCP Requests (but don't actually use the IP they'd get assigned).
Due to the nature of this, staticly configured cameras won't work with the HA Integration unless there would be a config option to enter a fixed IP. In my case they always got a lease from the DHCP that obviously had another IP than the staticly configured one and the Reolink Integration picked it up.
I've cheated around it by creating a reservation for the fix configured IP address for both cameras and that worked around the issue now.

This is confirmed by this post here:
https://community.reolink.com/topic/1514/rlc-410w-with-latest-fw-continues-to-send-dhcp-requests-with-static-ip-config

@starkillerOG
Copy link
Contributor

@RobinBeismann thank you for this information!
I will update the troubleshooting section of the documentation to make people aware of this.

The correct solution would be to not set a static IP in the camera, but set it to dynamic DHCP, then assign a static IP in the router.

@RobinBeismann
Copy link

@RobinBeismann thank you for this information! I will update the troubleshooting section of the documentation to make people aware of this.

The correct solution would be to not set a static IP in the camera, but set it to dynamic DHCP, then assign a static IP in the router.

Yeah, even through this is just a workaround. Can you imagine adding an option to disable discovery and assign a static address? This would help for cameras that are on a different L3 network also, being bound to DHCP discovery on the same Broadcast Domain is quite unflexibel.

@starkillerOG
Copy link
Contributor

starkillerOG commented Jun 11, 2023

When manually starting the config flow for Reolink (not use the discovered entry) you will be prompted to specify the host (ip address).
So you can use cams outside of L3 network.

However when discovery information does reach homeassistant, the IP adress used will be updated with the discovery info (to accomodate DHCP setups where the IP adress is not fixed).
Therefore you will have to set the static IP in the router and not in the client (reolink device). This holds true for the majority of homeassistant integrations.

@RobinBeismann
Copy link

When manually starting the config flow for Reolink (not use the discovered entry) you will be prompted to specify the host (ip address). So you can use cams outside of L3 network.

However when discovery information does reach homeassistant, the IP adress used will be updated with the discovery info (to accomodate DHCP setups where the IP adress is not fixed). Therefore you will have to set the static IP in the router and not in the client (reolink device). This holds true for the majority of homeassistant integrations.

Ah I see - but wouldn't it be even better that DHCP discovery is completely turned off for a device once a static IP is entered? I believe this is how other implementations do it, either the device is auto discovery or configured staticly, but a dynamic broadcast overwriting the static configuration could be undesired (especially given how Reolink handles their configuration with DHCP broadcasts even if static IPs are assigned).

@RobinBeismann
Copy link

Hi @starkillerOG,

could you shed some light on how this dhcp discovery works? Suddently my cameras are showing a wrong IP again, even through they have the same IP as always and it's assigned via a DHCP reservation - I don't even see how it gets the current IP. It's not even assigned to any client in the DHCP.

@starkillerOG
Copy link
Contributor

When manually starting the config flow for Reolink (not use the discovered entry) you will be prompted to specify the host (ip address). So you can use cams outside of L3 network.
However when discovery information does reach homeassistant, the IP adress used will be updated with the discovery info (to accomodate DHCP setups where the IP adress is not fixed). Therefore you will have to set the static IP in the router and not in the client (reolink device). This holds true for the majority of homeassistant integrations.

Ah I see - but wouldn't it be even better that DHCP discovery is completely turned off for a device once a static IP is entered? I believe this is how other implementations do it, either the device is auto discovery or configured staticly, but a dynamic broadcast overwriting the static configuration could be undesired (especially given how Reolink handles their configuration with DHCP broadcasts even if static IPs are assigned).

Actually for people with basic network setups that fail to set a static IP in the router, this will make sure the integration automatically recovers when the IP of the camera changes. This is how many integrations are implemented to mitigate the problems with changing IP adresses.

@starkillerOG
Copy link
Contributor

@RobinBeismann what did you configure in the network settings of the camera?
Is it set to DHCP there or did you put it to static (use the reolink app/client).

@github-actions github-actions bot locked and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants