QuantumEntangledAndy / neolink

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

Camera Argus Eco Ultra wakes up every 5min by push notification #235

Closed tbnobody closed 2 months ago

tbnobody commented 2 months ago

Describe the bug During the day when the camera was alone in a room I've just realized that neolink received push notifications every 5min. See log ouput below. Not sure if this is a bug or a feature or just related to camera specific settings? At first I thought it's related to brightness changes during the day or shadows, but it happens exactly every 5 minutes.

[2024-04-12T14:34:41Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:34:41Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:34:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:34:45Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:34:41.0 -01:00:00
[2024-04-12T14:35:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:39:40Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:39:42Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:39:42Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:39:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:39:45Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:39:42.0 -01:00:00
[2024-04-12T14:40:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:44:40Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:44:41Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:44:41Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:44:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:44:45Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:44:42.0 -01:00:00
[2024-04-12T14:45:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:49:22Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:22Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:49:22Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:49:22Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:49:23Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:49:23Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:49:23Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:49:26Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:49:22.0 -01:00:00
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:57Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:50:27Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:54:40Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:54:42Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:54:42Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:54:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:54:46Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:54:43.0 -01:00:00
[2024-04-12T14:55:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification[2024-04-12T14:34:41Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:34:41Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:34:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:34:45Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:34:41.0 -01:00:00
[2024-04-12T14:35:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:39:40Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:39:40Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:39:42Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:39:42Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:39:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:39:45Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:39:42.0 -01:00:00
[2024-04-12T14:40:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:44:40Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:44:40Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:44:41Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:44:41Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:44:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:44:45Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:44:42.0 -01:00:00
[2024-04-12T14:45:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:49:22Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:22Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:49:22Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:49:22Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:49:23Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:49:23Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:49:23Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:49:26Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:49:22.0 -01:00:00
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:49:57Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:50:27Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::utils] Camera01: Connecting to camera at Address: 192.168.1.156, UID: 9527xxxxxxxxxxxx
[2024-04-12T14:54:40Z INFO  neolink_core::bc_protocol] Camera01: Trying TCP discovery
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink::rtsp::stream] Camera01: Enabling Push Notification
[2024-04-12T14:54:40Z INFO  neolink_core::bc_protocol] Camera01: Trying local discovery
[2024-04-12T14:54:42Z INFO  neolink_core::bc_protocol] Camera01: Local discovery success 9527xxxxxxxxxxxx at 192.168.1.156:11771
[2024-04-12T14:54:42Z INFO  neolink::utils] Camera01: Logging in
[2024-04-12T14:54:43Z INFO  neolink::utils] Camera01: Connected and logged in
[2024-04-12T14:54:46Z INFO  neolink::common::camthread] Camera01: Camera time is already set: 2024-04-12 16:54:43.0 -01:00:00
[2024-04-12T14:55:10Z INFO  neolink::rtsp::stream] Camera01: Pausing Push Notification
bind = "0.0.0.0"

[mqtt]
broker_addr = "xxxx.xxxx.lan" # Address of the mqtt server
port = 1883 # mqtt servers port
credentials = ["neolink", "neolink"] # mqtt server login details

[[cameras]]
name = "Camera01"
discovery = "local"
username = "admin"
password = "xxxx"
uid = "9527xxxxxxxxxxxx"
address = "192.168.1.156"
idle_disconnect = true
buffer_size = 0
stream = "Main"

  [cameras.pause]
  on_motion = true # Should pause when no motion
  on_client = true # Should pause when no rtsp client
  timeout = 2.1 # How long to wait after motion stops before pausing

  [cameras.mqtt]
  enable_motion = false
  enable_light = false
  preview_update = 1000

Expected behavior Wakeup only on movements

Versions NVR software: None (just monitored the MQTT topics) Neolink software: v0.6.3.rc1 Reolink camera model and firmware: Argus Eco Ultra v3.0.0.2773_23100910

QuantumEntangledAndy commented 2 months ago

In order to get motion messages we need to be logged into the camera. Which means the battery drains very fast. This was an issue for quite some time. The solution we came up with was to use push notifications since the camera will send those during motion detection.

tbnobody commented 2 months ago

The solution we came up with was to use push notifications since the camera will send those during motion detection.

I understand this. The main question was, why are there push notifications exactly every 5min and whether this is a bug or a feature.

QuantumEntangledAndy commented 2 months ago

There's nothing we do to make push notifications happen this often.

Perhpas you could enable push notifications on your smart phone? Then see if you also get them this regularly?

You could also look into setting the RUST_LOG env variable to debug and it should print the details of the push notification

QuantumEntangledAndy commented 2 months ago

Looking through the code I recalled that we reconnect the push notifications every 5 mins because some cameras had issues with it forgetting that we have registered for the push notifications. But we are meant to be ignoring old messsages ids but perhaps something is up here

QuantumEntangledAndy commented 2 months ago

This should be fixed in latest now, so I will close this