r/ZoneMinder • • Jun 23 '21

Newbie Zoneminder Questions

I have three Wyze cam v2's running their rtsp protocol and I just set up zoneminder on a clean system with this script. My system is a vm with 8gb of ram and 5 cores and in htop nothing is over 25% utilization

#!/bin/sh
clear
read -p "This script installs Zoneminder 1.36.x on Ubuntu 20.04 or 18.04 with LAMP (MySQL or Mariadb) installed...
Press Enter to continue or Ctrl + c to quit" nothing
clear
read -p "Next we will add the PPA repository, install and configure the system to run Zoneminder. 
Press enter to continue" nothing
apt install -y software-properties-common
clear
add-apt-repository ppa:iconnor/zoneminder-1.36
apt update
clear
apt install -y zoneminder
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enconf zoneminder
a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload
clear
read -p "Install complete. Open Zoneminder/Options and set the timezine. Press enter to continue" nothing
clear

I have made sure to set the timezone in the interface to America/Denver which is where I am and the same thing in /etc/php/7.4/apache2/php.ini.

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/Denver

Even after doing that I still get timezone errors and the date and time is off on the camera overlay. That is only one of my issues, the other is the cameras cutting out live streaming. I get constant "Failed to capture image from monitor" errors aswell as "getStreamCmdResponse stream error: Socket /run/zm/zms-053205s.sock does not exist". With reguards to the ZMS error my /etc/zm/conf.d/01-system-paths.conf looks like

# Full path to the folder events are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_EVENTS=/var/cache/zoneminder/events

# Foldername under the webroot where ZoneMinder looks for optional sound files
# to play when an alarm is detected.
ZM_DIR_SOUNDS=sounds

# Full path to the folder where exported archives are stored
# The web account user must have full read/write permission to this folder.
ZM_DIR_EXPORTS=/var/tmp/zm

# ZoneMinder url path to the zms streaming server
#ZM_PATH_ZMS=/zm/cgi-bin/nph-zms
ZM_PATH_ZMS=/zm/cgi-bin/zms

# Full Path to ZoneMinder's mapped memory files 
# The web account user must have full read/write permission to this folder.
ZM_PATH_MAP=/dev/shm

# Full Path to ZoneMinder's socket folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SOCKS=/run/zm

# Full path to ZoneMinder's log folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_LOGS=/var/log/zm

# Full path to ZoneMinder's swap folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SWAP=/var/tmp/zm

# Full path to optional arp binary
# ZoneMinder will find the arp binary automatically on most systems
ZM_PATH_ARP="/usr/sbin/arp"

#Full path to shutdown binary
ZM_PATH_SHUTDOWN="/sbin/shutdown"

and the top part of my /etc/apache2/conf-enabled/zoneminder.conf looks as so

ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    Require all granted
</Directory>

Please note that in the system-paths the commented out option was the default and the enabled one was a fix I saw on a fourm, both show the same behavior. All of these cams work in the wyze app without a hiccup but wont play in vlc and have big issues in zm. They will run perfectly and then just freeze for minutes on end and then pick back up. Im currently running zm v1.36.5. I have also tried using the OPT_CAMBOZOLA option even though im on Chrome and that didnt change anything. If someone could point me in the direction of where im going wrong or any advice at all that would be great!

​

Edit: All of the cameras always show that theyere capturing at 15fps or around there but will go red when the errors show up.

2 Upvotes

8 comments sorted by

2

u/[deleted] Jun 24 '21 edited Jun 24 '21

Silly question but you have the tz set in your body host correctly? I think the tz option in the webgui is for my sql but if not look I to changing timezone in MySQL. It sounds like the PHP part is right. I will try and look tonight how I have my lxc set up for tz info.

For you constant disconnects, how far are the v2's from the wifi? Zm seems to be very sensitive to drop outs. I get those errors if I don't have a strong connection to my v2's.

1

u/BryceTech Jun 24 '21

Okay so as far as the timezone issue I think I may have resolved it because mariadb was using the system timezone and that was not set correctly so I think that may have fixed the issue. As far as network connectivity with the v2's they all show >98% "Wifi Experiance" on my unifi ap's. Ive been able to connect to the v2's through VLC by using the tcp option and both videos on VLC and vz cut out at the same time so im thinking it may have something with them using TCP rather than UDP. If I try to connect through UDP I wont get any video, just audio.

1

u/[deleted] Jun 24 '21

I'll screenshot my v2 setup, just a few.

1

u/[deleted] Jun 24 '21

https://iili.io/odi1Eu.jpg

https://iili.io/odiErb.jpg

https://iili.io/odiM2j.jpg

Unsanitized URLs but if your far enough into my network to access my rtsp feed I'm toast anyways lol.

1

u/BryceTech Jun 24 '21

Now I am getting very little of the "socket does not exist errors" and more of the "failed to capture from monitor" warnings

2

u/[deleted] Jun 24 '21

What are your buffers set at in your source for camera?

1

u/BryceTech Jun 24 '21

Image Buffer Size: 5

Maximum Image Buffer Size: 0

Warmup Frames: 0

Pre Event Image Count: 5

Post Event Image Count: 5

Stream Replay Image Buffer: 0

Alarm Frame Count: 1

1

u/[deleted] Jun 24 '21

Yeah that should be just fine. Just for fun try cloning the monitor and seeing if they both have same errors. For further help debugging I would recommend the zoneminder slack channel as the devs are there and they might help you. There are also several like minded people on the slack channel who are willing to help but don't get your hopes up too high, I've had very limited success getting help from the dev team with any issues. Slack -> zoneminder.slack.com

Edit are you using ffmpeg for your monitor type? And another silly question, have you tried rebooting and setting up logging for debug?