{"id":308,"date":"2013-05-13T09:05:15","date_gmt":"2013-05-13T09:05:15","guid":{"rendered":"http:\/\/www.buildcube.com\/tech_blog\/?p=308"},"modified":"2013-05-13T09:05:15","modified_gmt":"2013-05-13T09:05:15","slug":"zoneminder-on-debian-with-a-dvr-card-using-techwell-chipset","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2013\/05\/13\/zoneminder-on-debian-with-a-dvr-card-using-techwell-chipset\/","title":{"rendered":"ZoneMinder on debian with a DVR card using techwell chipset"},"content":{"rendered":"<p>1- Installed the debian base system, debian wheezy (7) (But should work with debian squeeze (6))<br \/>\n2- apt-get install ssh openssh-server fail2ban<br \/>\n3- INSTALLED THE HARDWARE 8 CAMERA DVR CARD into the PCI slot<br \/>\n4- Modified the network interfaces to use a static IP, and pointed the DMZ of the router to that IP<br \/>\n5- installed some software (Even though some of them would have been installed anyway when i install zoneminder), but i do it anyway just in case they are optional in zoneminder<\/p>\n<pre>\napt-get update\napt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server\napt-get install ffmpeg libarchive-tar-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl\napt-get install libjpeg62 libmime-perl libstdc++6 libwww-perl zlib1g\napt-get install zoneminder\n<\/pre>\n<p>I can see close to the end of operation<\/p>\n<p>ZoneMinder is stopped<br \/>\ninvoke-rc.d: initscript zoneminder, action &#8220;status&#8221; failed.<br \/>\nStarting ZoneMinder: success<\/p>\n<p>I hope it&#8217;s nothing too serious<\/p>\n<p>Now, check if your card is supported, you issue lspci -v as root&#8230; Since my 8 port card is supported, i see eight stanzas of this<\/p>\n<p>I got eight of the following labeled 03:02.0 03:02.1 03:02.2 03:02.3 03:02.4 03:02.5 03:02.6 03:02.7<\/p>\n<pre>\n03:02.2 Multimedia video controller: Techwell Inc. TW6816 multimedia video controller (rev 10)\nSubsystem: Techwell Inc. TW6816 multimedia video controller\nFlags: bus master, 66MHz, medium devsel, latency 32, IRQ 3\nMemory at febfe800 (32-bit, non-prefetchable) [size=1K]\nCapabilities: [44] Power Management version 2\n<\/pre>\n<p>If you dont see your card&#8217;s devices, well, your out of luck, maybe you should try a newer kernel, i am using 3.2 from debian wheezy (7)<\/p>\n<p>Now, to the second test<\/p>\n<pre>ls -ls \/dev\/video*<\/pre>\n<p>NO love, nothing, If i were lucky, i would get something like<\/p>\n<pre>\nls -ls \/dev\/video*\n0 crw-rw----+ 1 root video 81,\u00a0 0 30. Jul 15:18 \/dev\/video0\n0 crw-rw----+ 1 root video 81,\u00a0 2 30. Jul 15:18 \/dev\/video1\n0 crw-rw----+ 1 root video 81,\u00a0 4 30. Jul 15:43 \/dev\/video2\n0 crw-rw----+ 1 root video 81,\u00a0 6 30. Jul 15:43 \/dev\/video3\n0 crw-rw----+ 1 root video 81,\u00a0 8 30. Jul 15:17 \/dev\/video4\n0 crw-rw----+ 1 root video 81, 10 30. Jul 15:17 \/dev\/video5\n0 crw-rw----+ 1 root video 81, 12 30. Jul 15:17 \/dev\/video6\n0 crw-rw----+ 1 root video 81, 14 30. Jul 15:17 \/dev\/video7\n<\/pre>\n<p>But i did not, so i need the driver to my techwell card.<\/p>\n<p>Simple, there is a nice person who made a driver already, let&#8217;s see how we can install it<\/p>\n<p>First, we need GIT so that we can download the driver<\/p>\n<pre>\napt-get install git\napt-get install linux-headers-$(uname -r)\napt-get install make sudo\n<\/pre>\n<p>(without installing sudo, the compile gives the error \/bin\/sh: 1: sudo: not found which is because the guy probably wrote the driver with ubuntu in mind)<\/p>\n<pre>\ngit clone git:\/\/gitorious.org\/tw68\/tw68-v2.git\ncd tw68-v2\nmake\nmake install\n<\/pre>\n<p>So, i was expecting 8 cameras, i got the following<\/p>\n<pre>\nls -ls \/dev\/video*\n0 crw-rw---T 1 root video 81, 0 May 12 23:12 \/dev\/video0\n0 crw-rw---T 1 root video 81, 2 May 12 23:12 \/dev\/video1\n0 crw-rw---T 1 root video 81, 4 May 12 23:12 \/dev\/video2\n0 crw-rw---T 1 root video 81, 6 May 12 23:12 \/dev\/video3\n<\/pre>\n<p>probably a driver issue, oh well, lets see what we can do with 4 then i will see about this issue once i have 4 working:D<\/p>\n<pre>\nln -s \/etc\/zm\/apache.conf \/etc\/apache2\/conf.d\/zoneminder.conf<br \/>\nadduser www-data video<br \/>\n\/etc\/init.d\/apache2 restart<\/p>\n<pre>\n<p>Now, visiting 192.168.2.101\/zm\/ allows me to add cameras, the matter is very intuitive from that point on, all you need is a browser, remember you will need to password protect things too :D so that people from the outside can not look at your cameras.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1- Installed the debian base system, debian wheezy (7) (But should work with debian squeeze (6)) 2- apt-get install ssh openssh-server fail2ban 3- INSTALLED THE HARDWARE 8 CAMERA DVR CARD into the PCI slot 4- Modified the network interfaces to use a static IP, and pointed the DMZ of the router to that IP 5- [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":0,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}