[support] dlandon - Zoneminder 1.36


Recommended Posts

For those that got the Event server and hooks working, did you have to get a valid certificate from letsencrypt or other service?  I have my Event Server working and pushing notifications to my phone no problem, but I'm not getting the alarm pictures.  Reading through the documentation it seems I need to get the pics working before enabling the hooks.  I'd appreciate any tips on you may have got that to work.

 

Thanks

Link to comment
32 minutes ago, turt1e said:

For those that got the Event server and hooks working, did you have to get a valid certificate from letsencrypt or other service?  I have my Event Server working and pushing notifications to my phone no problem, but I'm not getting the alarm pictures.  Reading through the documentation it seems I need to get the pics working before enabling the hooks.  I'd appreciate any tips on you may have got that to work.

 

Thanks

no - i used default certificates. I did add the IP address of the zoneminder instance to ServerName (it then adds back localhost on the 2nd line).
When you say you don't get the alarm pictures do you mean an alert/toast on your phone? or if under 'events list' in ZMNinja you tap the 3 dots, and select 'only detected objects' nothing shows?

 

The best way is to watch the logs when you walk in front of a camera and trigger an alarm as there are quite a few steps to getting it to work.

Check the alarm triggers the hook, check the hook finds something, and then the hook sends the alert. Based on that you can narrow down what isn't working.

Link to comment
3 hours ago, Jaburges said:

no - i used default certificates. I did add the IP address of the zoneminder instance to ServerName (it then adds back localhost on the 2nd line).
When you say you don't get the alarm pictures do you mean an alert/toast on your phone? or if under 'events list' in ZMNinja you tap the 3 dots, and select 'only detected objects' nothing shows?

 

The best way is to watch the logs when you walk in front of a camera and trigger an alarm as there are quite a few steps to getting it to work.

Check the alarm triggers the hook, check the hook finds something, and then the hook sends the alert. Based on that you can narrow down what isn't working.

 

Good to know the default generated certificates work for you.  I was under the impression that the snapshot and alarm pics that are supposed to be generated during an event are sent to google/apple who then process the image and then send to your phone on behalf of ZMninja as a notification.   I'm getting that notification with just a black space in place of where the image should be.  When I enable hooks in the zmeventnotification.ini I don't get anything show when I select "only detected objects".  So for now I've disabled that and I'm trying to get those notification pictures to show up correctly first before moving on to object detection as recommended in the setup guide. 

 

Here is how the pertinent fields in the various config files look on my setup.

 

ServerName:

192.168.11.xx

localhost

 

secrets.ini:  the ZMES_PICTURE_URL below is set to the wikimedia test image as suggested setup guide. Which, is what I should be seeing every time I get an event notification, but thats not happening. But I've also tried the commented line with my duckdns subdomain with no luck on that one either.

 

# your secrets file
[secrets]
ZMES_PICTURE_URL=https://upload.wikimedia.org/wikipedia/commons/5/5f/Chinese_new_year_dragon_2014.jpg
#ZMES_PICTURE_URL=https://mysubdomain.duckdns.org:8444/zm/index.php?view=image&eid=EVENTID&fid=snapshot&width=600
ZM_USER=admin
ZM_PASSWORD=xxxxx
ZM_PORTAL=https://mysubdomain.duckdns.org:8444/zm
ZM_API_PORTAL=https://mysubdomain.duckdns.org:8444/zm/api

 

zmeventnotification.ini:

 

[general]

secrets = /etc/zm/secrets.ini
base_data_path=/var/lib/zmeventnotification

[network]
# Port for Websockets connection (default: 9000).
port = 9000

[auth]
# Check username/password against ZoneMinder database (default: yes).
enable = yes

[fcm]
# Use FCM for messaging (default: yes).
enable = yes

[ssl]
# Enable SSL (default: yes)
enable = yes

cert = !ES_CERT_FILE
key = !ES_KEY_FILE

# include picture in alarm (Android only) (default: no).
include_picture = yes

# picture_url = !ZMES_PICTURE_URL
picture_url = https://upload.wikimedia.org/wikipedia/commons/5/5f/Chinese_new_year_dragon_2014.jpg
picture_portal_username=!ZM_USER
picture_portal_password=!ZM_PASSWORD

 

Any values look different than yours? Other than the picture_url of course, as I've tried both the wikimedia and my duckdns subdomain.

 

Thanks

 

 

 

 

 

Edited by turt1e
Link to comment
53 minutes ago, Jaburges said:

What happens when you find an event number in the console, and plug that into the URL?

can you see the image?

i seem to remember I switched out my picture URL for the other one in the ini that was commented out. The rest from memory (I’m AFK right now) looks the same

I get a "page cannot be found" and the following in the log file:

 

web_php 1197 FAT Event <368> Not found /usr/share/zoneminder/www/views/image.php

When you log into you Zoneminder console via the web browser do you get a notification of the page not being secure because of the self signed cert?

Link to comment
37 minutes ago, turt1e said:

I get a "page cannot be found" and the following in the log file:

 


web_php 1197 FAT Event <368> Not found /usr/share/zoneminder/www/views/image.php

When you log into you Zoneminder console via the web browser do you get a notification of the page not being secure because of the self signed cert?

no, I don’t get a warning even with self signed certs.

I’m using a Synology NAS as a reverse proxy (running NGINX). So I hit the synology box, which has a valid public cert, that then routes internally to my Zoneminder instance.

 

also do you have any form of auth enabled? As I would have thought hitting that url would actually present you with a login screen first?

Link to comment
5 hours ago, turt1e said:

I get a "page cannot be found" and the following in the log file:

 


web_php 1197 FAT Event <368> Not found /usr/share/zoneminder/www/views/image.php

When you log into you Zoneminder console via the web browser do you get a notification of the page not being secure because of the self signed cert?

I think you need to be following the documentation here: 

https://zmeventnotification.readthedocs.io/en/latest/guides/hooks.html#troubleshooting

 

Specifically

One of the big reasons why object detection fails is because the hook is not able to download the image to check. This may be because your ZM version is old or other errors. Some common issues:

  • Make sure your objectconfig.ini section for [general] are correct (portal, user,admin)
  • For object detection to work, the hooks expect to download images of events using https://yourportal/zm/?view=image&eid=<eid>&fid=snapshot and possibly https://yourportal/zm/?view=image&eid=<eid>&fid=alarm
  • Open up a browser, log into ZM. Open a new tab and type in https://yourportal/zm/?view=image&eid=<eid>&fid=snapshot in your browser. Replace eid with an actual event id. Do you see an image? If not, you’ll have to fix/update ZM. Please don’t ask me how. Please post in the ZM forums
  • Open up a browser, log into ZM. Open a new tab and type in https://yourportal/zm/?view=image&eid=<eid>&fid=alarm in your browser. Replace eid with an actual event id. Do you see an image? If not, you’ll have to fix/update ZM. Please don’t ask me how. Please post in the ZM forums
Link to comment
12 hours ago, Jaburges said:

no, I don’t get a warning even with self signed certs.

I’m using a Synology NAS as a reverse proxy (running NGINX). So I hit the synology box, which has a valid public cert, that then routes internally to my Zoneminder instance.

 

also do you have any form of auth enabled? As I would have thought hitting that url would actually present you with a login screen first?

I'm using the built in auth for zoneminder and yes it does present me with a login screen. After logging in I then get the "page cannot be found" when trying to retrieve that image url.  At this point I'm pretty sure this is a cert issue (especially know seeing that you have a reverse proxy setup) and that my domain needs some sort of valid cert for these images in the notification to work.

7 hours ago, JimG said:

I think you need to be following the documentation here: 

https://zmeventnotification.readthedocs.io/en/latest/guides/hooks.html#troubleshooting

 

Specifically

One of the big reasons why object detection fails is because the hook is not able to download the image to check. This may be because your ZM version is old or other errors. 

Yep, that is the documentation I'm following and it states that the self signed cert will not work for pictures in the notification or object detection.  But I was under the impression that some here got it working with the self signed certs.  At this point I'm not even trying object detection, I just want to get the picture of the alarmed event to show up on my ZMNinja notifications.  Once I get that working then I'll move on to hooks just as the documentation you linked states to do.

 

So in that vain I've now set up a letsencrypt docker on the same server that zoneminder is running on and I now show a valid cert on my domain. Lets say it's mydomain.com.  When I go to mydomain.com in my web browser I get a landing page that is encrypted with a valid cert from letsencrypt.   I've also copied the 2 cert keys from letsencrypt docker to zoneminder's keys folder and restarted both.  Yet when I go to mydomain.com:8444/zm its still shows an untrusted site, and the cert as invalid.  I'm pretty sure the issue is that Zoneminder uses that base url of /zm and I see no provision in the letsencrypt docker for setting up a subdomain that uses a base url.  I  setup a subdomain with Bitwarden on the same server and got that working with letsencrypt and get a valid cert on its landing page but it doesn't using a base url, just bitwarden.mydomain.com which works fine. If anyone has gotten Zoneminder to work with the letsencrypt docker I'm all ears!

 

Thanks

Link to comment

@turt1e also just noticed I’m getting proper alerts (notifications with images) since I sorted out my token.txt file.
 

have you installed ZMNinja on a mobile device? That helped me narrow down the issue as the logs could be checked for connecting on LAN or WAN.

 

Once ZMNinja is connected you check the folder push and the token.txt file in there. I started with LAN using IP addresses and ports and then slowly moved outward until I found the issue. Once you connect ZMNinja app to Zoneminder and the event service - you’ll get a token in the tokens.txt file (as above I had to edit my txt to include all monitors).

 

anyway just a thought of a systematic way to trouble shoot and find the point of failure. 
good luck 🙂

Link to comment

There is a Docker update that adjusts the ownership of the event, images, cache, and temp folders.  When the docker is run it will adjust the ownership.  If you have a lot of events it will take a while.  Just be patient and let it finish it's work.

 

The ownership of these folders has been changed from root:www-data to www-data:www-data.  Let me know if anyone has problems with events being saved.

Link to comment
56 minutes ago, dlandon said:

There is a Docker update that adjusts the ownership of the event, images, cache, and temp folders.  When the docker is run it will adjust the ownership.  If you have a lot of events it will take a while.  Just be patient and let it finish it's work.

 

The ownership of these folders has been changed from root:www-data to www-data:www-data.  Let me know if anyone has problems with events being saved.

Did this update include the JSON changes to MQTT in the ES by any chance?

Link to comment
9 hours ago, dlandon said:

There is a Docker update that adjusts the ownership of the event, images, cache, and temp folders.  When the docker is run it will adjust the ownership.  If you have a lot of events it will take a while.  Just be patient and let it finish it's work.

 

The ownership of these folders has been changed from root:www-data to www-data:www-data.  Let me know if anyone has problems with events being saved.

 

Hi , i recntly made a fresh install of this, on the docker compose i pass my  PUID and PGID from my current docker user,  but i can't store any records, on the logs says "Cannot write to event folder /var/cache/zoneminder/events. Check that it exists and is owned by the web account user." , the owner of the folder is www-data , so i add my usr to www-data but nothing, and also the material-icons don't show on the page "download failed (font-family: "Material Icons" style:normal weight:400 stretch:100 src index:2): status=2147746065 source: https://192.168.1.1:8443/zm/skins/classic/css/fonts/MaterialIcons-Regular.woff2"  i think is for the same issue of permission, so i need to put de PUID of www-data on the compose? or whats is wrong with my setup, this is my compose

 

  zoneminder:

    image: dlandon/zoneminder

    container_name: zoneminder

    privileged: true

    environment:

      - PUID=${PUID}

      - PGID=${PGID}

      - TZ=${TZ}  

      - SHMEM=50%

    ports:  

      - 8083:80

      - 8443:443

      - 9001:9000

    restart: always

    volumes:

      - ${USERDIR}/docker/config/zoneminder/config:/config:rw

      - ${DATADIR}/Media/CCTV:/var/cache/zoneminder:rw

    network_mode: "bridge"

Link to comment
On 2/5/2020 at 12:59 AM, Jaburges said:

@turt1e also just noticed I’m getting proper alerts (notifications with images) since I sorted out my token.txt file.
 

have you installed ZMNinja on a mobile device? That helped me narrow down the issue as the logs could be checked for connecting on LAN or WAN.

 

Once ZMNinja is connected you check the folder push and the token.txt file in there. I started with LAN using IP addresses and ports and then slowly moved outward until I found the issue. Once you connect ZMNinja app to Zoneminder and the event service - you’ll get a token in the tokens.txt file (as above I had to edit my txt to include all monitors).

 

anyway just a thought of a systematic way to trouble shoot and find the point of failure. 
good luck 🙂

Yep, I'm using ZMNinja and I did check my token.txt file and it looked correct, but thanks for the suggestion anyway.

 

I actually got my zoneminder cert issues resolved a few days ago by finally figuring out how to reverse proxy zoneminder's webui with it's /zm base url.  I ended up having to edit the /mnt/user/appdata/letsencrypt/nginx/site-conf/default file by adding the following:

         

	location /zm/ {
                include /config/nginx/proxy.conf;
                proxy_pass https://mysubdomain.duckdns.org:8443/zm/;
        }

Those trailing slashes after /zm make a big difference!

 

But adding the above kept stripping out the index.php from the Zoneminder webui which caused some other issues on the Zoneminder web console and the picture url for eventserver. So I had to comment out the following in that same file above:

 

#       location ~ \.php$ {
#               fastcgi_split_path_info ^(.+\.php)(/.+)$;
#               fastcgi_pass 127.0.0.1:9000;
#               fastcgi_index index.php;
#               include /etc/nginx/fastcgi_params;
#       }

Commenting out the above doesn't seem to have broken my other dockers that I have reverse proxied that use letsencrypt, and I'm now getting my ZMninja notifications with object detection.  I've spent the last couple of days just playing with the object detection settings and I must say it's pretty damn cool!

 

 

 

 

Screenshot_20200204-171123.jpg

Screenshot_20200208-153803.jpg

  • Like 1
Link to comment

Hi All,

 

I just updated my existing zoneminder docker image to pull the latest (it working fine before the upgrade). Everything seems normal after the upgrade except that my Montage view seems broken.  I do see the error about checking if CGI is enabled in Apache and checking the PATH_ZMS variable being set correctly in the logs.  Any ideas on what might have gone wrong with my upgrade?

 

Thanks.

Edited by sibi78
Link to comment
48 minutes ago, sibi78 said:

Hi All,

 

I just updated my existing zoneminder docker image to pull the latest (it working fine before the upgrade). Everything seems normal after the upgrade except that my Montage view seems broken.  I do see the error about checking if CGI is enabled in Apache and checking the PATH_ZMS variable being set correctly in the logs.  Any ideas on what might have gone wrong with my upgrade?

 

Thanks.

Never mind, after some googling, I landed here: https://forums.zoneminder.com/viewtopic.php?t=27722 . I had to set the AUTH_RELAY variable to NONE and after that I'm able to see the Montage view now.

Link to comment

Hi @dlandon , I saw that a new version of Zoneminder was released now, great work!

 

Was about to check out the opencv GPU backend support for CUDA in the new ES 5.7 but did not find the new attribute to activate this in the "objectconfig.ini. So it seems you did not compile that, so my question is, do you plan to include that in your docker version?

 

Version 5.7 onwards

I know support the new OpenCV 4.1.2 GPU backend support for CUDA. This will only work if you are on OpenCV 4.1.2 and have compiled it correctly to use CUDA and are using the right architecture. - This adds a new attribute use_opencv_dnn_cuda in objectconfig.ini which by default is no. Please read the comments in objectconfig.ini about how to use this.

 

Thanks!

 

Edit: It seems this is a feature in ES 5.7.4. It must have been released just after your version with ES 5.7.

Link to comment
3 hours ago, Sic79 said:

Hi @dlandon , I saw that a new version of Zoneminder was released now, great work!

 

Edit: It seems this is a feature in ES 5.7.4. It must have been released just after your version with ES 5.7.

I don't compile in ES.  I include the released version once it is ready.  pliablepixels did make some last minute changes that I wasn't expecting when he asked me to give 5.7 a try.

 

It was just released 16 hours ago!  Give me a break!  I do this part time and I have to do some testing before I release it.  I'll get it done when I can.

Link to comment
I don't compile in ES.  I include the released version once it is ready.  pliablepixels did make some last minute changes that I wasn't expecting when he asked me to give 5.7 a try.
 
It was just released 16 hours ago!  Give me a break!  I do this part time and I have to do some testing before I release it.  I'll get it done when I can.


Well if you read again and don’t take it personally, it was just a question NOT a demand.

You see, I read pliable pixels doc on breaking changes (as I always do on updates) which was the text I quoted about GPU and it said 5.7. I checked your git and it said 5.7. So for me I actually thought it was in fact included in your docker. (Just as you, I had no idea that it was added right after your release).

And after some research why I could not find the right changes in your Docker I actually made a “edit” about that and figured out it was in fact added to 5.7.4. So I kinda answered my own question.
Link to comment
16 minutes ago, Sic79 said:

 


Well if you read again and don’t take it personally, it was just a question NOT a demand.

You see, I read pliable pixels doc on breaking changes (as I always do on updates) which was the text I quoted about GPU and it said 5.7. I checked your git and it said 5.7. So for me I actually thought it was in fact included in your docker. (Just as you, I had no idea that it was added right after your release).

And after some research why I could not find the right changes in your Docker I actually made a “edit” about that and figured out it was in fact added to 5.7.4. So I kinda answered my own question.

 

I didn't take it as a demand.  This docker has gotten to where it takes more time than I care to invest for virtually zero donations.  I am a little frazzled. 

Link to comment
  • dlandon changed the title to [support] dlandon - Zoneminder 1.36

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.