QuantumEntangledAndy / neolink

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

Floodlight latched when set to trigger from motion #254

Closed CodeFatherG closed 1 month ago

CodeFatherG commented 1 month ago

Describe the bug

When using mqtt and "Night Smart Mode" is set, the floodlight remains on after motion is no loner detected. When neolink is not running, the floodlight turns off after motion.

To Reproduce

Steps to reproduce the behavior. Example:

  1. Create this configuration file:
    
    # Expose on all networks
    bind = "0.0.0.0"

Define RTSP user

[[users]] name = "admin" pass = ...

Front Camera

[[cameras]] name = "front_door_camera" discovery = "local" # Discover local username = "admin" # Camera user password = ... address = "..." # Reserved ip of camera uid = "..." # Camera UID stream = "Main" idle_disconnect = true # Disconnect on idle for battery [cameras.pause] on_motion = true # Should pause when no motion on_client = true # Should pause when no rtsp client [cameras.mqtt] [cameras.mqtt.discovery] topic = "homeassistant" # Enable Discovery with the following controls features = ["Floodlight", "Camera", "Motion", "Reboot", "Battery", "Siren"]

[mqtt] broker_addr = "127.0.0.1" # local broker port = 1883 credentials = ...

2. Enable Smart Night Mode in app
3. Launch Neolink:

version: '3.8' services: neolink: image: quantumentangledandy/neolink:latest command: ["/usr/local/bin/neolink", "mqtt-rtsp", "--config=/etc/neolink.toml"] container_name: neolink ports:

Expected behavior

floodlight is turned off when motion is not detected

Logs

neolink  | [2024-05-11T07:25:18Z INFO  neolink::utils] front_door_camera: Connecting to camera at Address: ..., UID: ...
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol] front_door_camera: Trying TCP discovery
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol] front_door_camera: Trying local discovery
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 255.255.255.255:2015 with tid: 214
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 255.255.255.255:2018 with tid: 71
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 192.168.0.255:2015 with tid: 136
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 192.168.0.255:2018 with tid: 221
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.21.255.255:2015 with tid: 224
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.21.255.255:2018 with tid: 129
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.17.255.255:2015 with tid: 148
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.17.255.255:2018 with tid: 217
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.20.255.255:2015 with tid: 230
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.20.255.255:2018 with tid: 150
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.19.255.255:2015 with tid: 252
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.19.255.255:2018 with tid: 17
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.18.255.255:2015 with tid: 207
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.18.255.255:2018 with tid: 254
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: ...:2018 with tid: 106
neolink  | [2024-05-11T07:25:18Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: ...:2015 with tid: 78
neolink  | [2024-05-11T07:25:19Z INFO  neolink_core::bc_protocol::connection::discovery] Got expected reply
neolink  | [2024-05-11T07:25:19Z INFO  neolink_core::bc_protocol::connection::discovery] Direct connect success at 255.255.255.255:2015 client: -31393138, device: 304
neolink  | [2024-05-11T07:25:19Z INFO  neolink_core::bc_protocol::connection::discovery] Returning direct connect: ConnectResult { addr: ...:39667, client_id: -31393138, camera_id: 304, sid: 0 }
neolink  | [2024-05-11T07:25:19Z INFO  neolink_core::bc_protocol] front_door_camera: Local discovery success ... at ...:39667
neolink  | [2024-05-11T07:25:19Z INFO  neolink::utils] front_door_camera: Logging in
neolink  | [2024-05-11T07:25:21Z INFO  neolink::utils] front_door_camera: Connected and logged in
neolink  | [2024-05-11T07:25:21Z ERROR neolink_core::bc::de] header.msg_id: 291
neolink  | [2024-05-11T07:25:21Z ERROR neolink_core::bc::de] processed_payload_buf: [3C, 3F, 78, 6D, 6C, 20, 76, 65, 72, 73, 69, 6F, 6E, 3D, 22, 31, 2E, 30, 22, 20, 65, 6E, 63, 6F, 64, 69, 6E, 67, 3D, 22, 55, 54, 46, 2D, 38, 22, 20, 3F, 3E, A, 3C, 62, 6F, 64, 79, 3E, A, 3C, 46, 6C, 6F, 6F, 64, 6C, 69, 67, 68, 74, 53, 74, 61, 74, 75, 73, 4C, 69, 73, 74, 20, 76, 65, 72, 73, 69, 6F, 6E, 3D, 22, 31, 2E, 31, 22, 20, 2F, 3E, A, 3C, 2F, 62, 6F, 64, 79, 3E, A]::Ok("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<body>\n<FloodlightStatusList version=\"1.1\" />\n</body>\n")
neolink  | [2024-05-11T07:25:21Z ERROR neolink_core::bc::de] e: Custom("missing field `FloodlightStatus`")
neolink  | [2024-05-11T07:25:23Z WARN  neolink::common::camthread] front_door_camera: Connection Lost: Send Error
neolink  | [2024-05-11T07:25:23Z INFO  neolink::common::camthread] front_door_camera: Attempt reconnect in 400ms
neolink  | [2024-05-11T07:25:23Z INFO  neolink::utils] front_door_camera: Connecting to camera at Address: ..., UID: ...
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol] front_door_camera: Trying TCP discovery
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol] front_door_camera: Trying local discovery
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 255.255.255.255:2015 with tid: 139
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 255.255.255.255:2018 with tid: 40
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 192.168.0.255:2015 with tid: 189
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 192.168.0.255:2018 with tid: 139
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.21.255.255:2015 with tid: 205
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.21.255.255:2018 with tid: 111
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.17.255.255:2015 with tid: 232
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.17.255.255:2018 with tid: 110
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.20.255.255:2015 with tid: 203
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.20.255.255:2018 with tid: 163
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.19.255.255:2015 with tid: 57
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.19.255.255:2018 with tid: 146
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.18.255.255:2015 with tid: 117
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: 172.18.255.255:2018 with tid: 115
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: ...:2018 with tid: 89
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Trying a direct connect to: ...:2015 with tid: 136
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Got expected reply
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Direct connect success at ...:2015 client: -1697458391, device: 305
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol::connection::discovery] Returning direct connect: ConnectResult { addr: ...:39667, client_id: -1697458391, camera_id: 305, sid: 0 }
neolink  | [2024-05-11T07:25:23Z INFO  neolink_core::bc_protocol] front_door_camera: Local discovery success ... at ...:39667
neolink  | [2024-05-11T07:25:23Z INFO  neolink::utils] front_door_camera: Logging in
neolink  | [2024-05-11T07:25:31Z INFO  neolink::utils] front_door_camera: Connected and logged in
neolink  | [2024-05-11T07:25:33Z INFO  neolink::common::camthread] front_door_camera: Camera time is already set: 2024-05-11 17:25:29.0 -10:00:00
neolink  | [2024-05-11T07:26:17Z INFO  neolink::rtsp::stream] front_door_camera: Enabling Motion
neolink  | [2024-05-11T07:26:29Z INFO  neolink::rtsp::stream] front_door_camera: Enabling Push Notification
neolink  | [2024-05-11T07:26:59Z INFO  neolink::rtsp::stream] front_door_camera: Pausing Push Notification
neolink  | [2024-05-11T07:27:43Z INFO  neolink::rtsp::stream] front_door_camera: Enabling Push Notification
7neolink  | [2024-05-11T07:28:13Z INFO  neolink::rtsp::stream] front_door_camera: Pausing Push Notification

Versions

Neolink software: latest Reolink camera model and firmware: Model Argus Eco Ultra v3.0.0.2773_23100910

CodeFatherG commented 1 month ago

Sorry I have just done further testing, It looks like the floodlight does turn off but its a lot longer when running neolink vs without

QuantumEntangledAndy commented 1 month ago

We don't make any changes to the camera directly. So maybe this is normal behaviour for the camera when there's an active connection. Not really something I can address.