HikSink icon indicating copy to clipboard operation
HikSink copied to clipboard

Problem with constant reconnection: "Camera errored: Camera closed connection. Attempting reconnection..."

Open MindrustUK opened this issue 3 years ago • 6 comments

Just installed Hiksink (Standalone) and have it pointed at a Hikvision NVR. While it works, it keeps re-connecting as follows:

2022-06-15T11:01:59.543416Z  INFO hik_sink: HikSink MQTT bridge running
2022-06-15T11:01:59.543578Z  INFO Camera coms{camera=nvr id=nvr}: hik_sink::hikapi::camera: Initiating camera connection...
2022-06-15T11:01:59.706182Z  INFO Camera coms{camera=nvr id=nvr}: hik_sink::hikapi::camera: Camera connection established
2022-06-15T11:01:59.954008Z  INFO hik_sink::mqtt::connection: Connected to MQTT broker.
2022-06-15T11:02:14.121856Z  WARN Camera coms{camera=nvr id=nvr}: hik_sink::hikapi::camera: Camera errored: Camera closed connection. Attempting reconnection...
2022-06-15T11:02:14.294195Z  INFO Camera coms{camera=nvr id=nvr}: hik_sink::hikapi::camera: Camera connection established
2022-06-15T11:02:50.662578Z  WARN Camera coms{camera=nvr id=nvr}: hik_sink::hikapi::camera: Camera errored: Camera closed connection. Attempting reconnection...
2022-06-15T11:02:50.806763Z  INFO Camera coms{camera=nvr id=nvr}: hik_sink::hikapi::camera: Camera connection established

Any ideas what could be causing this or if it's intended behavior? I would've thought connections should be persistent once established?

MindrustUK avatar Jun 15 '22 11:06 MindrustUK

The NVR is probably returning responses HikSink can't interpret. Hikvision NVRs have been the worst offenders when it comes to non-conforming event streams, so I generally recommend pointing HikSink directly at the cameras. What is the model of the NVR? Can you enable DEBUG in the config and post the logs? Cheers.

CornerBit avatar Jun 17 '22 13:06 CornerBit

Thanks for responding, the model of the NVR is: DS-7608NXI-I2

Log as attached: [nvr-debug.log](https://github.com/CornerBit/HikSink/files/8928574/nvr-debug.log

MindrustUK avatar Jun 17 '22 14:06 MindrustUK

The NVR is closing the connection with HikSink. Can you take a look at the NVR side and see if there are any warnings in the logs?

CornerBit avatar Jun 18 '22 02:06 CornerBit

As per attached screenshot, the notable event appears to be related to: "Remote: Alarm Disarming/ Remote: Alarm Arming", any thoughts?

Screenshot from 2022-06-20 10-24-58

MindrustUK avatar Jun 20 '22 09:06 MindrustUK

That's a very strange message to show up! Accessing the event stream shouldn't perform any actions on the NVR. Can you check if your NVR is on the latest version?

CornerBit avatar Jun 26 '22 08:06 CornerBit

I've just made sure to update to the latest firmware (V4.61.010 build 220606 ) still seeing the problem with the associated armed / disarmed messages. I'll see if I can turn up anything more with additional investigation...

MindrustUK avatar Jun 26 '22 20:06 MindrustUK