elad-bar / ha-blueiris

Integration with Blue Iris Video Security Software
179 stars 42 forks source link

Cameras Stop Working #217

Open bwthor opened 9 months ago

bwthor commented 9 months ago

I've had the BI/HA Integration running for quite some time, and have had zero issues. This past week I've started losing all my cameras after a number of hours. BI is working with no issues. In order to get them working again, I need to Reload the Integration, and then it works just fine again. Logs below show some issues.

I'd be more than happy to look at other areas for logs and such if someone can point me in the right direction. HA is updated to the latest and BI is as well (5.8.1.1).

2023-11-26 17:10:54.949 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from ThorNVR Front Door: [Errno 104] Connection reset by peer
2023-11-26 17:10:54.955 ERROR (MainThread) [custom_components.blueiris.camera] Error getting new camera image from ThorNVR Backyard: [Errno 104] Connection reset by peer
2023-11-26 17:11:05.046 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from ThorNVR Front Door
2023-11-26 17:11:14.477 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from ThorNVR Garage
2023-11-26 17:11:14.481 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from ThorNVR Backyard
2023-11-26 17:11:15.143 ERROR (MainThread) [custom_components.blueiris.camera] Timeout getting camera image from ThorNVR Front Door
2023-11-26 17:11:21.337 WARNING (MainThread) [custom_components.blueiris.api.blue_iris_api] Request #0 to BlueIris (http://192.168.0.12:85) failed, Data: {'cmd': 'camlist', 'session': '6ae0456931407055795c6ca534033ec5'}, Response: {'result': 'fail', 'session': '6ae0456931407055795c6ca534033ec5', 'data': {'reason': 'Invalid session'}}
2023-11-26 17:11:21.450 WARNING (MainThread) [custom_components.blueiris.api.blue_iris_api] Request #1 to BlueIris (http://192.168.0.12:85) failed, Data: {'cmd': 'camlist', 'session': '6ae0456931407055795c6ca534033ec5'}, Response: {'result': 'fail', 'session': '6ae0456931407055795c6ca534033ec5', 'data': {'reason': 'Invalid session'}}
2023-11-26 17:11:21.527 ERROR (MainThread) [custom_components.blueiris.managers.home_assistant] Failed to async_update, Error: 'str' object has no attribute 'get', Line: 196
wmichael3 commented 5 months ago

One other thing I've noticed that I didn't see mentioned in this thread is the hitting of the connection limit in BI, which is set to 50 by default. It seems that the HA integration creates a lot of connections - maybe 1 per camera? - and if you have a couple people using HA and surfing cameras you can all of a sudden get broken camera images or thumbnails without any obvious error message. I bumped my connection limit to 75 and that fixed it. (We have 7 cameras) Reloading the integration probably terminates all existing connections so there is a chance that this is another underlying issue along with authentication, which I think is the main one.

Exempt the IP and increase the connection limit and I bet it will solve just about every problem. I see you have it set to 99, which is good. I've never had to reload the BI integration after a BI update or restart.

johnjoemorgan commented 5 months ago

Yep 16 cameras in my set up but I didn't change that setting yesterday (maybe I had in the past). Everything is still running smoothly. No feed has become unavailable from BI

rlsgit commented 5 months ago

All seems fine now with those changes...still some log entries in HA i'd like to clean up though...


From: johnjoemorgan @.> Sent: Wednesday, April 10, 2024 9:34 PM To: elad-bar/ha-blueiris @.> Cc: Robert Stephens @.>; Comment @.> Subject: Re: [elad-bar/ha-blueiris] Cameras Stop Working (Issue #217)

Yep 16 cameras in my set up but I didn't change that setting yesterday (maybe I had in the past). Everything is still running smoothly. No feed has become unavailable from BI

— Reply to this email directly, view it on GitHubhttps://github.com/elad-bar/ha-blueiris/issues/217#issuecomment-2048775216, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADCD5HKSGTQ2F7RDE2AO5JTY4XSA3AVCNFSM6AAAAAA74ALH2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYG43TKMRRGY. You are receiving this because you commented.Message ID: @.***>

andrea-mattioli commented 1 month ago

Hello everyone, I also had this problem. I have a somewhat complex network at home with segregations for video surveillance, IoT, and other networks. By doing network dumps, I practically noticed that Home Assistant uses port 1900/UDP on the multicast address 239.255.255.250 to keep the media player of the cameras active. By testing and dropping this connection, after a while, it sets the camera entity to "inactive," and the streaming flow doesn't work. If I restart the integration, it starts again, but after a short while, it stops as it receives drops from the firewall and gets the error: Error opening stream (HTTP_UNAUTHORIZED, Server returned 401 Unauthorized (authorization failed), http://192.168.1.3:81/h264/Esterno/temp.m3u8?session=517d367311ce3486391806c02f2c4de2) I hope this can be helpful to someone.