IPCam Signal "Dies"

Forum for questions and support relating to the 1.30.x releases only.
Locked
dlupfert
Posts: 5
Joined: Sun Apr 08, 2018 2:41 pm

IPCam Signal "Dies"

Post by dlupfert »

Good morning,


I am running 1.30.4 on Debian installed with the directions on the website for the "Simplest" or "Easiest" install (Forget the exact lingo).


My problem is that 2 of my three IP cameras (D-Link DCS-934L) seem to loose connection and not come back. In order to get them back I have to uncheck/check the enabled option in the Monitor Function settings and they come back.

* The two that have this problem do not do it together, one will be fine for some time then drop and the other will stay up.
* The log does not reflect an dropped signals, Occasionally I see the engine not started messages, or reconnecting messages in the log but this is when they are working fine, they always recover from the error and keep working until they drop for real with no error.
* The Source text stays green and doesn't turn red when this happens.
* One Camera is set to record, the other is motion detect.

Originally they were all set as a remote source, but then after doing some searching here and on Google I switched both to FFMPEG, but the same problem persisted.


I'm curious if this could be a firewall(UFW on Debain), DOS attack prevention, Apache/PHP max concurrent connections issue. Anyone have anything to check?


Thank you,


--Dan
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Re: IPCam Signal "Dies"

Post by Paranoid »

Firewalls can cause this, but there has to be no data passing between the camera and the server for a period of time. If your camera are connected vi WiFi then this could happen if they lose the WiFi connection.

What you could do is shorten the "keepalive" period. That way the server will quickly detect when it has lost the connection to the camera and restart the capture daemon.

Here's a link describing what keepalive is and how to configure it. https://www.tldp.org/HOWTO/html_single/ ... ive-HOWTO/
dlupfert
Posts: 5
Joined: Sun Apr 08, 2018 2:41 pm

Re: IPCam Signal "Dies"

Post by dlupfert »

Thank you for your reply,

They are currently connected to WiFi so I read the page linked and did a little digging and ended up following the tutorial at https://www.ehowstuff.com/configure-lin ... e-setting/

I copied those setting values as well. Going to let things run for a day or so and see if the issue comes back.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: IPCam Signal "Dies"

Post by bbunge »

Check your resources. If Zoneminder fills up the tmpfs, AKA /dev/shm, your cameras can drop out. Solution is to lower the camera resolution and frame rate or add more RAM to the server.

Oh, that is the Easy Way install procedure...
https://wiki.zoneminder.com/Debian_9_64 ... e_Easy_Way

Just to let you know I am not entirely pleased that Zoneminder runs well on Debian 9. Ubuntu 16.04 is a better bet in my opinion...
dlupfert
Posts: 5
Joined: Sun Apr 08, 2018 2:41 pm

Re: IPCam Signal "Dies"

Post by dlupfert »

With the settings change, one of the cameras is still experiencing the same problems. Temp storage and resources shouldn't be an issue on this server, it hasn't run out or gotten close to filling up what it has.

Ubuntu is an option? I could always run a VM and do it that way but it seems like a waste just for ZoneMinder.

Thanks for any additional help!
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Re: IPCam Signal "Dies"

Post by Paranoid »

Next time it happens run the following on the ZM server:

Code: Select all

netstat -tan
and look for a line like this:

Code: Select all

tcp        0      0 192.168.31.5:56268      192.168.31.57:554       ESTABLISHED
Where one of the IP addresses is the server and the other is the camera. If it exists then that tells you that there is a connection between the camera and the server. You can then run tcpdump like this:

Code: Select all

tcpdump -n -s0 host 192.168.31.5 and port 56268
or

Code: Select all

tcpdump -n -s0 host 192.168.31.57 and port 554
If you get lots of output shooting past then that tells you that the camera is sending lots of data to the server. If you only get the occasional packet from both the camera and the server then that will mean the camera isn't sending a video stream.

NOTE: You should make sure no other application (browsers etc) are connected to the camera if you do these tests since they will interfere with the results.
dlupfert
Posts: 5
Joined: Sun Apr 08, 2018 2:41 pm

Re: IPCam Signal "Dies"

Post by dlupfert »

I just had to reboot the server (unrelated to ZoneMinder), so everything is working now that it just came back up. Just wanted to reply that I got your suggestion and will try it in a day or two once it starts dropping again.

Thanks!
dlupfert
Posts: 5
Joined: Sun Apr 08, 2018 2:41 pm

Re: IPCam Signal "Dies"

Post by dlupfert »

Just was able to do the test. The cam shows no data coming through.

As soon as I disabled the monitor the data started flowing constantly again (weird?), and of course kept going once I enabled and viewed it.

Do you think this is leaning towards a camera issue, router/packet priority issue, or Zoneminder? It seems like the traffic is timing out, but Zoneminder isn't catching the drop and trying to restart itself.
Paranoid
Posts: 129
Joined: Thu Feb 05, 2009 10:40 pm

Re: IPCam Signal "Dies"

Post by Paranoid »

I think its a wifi issue. The camera loses its wifi connection long enough for it to close the stream to zoneminder. Because the wifi is down zoneminder is never told about this and sits there just waiting for data on what it thinks is a good connection.
If you are unable to improve the wifi connection then you should reduce the keepalive time so that zoneminder detects the dead connection.
By default, on linux, the keepalive is set to 7200 seconds + 9 x 75 (I think) which is about 2 hours 12 minutes. This means zoneminder will take this long to detect the connection is dead, close it and re-establish a new one.
If you reduce it to 60 seconds + 10 x 5 then it would only be a couple of minutes before zoneminder realises the connection is dead and starts attempting to re-establish it.
Locked