starkillerOG / reolink_aio

Reolink NVR/camera API PyPI package
MIT License
65 stars 13 forks source link

Reolink Home Assistant integrations can't add NVR RLN36 Firmware Version v3.3.0.282_23103105 #50

Closed juslex closed 8 months ago

juslex commented 9 months ago

Describe the bug It is not possible to add the NVR RLN36 to the home assistant with firmware version v3.3.0.282_23103105

To Reproduce When trying to enter the username and password and the ip where the nvr is located I receive the invalid authentication error message because the user and password are correct

Expected behavior Before updating to firmware v3.3.0.282_23103105 I could normally add the nvr through integration

Screenshots

Environment: Please provide useful information about your environment, like: Model RLN36 Build No. build 2310315 Hardware No. N5MB01 Config Version v3.0.0.0 Firmware Version v3.3.0.282_23103105

Additional context I believe it is something that has changed with the new version that prevents the integration from authenticating. Both HTPP and HTPPS are active in the nvr configuration. I tried to log in both using HTPP and HTPPS and the bug persists.

starkillerOG commented 9 months ago

Please enable debug logging and post the log.txt here when you tried to setup the integration.

I need to see the communication with the device.

starkillerOG commented 9 months ago

If you go to the IP of the NVR using a webbrowser, are you able to login using the username and password you are using in Home Assistant?

starkillerOG commented 9 months ago

To enable debug loggin see here: https://www.home-assistant.io/docs/configuration/troubleshooting/#enabling-debug-logging

Or add the following to your configuration.yaml:

logger:
  default: warn
  logs:
    reolink_aio: debug
    reolink: debug
    homeassistant.components.reolink: debug
juslex commented 9 months ago

If you go to the IP of the NVR using a webbrowser, are you able to login using the username and password you are using in Home Assistant?

Yes, I did this test before opening this issue.

juslex commented 9 months ago

reolink.log Follow the log as directed

starkillerOG commented 9 months ago

@juslex thanks for the debug log. The problem originates from the camera connected to channel 17 of the NVR. That gives all kinds of errors such as get config failed, set config failed, rcv failed and login failed.

What type of camera is connected to channel 17? In the Reolink app/windows client, what is shown for the camera connected to channel 17? Is it perhaps a camera not directly connected to the NVR that does not have the password of that camera configured correctly and showing a login failed in the reolink windows client?

starkillerOG commented 9 months ago

@juslex I tried to reproduce the issues on my RLN8 NVR by connecting a camera over LAN and then changing the password of that camera. However that just emidiatly showed that camera as offline, so that could not explain what you are seeing...

Maybe the camera on channel 17 is a wifi camera with a really bad connection???

However I am not running the same firmware and hardware NVR, so I really need you to do some testing if you want to get this resolved.

juslex commented 9 months ago

I'm checking here and I'll give you a Feedback

juslex commented 9 months ago

Updating. I saw that channel 17 had an invalid camera setting, I removed it and managed to make it work. You can close the issue, sorry for the inconvenience.

starkillerOG commented 8 months ago

Could you eleborate a bit more? What model was the channel 17 camera? Which camera setting was invalid?

I would like to see if I can detect such types of issues and make a better error message/repairs issue such that users now what to do to resolve it.

juslex commented 8 months ago

Could you eleborate a bit more? What model was the channel 17 camera? Which camera setting was invalid?

I would like to see if I can detect such types of issues and make a better error message/repairs issue such that users now what to do to resolve it.

Channel 17 was a Reolink doorbell Wifi. But the ip that was pointed out there was her first, after I changed the ip and put it on another channel and the configuration of channel 17 was wrong without me knowing.

starkillerOG commented 8 months ago

@juslex thank you for clearifying. Weired that the RLN36 still showed the camera online.... Maybe because at that original IP there was some other device that was responding in some way to the NVR or something. Sounds like pretty rare...

juslex commented 7 months ago

Hello @starkillerOG I'm experiencing an error again when authenticating the integration with my nvr, here is the log: home-assistant.log

starkillerOG commented 7 months ago

@juslex thanks for reporting this. This time channel 16 is giving issues: Again this channel is called "NVT" and the "typeInfo" : "IPC".

I would like to get rid off this issue in the software, so please do not remove this channel 16 yet!

Did you rename channel 16 to "NVT" or did it do that on its own? Is there any camera connected to this channel 16?

Again, please do not remove this channel yet, maybe some additional tests are needed....

starkillerOG commented 7 months ago

Could you give me a screenshot on how this channel 16 looks like in the reolink desktop client and phone app?

starkillerOG commented 7 months ago

@juslex did you rename channel 16 to "NVT" yourself or did it do that on its own?

juslex commented 7 months ago

Hello @starkillerOG this channel was from a non-Reolink camera in the ONVIF standard. It's funny that the first few times it worked, however, the integration started to give a problem. I ended up removing it from the nvr and it worked again. I suggest as an improvement in the integration, the possibility of reporting the type of error, currently, we only receive the information in the dialog box that the login was unsuccessful.

starkillerOG commented 7 months ago

@juslex I made a possible fix here: https://github.com/starkillerOG/reolink_aio/pull/59 But that relies on the camera name beeing "NVT", in that way I can ignore these non-Reolink camera's. But in order to do that I need to know if they will always be called "NVT" or that you named it yourself like that.

juslex commented 7 months ago

The name was automatically assigned by the NVR. I even tried to change it, but without success.

starkillerOG commented 6 months ago

@juslex thanks for the info!

starkillerOG commented 6 months ago

@juslex the next HA 2024.3.2 patch release will include this PR https://github.com/home-assistant/core/pull/110959 that will ensure these non-reolink camera's will be ignored in the HomeAssistant Reolink integration.

So the problem schould now be solved indefenitly.

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.

juslex commented 6 months ago

Thank you so much!