Zoneminder won't stay connected to camera

Forum for questions and support relating to the 1.30.x releases only.
Locked
kennbr34
Posts: 48
Joined: Sat Jan 14, 2017 6:43 pm

Zoneminder won't stay connected to camera

Post by kennbr34 »

I have a couple of old analog cameras that I am connecting to with zmodopipe as outlined in this wiki post...

https://wiki.zoneminder.com/Zmodopipe

My problem is that despite zomodpipe, ffmpeg and ffserver all showing no problems, zoneminder consistently disconnects the camera and leaves it showing a white blank space on the viewer, and does not track events. I simply have to restart zoneminder, and then the camera will work again.

I've created a script that restarts zoneminder every 5 minutes, but it has been ocurring more frequently and within those 5 minutes. I'm pretty confident this is a problem with zoneminder specifically as zmodopipe doesn't show any problem with the connections, and ffmpeg/ffserver show that they're encoding and streaming as well.

Here are my log entries during the time one of the cameras went down and after I restarted it to fix it.

https://pastebin.com/ExnfSX7R
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder won't stay connected to camera

Post by bbunge »

kennbr34 wrote: Mon Sep 17, 2018 6:52 am I have a couple of old analog cameras that I am connecting to with zmodopipe as outlined in this wiki post...

https://wiki.zoneminder.com/Zmodopipe

My problem is that despite zomodpipe, ffmpeg and ffserver all showing no problems, zoneminder consistently disconnects the camera and leaves it showing a white blank space on the viewer, and does not track events. I simply have to restart zoneminder, and then the camera will work again.

I've created a script that restarts zoneminder every 5 minutes, but it has been ocurring more frequently and within those 5 minutes. I'm pretty confident this is a problem with zoneminder specifically as zmodopipe doesn't show any problem with the connections, and ffmpeg/ffserver show that they're encoding and streaming as well.

Here are my log entries during the time one of the cameras went down and after I restarted it to fix it.

https://pastebin.com/ExnfSX7R
Linux distro and version?
kennbr34
Posts: 48
Joined: Sat Jan 14, 2017 6:43 pm

Re: Zoneminder won't stay connected to camera

Post by kennbr34 »

bbunge wrote: Mon Sep 17, 2018 11:40 am
kennbr34 wrote: Mon Sep 17, 2018 6:52 am I have a couple of old analog cameras that I am connecting to with zmodopipe as outlined in this wiki post...

https://wiki.zoneminder.com/Zmodopipe

My problem is that despite zomodpipe, ffmpeg and ffserver all showing no problems, zoneminder consistently disconnects the camera and leaves it showing a white blank space on the viewer, and does not track events. I simply have to restart zoneminder, and then the camera will work again.

I've created a script that restarts zoneminder every 5 minutes, but it has been ocurring more frequently and within those 5 minutes. I'm pretty confident this is a problem with zoneminder specifically as zmodopipe doesn't show any problem with the connections, and ffmpeg/ffserver show that they're encoding and streaming as well.

Here are my log entries during the time one of the cameras went down and after I restarted it to fix it.

https://pastebin.com/ExnfSX7R
Linux distro and version?
Xububtu 16.04.5 and ZM 1.30.4
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Zoneminder won't stay connected to camera

Post by snake »

From my experience with Zmodopipe, I found that it was easier to use a Video encoder for analog streams. See https://wiki.zoneminder.com/Hardware_co ... eo_Encoder

Used devices are available for <$100.
kennbr34
Posts: 48
Joined: Sat Jan 14, 2017 6:43 pm

Re: Zoneminder won't stay connected to camera

Post by kennbr34 »

snake wrote: Thu Sep 20, 2018 3:13 am From my experience with Zmodopipe, I found that it was easier to use a Video encoder for analog streams. See https://wiki.zoneminder.com/Hardware_co ... eo_Encoder

Used devices are available for <$100.
Well I'd probably just buy more IP Cams if I was going to spend that kind of money for a solution, but I would like to get this working. Doesn't seem to be a good reason why it's not.
kennbr34
Posts: 48
Joined: Sat Jan 14, 2017 6:43 pm

Re: Zoneminder won't stay connected to camera

Post by kennbr34 »

I'm trying to troubleshoot this still so I've enabled debug logging.

I'm just trying to find anything that seems relevant by looking at timestamps during instances where the cameras aren't visible, and also those files which mention the camera that can't be viewed.

So far I've found these entries which may have some relevance.

Code: Select all

09/25/18 16:57:22.117666 zms[17091].ERR-zm_monitor.cpp/4213 [Terminating, last frame sent time 1537919841.617620 secs more than maximum of 10.000000]

Code: Select all

09/25/18 16:57:57.797631 zms[17099].DB1-zm_monitor.cpp/2998 [Loaded monitor 10(Backdoor), 0 zones]
09/25/18 16:57:57.797654 zms[17099].DB1-zm_monitor.cpp/543 [Unable to map file /dev/shm/zm.mmap.10 (11521760 bytes) to locked memory, trying unlocked]
09/25/18 16:57:57.797670 zms[17099].DB1-zm_monitor.cpp/546 [Mapped file /dev/shm/zm.mmap.10 (11521760 bytes) to locked memory, unlocked]
09/25/18 16:57:57.797729 zms[17099].DB1-zm_stream.cpp/314 [We have obtained a lock on /var/run/zm/zms-554395.lock fd: 9]
09/25/18 16:57:58.297845 zms[17099].ERR-zm_monitor.cpp/4213 [Terminating, last frame sent time 1537919877.797786 secs more than maximum of 10.000000]
09/25/18 16:57:58.367873 zms[17099].DB1-zm_logger.cpp/239 [Terminating Logger]

Code: Select all

09/25/18 16:58:43.192825 zms[17245].DB1-zm_monitor.cpp/2998 [Loaded monitor 13(FrontdoorIPCAM), 0 zones]
09/25/18 16:58:43.192852 zms[17245].ERR-zm_monitor.cpp/533 [Got empty memory map file size 0, is the zmc process for this monitor running?]
09/25/18 16:58:43.278429 zms[17245].DB1-zm_stream.cpp/314 [We have obtained a lock on /var/run/zm/zms-160784.lock fd: 9]
09/25/18 16:58:43.278554 zms[17245].ERR-zm_signal.cpp/50 [Got signal 11 (Segmentation fault), crashing]
09/25/18 16:58:43.413095 zms[17245].DB1-zm_signal.cpp/61 [Signal information: number 11 code 128 errno 0 pid 0 uid 0 status 167622726]
09/25/18 16:58:43.413124 zms[17245].ERR-zm_signal.cpp/81 [Signal address is (nil), from 0x55bf2b81cd9d]
09/25/18 16:58:43.549422 zms[17245].ERR-zm_signal.cpp/102 [Backtrace 0: /usr/lib/zoneminder/cgi-bin/nph-zms(_Z14zm_die_handleriP9siginfo_tPv+0x78) [0x55bf2b86ffa8]]
09/25/18 16:58:43.677312 zms[17245].ERR-zm_signal.cpp/102 [Backtrace 1: /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f1e89412390]]
09/25/18 16:58:43.791429 zms[17245].ERR-zm_signal.cpp/102 [Backtrace 2: /usr/lib/zoneminder/cgi-bin/nph-zms(_ZNK7Monitor6GetFPSEv+0xd) [0x55bf2b81cd9d]]
09/25/18 16:58:43.902216 zms[17245].ERR-zm_signal.cpp/102 [Backtrace 3: /usr/lib/zoneminder/cgi-bin/nph-zms(_ZN13MonitorStream9runStreamEv+0x48) [0x55bf2b829a38]]
09/25/18 16:58:44.047720 zms[17245].ERR-zm_signal.cpp/102 [Backtrace 4: /usr/lib/zoneminder/cgi-bin/nph-zms(main+0xb9e) [0x55bf2b7f006e]]
09/25/18 16:58:44.184635 zms[17245].ERR-zm_signal.cpp/102 [Backtrace 5: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f1e85afa830]]
09/25/18 16:58:44.297139 zms[17245].ERR-zm_signal.cpp/102 [Backtrace 6: /usr/lib/zoneminder/cgi-bin/nph-zms(_start+0x29) [0x55bf2b7f0f69]]
09/25/18 16:58:44.414893 zms[17245].INF-zm_signal.cpp/109 [Backtrace complete, please execute the following command for more information]
09/25/18 16:58:44.532598 zms[17245].INF-zm_signal.cpp/110 [addr2line -e /usr/lib/zoneminder/cgi-bin/nph-zms 0x55bf2b86ffa8 0x7f1e89412390 0x55bf2b81cd9d 0x55bf2b829a38 0x55bf2b7f006e 0x7f1e85afa830 0x55bf2b7f0f69]
I think the nph-zms is the viewer itself complaining that it can't see anything, but I believe that part about the frame being too long for the maximum may be why one individual monitor keeps crashing at random. It would also explain why restarting ZM works to reset it, since that would essentially be restarting the monitor executable.

The other thing I don't understand is that it says the maximum framerate is 10, but I haven't set a maximum framerate in the settings of any of my cameras.
Locked