Rasbian help request
Rasbian help request
Hello,
I have tried to get a fully functioning version of zoneminder running on my pi3b. After 4-5 installs from clean I keep coming up short as the API features that allow remote connection to things like zmNinja aren't working. Does someone have a fully working version they could provide a writable image of? I need remote access before going away for the holidays and its starting to get frustrating.
Thanks
I have tried to get a fully functioning version of zoneminder running on my pi3b. After 4-5 installs from clean I keep coming up short as the API features that allow remote connection to things like zmNinja aren't working. Does someone have a fully working version they could provide a writable image of? I need remote access before going away for the holidays and its starting to get frustrating.
Thanks
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Rasbian help request
I know this isn't the answer you were looking for, but I thought I throw this out there to give you options in case no one else responds.
While I don't use Raspbian, the zoneminder rpms in zmrepo for Fedora are supported on the raspberry pi 2 and 3.
Fedora 25 now officially supports the raspberry pi 2 & 3, and installing it is as simple as using their image installer to put a Fedora image on your sd card.
The instructions for the zoneminder rpm are no different than installing these rpms on normal pc based hardware.
I've been running zoneminder nonstop on my rpi3 for about a month now with no issues. zmninja works with it out of the box.
I've even got a zoneminder-nginx package in testing which uses less memory than the apache web server, but this is only for those who want to be on the bleeding edge of things.
While I don't use Raspbian, the zoneminder rpms in zmrepo for Fedora are supported on the raspberry pi 2 and 3.
Fedora 25 now officially supports the raspberry pi 2 & 3, and installing it is as simple as using their image installer to put a Fedora image on your sd card.
The instructions for the zoneminder rpm are no different than installing these rpms on normal pc based hardware.
I've been running zoneminder nonstop on my rpi3 for about a month now with no issues. zmninja works with it out of the box.
I've even got a zoneminder-nginx package in testing which uses less memory than the apache web server, but this is only for those who want to be on the bleeding edge of things.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: Rasbian help request
Is there a performance/ease of use benefit to Fedora? I just use the pi for zoneminder and most of the time its not even connected to a screen so I want to eek out the best performance I can more than nice GUI.
Edit: I did manage to get the API stuff working, so now trying to get a cloud backup service that works on the pi set up so it can automatically upload alarm images to the cloud for when im away (cant get a static ip from my ISP)
Edit: I did manage to get the API stuff working, so now trying to get a cloud backup service that works on the pi set up so it can automatically upload alarm images to the cloud for when im away (cant get a static ip from my ISP)
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Rasbian help request
Like Raspbian, Fedora is just another Linux distro. It is a Redhat rpm based distro, rather than Debian based, so some commands are different and the way to accomplish certain things can be a bit different. I've always used Redhat so that is just my preference.
I'm not sure how recent the ZoneMinder and ffmpeg packages are in Raspbian, nor do I know how quickly they provide new packages. Since Fedora is designed to be on the leading edge of development, it will typically have the most recent version of both ZoneMinder and ffmpeg. ...if that sort of thing is important to you, which it might not be.
Generally speaking, the Raspbain community is much larger than the community for Fedora running on the Rasp Pi.
If you have everything working on your pi running Raspbian, then you are likely best off leaving it as is.
Since most ISP's want to charge you more for a commercial account if you want a static ip address, you can use dynamic dns instead. Your ip will still be dynamic, but you will instead access your location by dns name. Many routers have dynamic dns support built-in for multiple dyn dns vendors. If yours does not, then you can run the ddclient application on your rasp pi to keep your dns name up to date.
I'm not sure how recent the ZoneMinder and ffmpeg packages are in Raspbian, nor do I know how quickly they provide new packages. Since Fedora is designed to be on the leading edge of development, it will typically have the most recent version of both ZoneMinder and ffmpeg. ...if that sort of thing is important to you, which it might not be.
Generally speaking, the Raspbain community is much larger than the community for Fedora running on the Rasp Pi.
If you have everything working on your pi running Raspbian, then you are likely best off leaving it as is.
Since most ISP's want to charge you more for a commercial account if you want a static ip address, you can use dynamic dns instead. Your ip will still be dynamic, but you will instead access your location by dns name. Many routers have dynamic dns support built-in for multiple dyn dns vendors. If yours does not, then you can run the ddclient application on your rasp pi to keep your dns name up to date.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: Rasbian help request
I think I will stick to Raspbian for now then. I do have a problem though that when an alarm is triggered the FPS falls like a rock and skips about the first 2 seconds after an alarm is triggered. Dont know if that is a PI problem, write speed on SD (though the pre alarm frames are smooth) or something else.
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Rasbian help request
Your symptoms indicate you are hitting a resource limit. Can't say anything specific about your system without knowing number of cameras, their resolution, and framerate. I'd try to get away from writing to the ssd if you can.
I've got an mSATA ssd attached to my pi, formatted with three partitions dedicated to (small) swap, mysql, and zm events. It still uses the USB 2 bus, but I am not experiencing any slowdowns like you have described. All cameras are set to 5 fps, and are set to modect.
Configued like this it'll do quite a few VGA cameras with no problem. It will do a couple 720p cameras with no problem, and it has trouble with just a single 1080p resolution camera. It can barely keep up at 1080p and seems to have occasional issues. One of my 1080p cameras would go into fits were zoneminder keeps trying to restart it every second. Another runs okay for a few days but when I come back and look at the logs I can see zmwatch restarted it once or twice due to non-responding zma/zmc.
Eventually I will document all this in a blog to give others some general benchmarks.
I've got an mSATA ssd attached to my pi, formatted with three partitions dedicated to (small) swap, mysql, and zm events. It still uses the USB 2 bus, but I am not experiencing any slowdowns like you have described. All cameras are set to 5 fps, and are set to modect.
Configued like this it'll do quite a few VGA cameras with no problem. It will do a couple 720p cameras with no problem, and it has trouble with just a single 1080p resolution camera. It can barely keep up at 1080p and seems to have occasional issues. One of my 1080p cameras would go into fits were zoneminder keeps trying to restart it every second. Another runs okay for a few days but when I come back and look at the logs I can see zmwatch restarted it once or twice due to non-responding zma/zmc.
Eventually I will document all this in a blog to give others some general benchmarks.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: Rasbian help request
I have a single 720 camera running at 15fps. The pi is running off a micro SD. The slow down only happens after the alarm is triggered. Looking at the loads on the pi I expect is the SD not writing fast enough (I think it's a class 10) will try hooking up an external drive and see how that goes. Is it possible to get zoneminder to save the images to ram before sd to maybe negate that drop?
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Rasbian help request
Exactly. Slowdowns after the alarm is triggered means something is not keeping up. It's probably the sd card, but it can be other limitations.
You can think of the ring buffer as a cache. It is usually stored in /dev/shm (/run/shm on debian ....see the value of ZM_PATH_MMAP) You could try to increase it under the monitor settings. However, that won't help if your event is larger than the buffer, and you will likely run out of /dev/shm memory anyway. You could increase the size of /dev/shm, but you can't do that too much or you can starve the os for memory which creates other problems. Nothing is easy with the Pi because of its limited resources. Nearly everything you try to change will come with some sort of cost. I'm certainly not saying you shouldn't use a Pi. Rather, you need to be acutely aware of its limitations.
Note that disabling the desktop and other non-essential services will help a lot here.
You can think of the ring buffer as a cache. It is usually stored in /dev/shm (/run/shm on debian ....see the value of ZM_PATH_MMAP) You could try to increase it under the monitor settings. However, that won't help if your event is larger than the buffer, and you will likely run out of /dev/shm memory anyway. You could increase the size of /dev/shm, but you can't do that too much or you can starve the os for memory which creates other problems. Nothing is easy with the Pi because of its limited resources. Nearly everything you try to change will come with some sort of cost. I'm certainly not saying you shouldn't use a Pi. Rather, you need to be acutely aware of its limitations.
Note that disabling the desktop and other non-essential services will help a lot here.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: Rasbian help request
I don't run it from the desktop, just the command line interface. How would I increase /dev/shm memory? Literally the only thing in the pi is stock raspbian and zoneminder. I have increased the image buffer values in monitor settings, hopefully it helps!
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Rasbian help request
/dev/shm is just a ramdisk which dynamically expands or shrinks to the sum of the contents. Debian distros sometimes call this /run/shm, but that is just a symlink to /dev/shm. It's the same thing.
By default the max size of /dev/shm is 50% of your physical ram, which is 512MB. You can change that in your fstab:
Keep an eye on how much is being used, and make sure and leave 150-200MB or so free.... both ZoneMinder and mysql use /dev/shm for other purposes so you have to have some wiggle room. Naturally, your cameras will crash if you run out of /dev/shm.
Note that my blog about this still under construction, but you can see what I've done here:
http://zoneminder.blogspot.com/p/raspberry-pi-3.html
It is far too long and I want to format it better.
By default the max size of /dev/shm is 50% of your physical ram, which is 512MB. You can change that in your fstab:
Code: Select all
# Modify the size of /dev/shm
tmpfs /dev/shm tmpfs defaults,size=650m 0 0
Note that my blog about this still under construction, but you can see what I've done here:
http://zoneminder.blogspot.com/p/raspberry-pi-3.html
It is far too long and I want to format it better.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
Re: Rasbian help request
To any future person with this problem. I tripled the image buffer size to 150 and slightly increased the warm-up and pre-event image count to 35 and now the recordings are much better though still stutter a little on alarm trigger. Problem now is that the live view is stuttering but I see it as a good recording is more important than a smooth live view.
New problem though is the filters aren't automatically running. I modified purgewhenfull to 50% to test it and I'm now in 52. When i click submit it runs fine but isn't running on its own. System is getting there slowly!
Update: checked zmfilter in the log, its nothing but errors. Not sure where to go from here.
New problem though is the filters aren't automatically running. I modified purgewhenfull to 50% to test it and I'm now in 52. When i click submit it runs fine but isn't running on its own. System is getting there slowly!
Update: checked zmfilter in the log, its nothing but errors.
Code: Select all
Can't execute filter 'SELECT E.Id, E.MonitorId, M.Name as MonitorName, M.DefaultRate, M.DefaultScale, E.Name, E.Cause, E.Notes, E.StartTime, unix_timestamp(E.StartTime) as Time, E.Length, E.Frames, E.AlarmFrames, E.TotScore, E.AvgScore, E.MaxScore, E.Archived, E.Videoed, E.Uploaded, E.Emailed, E.Messaged, E.Executed FROM Events as E INNER JOIN Monitors as M on M.Id = E.MonitorId where not isnull(E.EndTime) and ( E.Length <= 4 seconds ) order by E.StartTime desc', ignoring: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'seconds ) order by E.StartTime desc' at line 25
Re: Rasbian help request
That SQL is failing because of this: so I'd guess your filter has the phrase "4 seconds" in it somewhere
Code: Select all
( E.Length <= 4 seconds )
Re: Rasbian help request
Is there a way to directly view the filters? I created them using the filter button on the web interface and having just looked cant see 4 seconds anywhere.
Edit: Sorted, foind the 4 seconds bit and changed it to simply 4. Now that short event filter works, just got to check the purge when full
Edit: Sorted, foind the 4 seconds bit and changed it to simply 4. Now that short event filter works, just got to check the purge when full
Re: Rasbian help request
To get around the problem of no static IP I am setting up the pi to sync events to the cloud using rclone. I know I can automate the syncing using cron but I was wondering if zoneminder could be set to trigger the syncing when it's needed by performing a command line after an alarm is triggered. Ideally something that starts after an alarm, waits 10 seconds to see if there is another alarm and if there isn't it runs the command.
Re: Rasbian help request
Hi man, I'm trying to setup a system on a raspberry pi 2 with OpenMediaVault and nginx.knnniggett wrote:I know this isn't the answer you were looking for, but I thought I throw this out there to give you options in case no one else responds.
While I don't use Raspbian, the zoneminder rpms in zmrepo for Fedora are supported on the raspberry pi 2 and 3.
Fedora 25 now officially supports the raspberry pi 2 & 3, and installing it is as simple as using their image installer to put a Fedora image on your sd card.
The instructions for the zoneminder rpm are no different than installing these rpms on normal pc based hardware.
I've been running zoneminder nonstop on my rpi3 for about a month now with no issues. zmninja works with it out of the box.
I've even got a zoneminder-nginx package in testing which uses less memory than the apache web server, but this is only for those who want to be on the bleeding edge of things.
Could you please share your setup/config file you had with raspberry pi3 with nginx?