Giter Site home page Giter Site logo

klutchell / balena-zoneminder Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 3.0 124 KB

ZoneMinder is a full-featured, open source, state-of-the-art video surveillance software system.

Dockerfile 38.13% Shell 17.37% Python 44.50%
balena zoneminder cctv jetson nano

balena-zoneminder's Introduction

balena-zoneminder

ZoneMinder is a full-featured, open source, state-of-the-art video surveillance software system.

Requirements

  • Jetson Nano with 16GB+ microSD card

Getting Started

You can one-click-deploy this project to balena using the button below:

balena deploy button

Manual Deployment

Alternatively, deployment can be carried out by manually creating a balenaCloud account and application, flashing a device, downloading the project and pushing it via either Git or the balena CLI.

Application Environment Variables

Application envionment variables apply to all services within the application, and can be applied fleet-wide to apply to multiple devices.

  • MYSQL_ROOT_PASSWORD: Provide a root mysql password so the database and users can be created on startup. This variable is required and cannot be changed later.
  • TZ: Inform services of your local timezone. See here for a full list of available options.

Usage

ZoneMinder

Connect to http://<device-ip>:80/zm or enable the Public Device URL on the balena Dashboard and append /zm to the URL to begin using ZoneMinder.

Once connected, we recommend following the Getting Started guide to enable authentication, and begin adding monitors.

https://zoneminder.readthedocs.io/en/stable/userguide/gettingstarted.html

The TIMEZONE is being controlled via the TZ environment variable so you can leave the Options value as Unset - use value in php.ini to avoid conflicts.

Event Notification Server

The Event Notification Server sits along with ZoneMinder and offers real time notifications, support for push notifications as well as Machine Learning powered recognition.

Event Notification Server FAQ:

https://zmeventnotification.readthedocs.io/en/stable/guides/es_faq.html

Machine Learning Hooks FAQ:

https://zmeventnotification.readthedocs.io/en/stable/guides/hooks_faq.html

We are using environment variables to automatically populate secrets.ini at runtime. There are a number of optional fields in there so here are the minimum recommended environment variables to get started with the Event Notification Server.

  • ZM_PORTAL: EventServer uses the external URL of your ZoneMinder instance when pushing notifications to devices. For example, https://<UUID>.balena-devices.com/zm/ if using the Public Device URL.
  • ZM_USER: EventServer uses your ZoneMinder username to authenticate with your ZoneMinder portal.
  • ZM_PASSWORD: EventServer uses your ZoneMinder password to authenticate with your ZoneMinder portal.

The full list of supported secrets can be found in zm/secrets.ini.

Both zmeventnotification.ini and objectconfig.ini have been populated with some sane defaults but we recommend you read the docs to become familiar with the many options.

Once you are satisfied with the configuration you can configure ES to be autostarted by going to Options->Systems and enable OPT_USE_EVENTNOTIFICATION and you are all set.

https://zmeventnotification.readthedocs.io/en/stable/guides/install.html#making-sure-the-es-gets-auto-started-when-zm-starts

Debugging

There are a couple python scripts in the image that can print useful CUDA and OpenCV information.

python3 /etc/zm/check_cuda.py
python3 /etc/zm/check_opencv.py

tegrastats is also available in the image for debugging:

tegrastats

RAM 1816/3961MB (lfb 5x2MB) SWAP 115/990MB (cached 31MB) CPU [15%@1479,15%@1479,14%@1479,100%@1479] EMC_FREQ 0% GR3D_FREQ 0% PLL@19C CPU@19C PMIC@100C GPU@21C AO@24C [email protected] POM_5V_IN 2515/2515 POM_5V_GPU 0/0 POM_5V_CPU 1054/1054

Contributing

Please open an issue or submit a pull request with any features, fixes, or changes.

Acknowledgements

ZoneMinder is a free, open source program which is maintained by a very small group of developers, for free, in their spare time.

https://zoneminder.com/contact/

Event Notification Server and some of the associated components are authored and maintained by @pliablepixels.

https://github.com/pliablepixels/zmeventnotification

balena-zoneminder's People

Contributors

chrisys avatar klutchell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

balena-zoneminder's Issues

Failed to deploy on my Jetson Nano

Hi all,

I try to deploy ZM on my Jetson Nano through my balena account, but I get this log :

18.05.21 11:31:01 (+0200)  zm  Initializing database ...
18.05.21 11:31:00 (+0200)  zm  rm: cannot remove '/tmp/pyzm_*': No such file or directory
18.05.21 11:31:00 (+0200)  zm  mkdir: cannot create directory '/var/log/apache2': File exists
18.05.21 11:31:00 (+0200)  zm  mkdir: cannot create directory '/var/log/zm': File exists
18.05.21 11:31:00 (+0200)  zm  changed ownership of '/var/cache/zoneminder/cache' from root:root to www-data:www-data
18.05.21 11:31:00 (+0200)  zm  ownership of '/var/cache/zoneminder/events' retained as www-data:www-data
18.05.21 11:31:00 (+0200)  zm  ownership of '/var/cache/zoneminder/images' retained as www-data:www-data
18.05.21 11:31:00 (+0200)  zm  changed ownership of '/var/cache/zoneminder/temp' from root:root to www-data:www-data
18.05.21 11:31:01 (+0200)  db  2021-05-18  9:31:01 6 [Warning] Access denied for user 'root'@'172.17.0.3' (using password: NO)
18.05.21 11:31:01 (+0200)  zm  Initializing database ...
18.05.21 11:31:01 (+0200)  db  2021-05-18  9:31:01 7 [Warning] 'proxies_priv' entry '@% root@4afa9235785b' ignored in --skip-name-resolve mode.
18.05.21 11:31:01 (+0200)  zm  DBD::mysql::st execute failed: Table 'zm.Config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 97.
18.05.21 11:31:01 (+0200)  zm  Can't execute: Table 'zm.Config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 147.
18.05.21 11:31:01 (+0200)  zm  BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
18.05.21 11:31:01 (+0200)  zm  Compilation failed in require at /usr/bin/zmupdate.pl line 73.
18.05.21 11:31:01 (+0200)  zm  BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.
18.05.21 11:31:01 (+0200)  zm  DBD::mysql::st execute failed: Table 'zm.Config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 97.
18.05.21 11:31:01 (+0200)  zm  Can't execute: Table 'zm.Config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 147.
18.05.21 11:31:01 (+0200)  zm  BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
18.05.21 11:31:01 (+0200)  zm  Compilation failed in require at /usr/bin/zmupdate.pl line 73.
18.05.21 11:31:01 (+0200)  zm  BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.
18.05.21 11:31:02 (+0200)  zm  AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
18.05.21 11:31:02 (+0200)  zm  DBD::mysql::st execute failed: Table 'zm.Config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 97.
18.05.21 11:31:02 (+0200)  zm  Can't execute: Table 'zm.Config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 147.
18.05.21 11:31:02 (+0200)  zm  BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
18.05.21 11:31:02 (+0200)  zm  Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
18.05.21 11:31:02 (+0200)  zm  BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
18.05.21 11:31:02 (+0200)  zm  Compilation failed in require at /usr/bin/zmpkg.pl line 34.
18.05.21 11:31:02 (+0200)  zm  BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 34.

Do I forgot something ?
Any hit ?
Thanks,

Timeout waiting for gpu lock

When the event server machine learning hooks are enabled with tinyyolov4 and gpu the process locks seem to be getting stuck resulting in this error.

12/28/20 18:28:35 zmesdetect_m1[1010] ERR yolo.py:51 [Timeout waiting for gpu lock for 300 seconds]
12/28/20 18:28:35 zmesdetect_m1[1010] FAT zm_detect.py:860 [Unrecoverable error:Timeout waiting for gpu lock for 300 seconds Traceback:Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 46, in acquire_lock
    self.lock.acquire()
  File "/usr/local/lib/python3.6/dist-packages/portalocker/utils.py", line 343, in acquire
    raise exceptions.AlreadyLocked()
portalocker.exceptions.AlreadyLocked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 857, in <module>
    main_handler()
  File "/var/lib/zmeventnotification/bin/zm_detect.py", line 432, in main_handler
    b, l, c = m.detect(original_image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/object.py", line 54, in detect
    b,l,c = self.model.detect(image)
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 128, in detect
    self.acquire_lock()
  File "/usr/local/lib/python3.6/dist-packages/pyzm/ml/yolo.py", line 52, in acquire_lock
    raise ValueError ('Timeout waiting for {} lock for {} seconds'.format(self.processor, self.lock_timeout))
ValueError: Timeout waiting for gpu lock for 300 seconds
]

I'm watching these included projects for changes while I continue to investigate.

https://github.com/pliablepixels/zmeventnotification
https://github.com/pliablepixels/pyzm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.