QuantumEntangledAndy / neolink

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

MQTT eventually dies and does not reconnect #141

Closed kevin-david closed 10 months ago

kevin-david commented 10 months ago

This seems to pretty consistently happen with my camera after ~20-30 minutes. Restarting the app fixes the problem temprorarily.

[2023-08-24T11:59:48Z INFO  neolink::mqtt::discovery] Enabled MQTT discovery for backyard_camera with friendly name Backyard Camera
[2023-08-24T12:07:08Z WARN  neolink_core::bc_protocol::snap] Snap did not recieve expected number of byes
[2023-08-24T12:09:48Z WARN  neolink_core::bc_protocol::snap] Snap did not recieve expected number of byes
[2023-08-24T12:10:33Z WARN  neolink_core::bc_protocol::snap] Snap did not recieve expected number of byes
[2023-08-24T12:11:34Z WARN  neolink_core::bc_protocol::snap] Snap did not recieve expected number of byes
[2023-08-24T12:15:57Z WARN  neolink_core::bc_protocol::snap] Snap did not recieve expected number of byes
[2023-08-24T12:25:14Z WARN  neolink_core::bc_protocol::snap] Snap did not recieve expected number of byes
[2023-08-24T12:29:31Z ERROR neolink::mqtt::mqttc] Failed to send offline message to mqtt: Failed to send mqtt requests to eventloop. Is the MQTT topic name valid?
[2023-08-24T12:29:31Z WARN  neolink::mqtt] Error: MQTT Threads aborted

    Caused by:
        0: MQTT connection dropped
        1: Flush timeout. Retrying
[2023-08-25T07:08:00Z INFO  neolink::mqtt::mqttc] Starting MQTT Client for backyard_camera

This will happen a few times and eventually the device will become unavailable. Note that this doesn't happen with my floodlight which has older firmware - only the new one, same as an the issue from here: https://github.com/QuantumEntangledAndy/neolink/issues/117#issuecomment-1665636281.

Versions

NVR software: N/A Neolink software: latest from master branch Reolink camera model and firmware:

QuantumEntangledAndy commented 10 months ago

It seems that the snap command is not recieivng all the packets for the image. If you don't use the preview part of mqtt you can disable it. Else I will need packets from neolink to address it

kevin-david commented 10 months ago

Thanks - I wasn't sure if that was related or not, but adding

mqtt.enable_battery = false
mqtt.enable_preview = false

To my config did indeed fix the problem!

QuantumEntangledAndy commented 10 months ago

I'm working on a major refractor at the moment. And part of it will including checking what video streams the camera supports so hopefully this will help with that.