Hello
This is a paste of some notes I typed while installing Zoneminder on Crunchbang Linux. They were typed as if explaining to someone else what to do, feel free to edit/critique/tweak as required.
Background:
Had been running various ZM live CD's on a little HP desktop PC.
Pentium 4, 768MB RAM, CD ROM, GrandTec "Grand Capture" card - 4 input with 1x Brooktree BT878 chip. Each input shares the chip - limits FPS but the card is cheap!
The last ZM live CD (installed on hard disk) had failed for some reason.
I remember reading a post in the ZM forums saying the one I was using would fail, so I decided not to re-install it but instead try setting ZM up from scratch on a chosen distribution - and learn something.
Like - how to fix it when it goes wrong
The Linux OS:
Crunchbang Linux is a Ubuntu-derived distribution using the Openbox window manager. Its a light & nimble distribution, according to their website at:
http://crunchbanglinux.org/
Often I download live CD distros and boot them up either on my Mac or
under Virtual Box VM just to play with. Crunchbang impressed me with its
ability even on relatively lightweight systems.
Installation - first steps:
Once you have Crunchbang Linux installed on your hard drive, booted & running the first thing you'll want to do is a system update.
In Crunchbang this is a right click, then to System, then to System Update.
Amongst other things this seems to update the repositories list so that apt-get finds zoneminder & other useful things.
Most of the following steps are done using the sudo command - you'll require your password you supplied during the installation of Crunchbang.
Installation - getting everything installed:
Right-click and choose Terminal.
Install Zoneminder & dependencies by typing:
sudo apt-get install zoneminder
The installer will do the rest, including all the package dependencies like Apache.
It requires input - don't walk away - or you'll come back to a waiting question (several times)
The question is MySQL password - it asks several times.
I just pressed return each time (security risk? set password first time then answer with the same from then on?)
Then we need to modify Apache a bit:
sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
Then we restart Apache:
sudo /etc/inst.d/apache2 force-reload
Check Zoneminder is running - launch the web browser (Firefox) and go to: http://localhost/zm
Check the capture card is working - install Xawtv.
sudo apt-get install xawtv
Run Xawtv by typing:
xawtv
At this stage most likely the video will not work. This is because we need to let the system know what card we've got.
Find out by typing:
lspci
Note down the results - you may of course already know what card it is. A bit of web searching especially in the Zoneminder forums should reveal the settings required. I have a GrandTec Grand Capture BT 878-based card, and found the needed settings by doing a bit of searching.
You will need to make a bttv.conf file - for that you'll need a text editor.
Gedit text editor is supplied with Crunchbang by default. So:
sudo gedit
Paste in the config info found. In my case it was (all on one line):
options bttv gbuffers=32 card=77 tuner=4 radio=0 coring=1
full_luma_range=1 chroma_agc=1 combfilter=1 autoload=0 triton1=0 vsfx=0
In gedit, save the file as bttv.conf in /etc/modprobe.d/
Do this by clicking on "file system" and then going into "etc" then into "modprobe.d" (thus the 'path' is /etc/modprobe.d/bttv.conf
Now you'll need to restart. Right click, choose "exit", choose "restart"
Once restarted, open the terminal again and run xawtv by typing xawtv
Right-click on the Xawtv window, set tv standard (PAL, NTSC, SECAM) as
required and then try choosing an input.
Its worth noting that my card is labelled 1 to 4 on the back, but as is using in computing terms this equates to 0 to 3. Choose input . Plug in a source
(such as one of your cameras) then under Capture choose "Grab Display"
If you get a picture then all is well.
Quit Xawtv.
While messing around I read that running zmfix is good. So, in terminal:
sudo zmfix -a
Zoneminder will need permission to access the video device, so:
sudo chmod 777 /dev/video0
(INSERT Zonemidner Probe stuff too.. reveals card type)
Now zonemidner should see the camera inputs of your card.
Add a monitor (for now), click on presets and choose the one that nearest matches your capture card. For my card, I chose BTTV PAL 320x240 5FPS.
I had to switch off the "roate right" feature.
Hopefully at this point you'll have a picture within Zoneminder.
Upon reboot you may find the permissions wrong again, but that a
sudo chmod 777 /dev/video0 fixes things until the next reboot.
Some searching again in the Zoneminder forums revealed that under Ubuntu-based Linux releases, you'll need to:
sudo chmod 4755 /usr/bin/zmfix
Reboot and all should be fine.
(http://www.zoneminder.com/forums/viewtopic.php?t=8621)
Extra stuff:
Open SSH was also installed:
sudo apt-get openssh
Since the computer itself is in a cupboard most of the time, I installed VNC remote desktop (note this is problematic when not using an attached screen - see note below)
sudo apt-get install vino
vino-preferences
Set the preferences to allow control from users.
Require password for control (choose a good password)
Show icon always.
You will want this to auto-start, so right click and go to Preferences, OpenBox and then autostart.sh
Add the following at the end:
usr/lib/vino/vinoserver &
This will automatically start the VNC server when the computer starts, on the standard port 5900. If you wish to modify the port (OPTIONAL):
sudo apt-get install gconf-editor
gconf-editor
Check "Use Alternative Port"
Change "Alternative Port" to whatever (ie: 5901)
Restart.
Last of all, right click on the ethernet icon at the bottom of the screen.
Change it to a static IP address within your network.
Problem:
VNC does not work in headless mode (ie: computer starts without screen
attached) - this isn't too much of a problem if you've installed & configured SSH access as Crunchbang is supplied with the nice & easy to use Pico text editor as well, which runs in terminal and does not require a graphical front-end.
In place of sudo gedit use sudo pico instead.
So far that's it. The latest Zoneminder is running under Crunchbang. I can even view feeds/events OK on my iPhone - I don't recall editing any settings for this, I am using JPEG rather than MPEG - other than that - I think the set-up is as it comes.
As I said - I'm putting this "out there" to share my experience - and maybe as a base for a "how to" under the Crunchbang distro. Feel free to ask questions & make corrections.
Cheers!
Ashley
Zoneminder under Crunchbang Linux - notes/howto
-
- Posts: 4
- Joined: Wed Aug 05, 2009 6:42 pm