neolink icon indicating copy to clipboard operation
neolink copied to clipboard

D800 fails to connect

Open Saduff opened this issue 2 years ago • 10 comments

Describe the bug

I have a Reolink D800 that fails to connect. Looking at Wireshark with the dissector, I see that after the TCP handshake, neolink sends a Baichuan login, type 1 packet to which the camera responds with an ACK and then an RST. Not sure if relevant, but the neolink client is on a different VLAN and subnet than the camera and the camera VLAN egress traffic is blocked by a firewall. Reolink Android app for example works fine in this setup.

To Reproduce

  1. Create this configuration file:
bind = "0.0.0.0"

[[cameras]]
name = "camera"
username = "admin"
password = "password"
address = "192.168.20.239:9000"
discovery = "local"
  1. Launch Neolink:
./neolink rtsp --config=neolink.toml
  1. Log:
[2023-12-09T08:50:33Z INFO  neolink::utils] camera: Connecting to camera at Address: 192.168.20.239:9000
[2023-12-09T08:50:33Z INFO  neolink_core::bc_protocol] camera: Trying TCP discovery
[2023-12-09T08:50:33Z INFO  neolink_core::bc_protocol] camera: Discovery failed
[2023-12-09T08:50:33Z WARN  neolink::common::camthread] Connection Lost: Failed to connect to camera camera at Address: 192.168.20.239:9000 on channel 0
    
    Caused by:
        Cannot contact camera at given address

Expected behavior

Connection succeeds.

Versions

NVR software: N/A Neolink software: v0.6.2 Reolink camera model and firmware: D800, FW: v3.1.0.802_22011003

Saduff avatar Dec 09 '23 09:12 Saduff

Okay, looking at https://github.com/QuantumEntangledAndy/neolink/discussions/174#discussioncomment-7393946, I see that:

The uid is needed for the hello call to the camera once the ip is know.

So even if the IP is known, the UID is still needed.

Reolink Android app for example works fine in this setup.

What I meant by that is that all the cameras are working fine when adding the Reolink NVR in the app. If I connect to the cameras VLAN, then I can see that the D800 cameras don't have a UID at all and even the Reolink app is not able to connect to the D800 cameras directly. Other models with a UID work fine.

Is it not possible to connect to these cameras then? The only option is through the Reolink NVR? How come https://github.com/thirtythreeforty/neolink mentions that it has been tested with B800/D800? There must be a way since the Reolink NVR can connect to them.

Saduff avatar Dec 09 '23 10:12 Saduff

My D800's connect fine with this code.

bind = "0.0.0.0"

[[cameras]]
name = "Ch1"
username = "admin"
password = "MyPassword"
address = "192.168.0.14"

bwthor avatar Dec 10 '23 02:12 bwthor

My D800's connect fine with this code.

bind = "0.0.0.0"

[[cameras]]
name = "Ch1"
username = "admin"
password = "MyPassword"
address = "192.168.0.14"

Interesting. Are those D800s from the NVR kit or purchased separately? And can you add them via the Reolink Windows client or Android app? I've tried the Android app and it won't connect either. Do they have a UID? Mine don't.

Saduff avatar Dec 10 '23 02:12 Saduff

Yes, they were from an NVR kit, and are connected directly to my regular network using PoE injection. I am not using the NVR in the setup at all. I can connect from any of the Reolink apps, but not with UID, I needed to choose LAN, and they are auto detected there. My RLC-810a has UID, and shows up in the app automatically, only needed to input the correct password. If I recall, I did have to add them, then set the password through the Reolink app before they would work with Neolink.

bwthor avatar Dec 10 '23 13:12 bwthor

I finally found the issue. Apparently the D800s only support one connection at a time. Mine were added to the Reolink NVR channels so the NVR is constantly connected to the cameras. After deleting the camera from the NVR, I could then connect directly to the camera with the official Reolink app. Then, if you try to add it back to the NVR, the connection will fail as long as the app is open and streaming. Once you close the app, the NVR can connect again. Then if you reopen the app, the stream will fail to load again. This confirms there can only be one connection. Knowing this, I got Neolink working as well.

I didn't find any documentation about this, just a comment from someone after searching the internet that tipped me off about the connection limit. I feel like there should be a troubleshooting section in the documentation that mentions this.

Saduff avatar Dec 11 '23 02:12 Saduff

Having the same issue with the B800 cams, but I'm connecting through the NVR instead. It will work for a few days, then out of nowhere it starts giving the same errors. Sometimes I can restart neolink and it works for a while, other times I have to restart the NVR itself.

Dec 16 20:04:40 neolink neolink[1294]: [2023-12-16T20:04:40Z INFO  neolink::common::camthread] Attempt>
Dec 16 20:04:40 neolink neolink[1294]: [2023-12-16T20:04:40Z INFO  neolink::utils] shed: Connecting to>
Dec 16 20:04:40 neolink neolink[1294]: [2023-12-16T20:04:40Z INFO  neolink_core::bc_protocol] shed: Tr>
Dec 16 20:04:40 neolink neolink[1294]: [2023-12-16T20:04:40Z INFO  neolink_core::bc_protocol] shed: Di>
Dec 16 20:04:40 neolink neolink[1294]: [2023-12-16T20:04:40Z WARN  neolink::common::camthread] Connect>
Dec 16 20:04:40 neolink neolink[1294]:     
Dec 16 20:04:40 neolink neolink[1294]:     Caused by:
Dec 16 20:04:40 neolink neolink[1294]:         Cannot contact camera at given address

MRobi1 avatar Dec 16 '23 20:12 MRobi1

Probably late here but I'll address what I can. The UID is only needed on UDP connections not TCP over port 9000.

When connecting to a NVR you point neolink towards the NVRs ip addresses not the cameras. You can use the channel option if you have multiple cameras on the same NVR.

In neolink we only open one connection to the camera and try to stream both sub and main through it but if that fails you should try setting it up to only stream one of them.

QuantumEntangledAndy avatar Apr 26 '24 06:04 QuantumEntangledAndy

Thanks for clarifying.

When connecting to a NVR you point neolink towards the NVRs ip addresses not the cameras.

I probably didn't try that because my use case was about potentially getting rid of the NVR, so I needed the direct connection to cameras to work. But as it turned out, nothing else can connect directly to cameras while the NVR is still connected. It doesn't even have to be the NVR. If you have a Reolink client actively streaming directly from the camera, Neolink will likewise not be able to connect.

However, I've kept the NVR and can get the RTSP streams from it, so I have no need for Neolink. It's still a good option to have available though.

I feel like there should be a troubleshooting section in the documentation that mentions this.

I was going to close this issue after figuring out my issue, but I kept it open for that reason. I still believe it would be a good idea to mention this somewhere in the documentation since I probably wasn't the first nor will I be the last person to run into this.

Saduff avatar Apr 27 '24 05:04 Saduff

Hello, I am facing the same issue described here. My setup is

  • RLN8-410
  • 4x D800
  • 1x B800
  • 1x E1 Pro
  • 1x reolink doorbell POE

The cameras are connected to a POE switch and the switch is connected to the dvr. I have all the cameras set up in the DVR.

I cannot add any single-camera unless I shut down the DVR. Same thing with neolink: can't connect to any camera unless I shut down the DVR.

Apparently only one connection at a time is permitted.

I also tried to enable hyBridge mode but I still get the same behaviour.

Reolink Doorbell and E1 Pro are the only cameras that can work with multiple connections. From what I understand, they can have multiple connetions because they have UID, while B800 and D800 don't.

I could use neolink pointing at the NVR but there is one big problem: you cannot get Main stream.

federicotravaini avatar Dec 28 '24 14:12 federicotravaini

@federicotravaini i know I'm quite late (work is busy atm) but you can specify which stream with the stream = "main" in the [[cameras]] section of the config. The default is "both"

QuantumEntangledAndy avatar Jan 26 '25 12:01 QuantumEntangledAndy