QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
297 stars 44 forks source link

Failed to connect to the camera [Reolink GO] #79

Closed LadislavMargai closed 1 year ago

LadislavMargai commented 1 year ago

Describe the bug When I try to save an image/turn off the PIR sensor/anything, it will always fail on error Error: Failed to connect to the camera, check credentials and network.

To Reproduce

  1. Configuration file:
    
    bind = "0.0.0.0"

[[cameras]] name = "driveway" username = "admin" password = "my_password" uid = "my_camera_uid" discovery = "remote"

2. Launch Neolink: `neolink --config sample_config.toml image --file-path C:\temp driveway`
3. I tried all the discovery options `local`, `remote`, `map`, `relay`
4. I tried to turn off the firewall, different ISP provider, no success

**Result**

[2023-05-03T20:40:56Z INFO neolink] Neolink 42ff221b0735bf55fbf9ba2508329ef1fdb540e9 release [2023-05-03T20:40:56Z INFO neolink::utils] driveway: Connecting to camera at UID: my_camera_uid Error: Failed to connect to the camera, check credentials and network

Caused by: 0: Failed to connect to camera driveway at UID: my_camera_uid on channel 0 1: Cannot contact camera at given address



**Expected behavior**
It would connect to the camera and take an image/turn off the PIR/any other action.

**Versions**
NVR software: n/a
Neolink software: [Neolink 0.5.8](https://github.com/QuantumEntangledAndy/neolink/releases/tag/0.5.8), windows 10
Reolink camera model and firmware: Reolink GO, v1.0.213.00
QuantumEntangledAndy commented 1 year ago

Is this a cellular? Haven't REd those yet. I believe that there connection method is different. I was originally hoping that the relay mode would help with that since it connects via Reolink but it seems there's something different with its communication.

If you can provide wireshark dumps of the communications I might be able to figure out what is different With these camera.

LadislavMargai commented 1 year ago

Oh, I thought the issues with cellular cameras were already addressed.

QuantumEntangledAndy commented 1 year ago

Tracking this in #86. Please do test if you are able

Devristo commented 1 year ago

I am not the OP, but it works with my Reolink Go Plus. I only tested the mainStream (which is very choppy) and the subStream. The subStream works great.

QuantumEntangledAndy commented 1 year ago

Try decreasing your bitrate a bit to get mainstream to work. Very choppy usually means its too much data for neolink to handle well

Devristo commented 1 year ago

That does help, but even on lowest bitrate (1024) it is a bit choppy. But I think it could be 4g reception related, anyway I just found this piece of software half hr ago. Really happy with the result already!

QuantumEntangledAndy commented 1 year ago

Really? Well you have good timing then. Cellular has been on the todo list for months. I'm going to work on client pause updates next so that it only connects to sub/main stream when a rtsp cline is connected. Should let us watch the substream constantly and then can just update to main when we need to (frigate does this well I think)

QuantumEntangledAndy commented 1 year ago

You can also play with the buffer_size = 100 to try and smooth it out. The max is 500 so try that and see if it works. It will mean that your stream will be futher behind live though

PrplHaz4 commented 1 year ago

Seems to work pretty good for me too - nice work @QuantumEntangledAndy ! I know you've been battling this one for a while.

For those looking to test, the docker image is here: quantumentangledandy/neolink:feature-cellular

mainStream performance was better than expected on my medium quality LTE connection. image

QuantumEntangledAndy commented 1 year ago

Sounds good, I'm going to get it merged and release as 0.5.12