QuantumEntangledAndy / neolink

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

Connection to Argus 2 won't stay disconnected when idle #213

Open tsherr opened 4 months ago

tsherr commented 4 months ago

I've got an Argus 2, and I'm connecting via neolink with the following config:

bind = "0.0.0.0"
[[cameras]]
name = "back2"
username = "admin"
password = ***********
uid = **********
push_notifications = false
idle_disconnect = true

[cameras.pause]
on_client = true
on_motion = true
timeout = 2.1

Everything seems to work fine, I'm able to create a picture entity card for the camera on my dashboard to view the Argus 2 stream.

However, I would expect that the connection to the camera stops when not in use (due to idle_disconnect = true). This does not seem to be the case - if I'm not viewing the camera card (the HA dashboard is not being viewed), the camera battery continues to drain and the logs show regular client activations every 15 seconds:

...
[2024-02-14T18:38:33Z DEBUG neolink::common::neocam] back2: InUse
[2024-02-14T18:38:34Z DEBUG neolink::common::neocam] back2: Idle
[2024-02-14T18:38:48Z DEBUG neolink::common::neocam] back2: InUse
[2024-02-14T18:38:49Z DEBUG neolink::common::neocam] back2: Idle
[2024-02-14T18:39:03Z DEBUG neolink::common::neocam] back2: InUse
[2024-02-14T18:39:03Z DEBUG neolink::common::neocam] back2: Idle
...

Occasionaly I see some other entries (see below), but for the most part it's just InUse/Idle:

...
[2024-02-14T18:41:25Z DEBUG neolink::common::streamthread] Watchdog kicking the stream
[2024-02-14T18:41:25Z DEBUG neolink::common::streamthread] Running Stream Instance Task
[2024-02-14T18:41:27Z INFO  neolink::rtsp] back2: Pausing Client
[2024-02-14T18:41:29Z DEBUG neolink::rtsp] Clearing old elements
[2024-02-14T18:41:29Z DEBUG neolink::rtsp] Building H264 Pipeline
[2024-02-14T18:41:29Z DEBUG neolink::rtsp] Building Aac pipeline
[2024-02-14T18:41:29Z INFO  neolink::rtsp] back2: Activating Client
...

It's possible I'm misunderstanding what the documentation means by the following:

When idle_disconnect = true neolink will disconnect from the camera 30s after it stops being used. Neolink considers it as being used if there is an active stream running, or if there is motion being detected or an mqtt command being run.

I would assume that since I'm not viewing the dashboard, there is no active stream running. I'm also certain that there isn't any motion that could be waking up the camera at regular intervals like the logs would suggest.

Is this an issue with neolink or am I not understanding how to correctly configure and use the stream?

Versions NVR software: N/A Neolink software: HA neolink add-on (using neolink v0.6.2) Reolink camera model and firmware: Argus 2 firmware v. 0129_704_572_48

QuantumEntangledAndy commented 2 months ago

I suspect this is to do with the push notifications there was an issue where they would keep it connected. This has been fixed not but could you confirm by testing the latest build from master