Alright, here is my first blogpost.
No garanties, proceed with caution and at your own risc.
A while ago I started wondering what the power consumption would be
of my home server / media center. A dual core 3 Ghz, 300watts.
Needless to say, it turned out to be expensive. About 600 euros a year
expensive.
This meant radical measurements. I bought a Apple TV 2, jailbroke it
and installed xmbc on it. Only 10 watts when in use, magnificent. As
far as mediacenters go that is, with it's 8 gb of storage it does a lousy
job as file server. :-)
That's where the QNAP comes in. Since I already had enough
harddrives, it felt a bit stupid to buy another one. Luckily there was
a NAS available with just a sata drive slot.
QNAP TS-110, with its arm chipset the device uses only 7 watts when
in use. 5 when idle. Nice. And even better, it's Linux powered with ssh
access and even a package manager.
You can even hook up security cameras to it, according to the box
that is. It turns out, the little bugger only likes those expensive ip cams.
But hea, that's not going to ruin my day. Lets face it, the QNAP has
usb, linux, memory, harddrive, and who knows what else. So I started
searching the web, went into freak mode, and succeeded. A QNAP TS-110
that also has usb webcam support for security became a fact.
Allow me to talk you trough it.
In those steps i assume that you have some know-how of Linux,
command line stuff. And already know how to log in
you own QNAP through ssh.
Here we go; log in to your machine using your favorite ssh client.
install some required software:
ipkg install nano gcc make automake ncurses ncursesw wget w3cam motion
Browse to your harddrive: note, you QNAP may have a different location for this!
cd /share/HDA_DATA
Create a folder to work from, for example, "cam"
mkdir cam
cd cam
Get sourcefiles for your QNAP:
wget http://resources.qnap.com/Storage/tsd/QNAP_GPL_3.3.3-20100928.tar.gz
Get Linux kernel source:
wget ftp://ftp.jp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.2.tar.gz
Untar those files:
tar xzvf QNAP_GPL_3.3.3-20100928.tar.gz
tar xzvf linux-2.6.33.2.tar.gz
browse to the folder that corrospondents to your QNAP:
cd GPL_TS/kernel_cfg
ls
cd TS-110
ls
uname -r
2.6.33.2
cp ./linux-2.6.33.2-arm.cfg ../../../linux-2.6.33.2/.config
cd ../../../linux-2.6.33.2/
nano ./.config
# CONFIG_MEDIA_SUPPORT is not set
CONFIG_MEDIA_SUPPORT=m
#
# Multimedia core support
#
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_COMMON=m
CONFIG_VIDEO_ALLOW_V4L1=y
CONFIG_VIDEO_V4L1_COMPAT=y
CONFIG_DVB_CORE=m
CONFIG_VIDEO_MEDIA=m
#
# Multimedia drivers
#
CONFIG_IR_CORE=m
CONFIG_VIDEO_IR=m
# CONFIG_MEDIA_ATTACH is not set
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEO_V4L1=m
CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_VMALLOC=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_VIVI=m
CONFIG_VIDEO_CPIA=m
CONFIG_VIDEO_CPIA_USB=m
CONFIG_VIDEO_CPIA2=m
# CONFIG_VIDEO_STRADIS is not set
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_USB_GSPCA=m
CONFIG_USB_M5602=m
CONFIG_USB_STV06XX=m
CONFIG_USB_GL860=m
CONFIG_USB_GSPCA_CONEX=m
CONFIG_USB_GSPCA_ETOMS=m
CONFIG_USB_GSPCA_FINEPIX=m
CONFIG_USB_GSPCA_JEILINJ=m
CONFIG_USB_GSPCA_MARS=m
CONFIG_USB_GSPCA_MR97310A=m
CONFIG_USB_GSPCA_OV519=m
CONFIG_USB_GSPCA_OV534=m
CONFIG_USB_GSPCA_PAC207=m
CONFIG_USB_GSPCA_PAC7302=m
CONFIG_USB_GSPCA_PAC7311=m
CONFIG_USB_GSPCA_SN9C20X=m
CONFIG_USB_GSPCA_SN9C20X_EVDEV=y
CONFIG_USB_GSPCA_SONIXB=m
CONFIG_USB_GSPCA_SONIXJ=m
CONFIG_USB_GSPCA_SPCA500=m
CONFIG_USB_GSPCA_SPCA501=m
CONFIG_USB_GSPCA_SPCA505=m
CONFIG_USB_GSPCA_SPCA506=m
CONFIG_USB_GSPCA_SPCA508=m
CONFIG_USB_GSPCA_SPCA561=m
CONFIG_USB_GSPCA_SQ905=m
CONFIG_USB_GSPCA_SQ905C=m
CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_STV0680=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_ZC3XX=m
CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_USBVIDEO=m
# CONFIG_USB_VICAM is not set
CONFIG_USB_IBMCAM=m
CONFIG_USB_KONICAWC=m
CONFIG_USB_QUICKCAM_MESSENGER=m
CONFIG_USB_ET61X251=m
CONFIG_USB_OV511=m
CONFIG_USB_SE401=m
CONFIG_USB_SN9C102=m
CONFIG_USB_STV680=m
CONFIG_USB_ZC0301=m
CONFIG_USB_PWC=m
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_ZR364XX=m
CONFIG_USB_STKWEBCAM=m
CONFIG_USB_S2255=m
# CONFIG_RADIO_ADAPTERS is not set
CONFIG_DVB_MAX_ADAPTERS=8
# CONFIG_DVB_DYNAMIC_MINORS is not set
CONFIG_DVB_CAPTURE_DRIVERS=y
CONFIG_DVB_TTUSB_DEC=m
CONFIG_SMS_SIANO_MDTV=m
ln -s /opt/lib/libncurses.so /lib/libncurses.so
ln -s /opt/lib/libncurses.so.5 /lib/libncurses.so.5
ln -s /opt/lib/libncurses.so.5.7 /lib/libncurses.so.5.7
ln -s /opt/lib/libncursesw.so /lib/libncursesw.so
ln -s /opt/lib/libncursesw.so.5 /lib/libncursesw.so.5
ln -s /opt/lib/libncursesw.so.7 /lib/libncursesw.so.7
make oldconfig
make modules
mknod /dev/video0 c 81 0
ln -s /dev/video0 /dev/video
chmod 666 /dev/video*
lsusb
Bus 001 Device 003: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
insmod drivers/media/video/v4l1-compat.ko
insmod drivers/media/video/videodev.ko
insmod drivers/media/video/v4l2-common.ko
insmod drivers/media/video/v4l2-int-device.ko
insmod drivers/media/video/videobuf-core.ko
insmod drivers/media/video/pwc/pwc.ko size=cif fps=5 power_save=1
insmod drivers/media/video/gspca/gspca_main.ko
insmod drivers/media/video/gspca/gspca_spca561.ko
insmod drivers/media/video/uvc/uvcvideo.ko
dmesg
Linux video capture interface: v2.00
pwc: Philips webcam module version 10.0.13 loaded.
pwc: Supports Philips PCA645/646, PCVC675/680/690, PCVC720[40]/730/740/750 & PCVC830/840.
pwc: Also supports the Askey VC010, various Logitech Quickcams, Samsung MPC-C10 and MPC-C30,
pwc: the Creative WebCam 5 & Pro Ex, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.
pwc: Logitech QuickCam 4000 Pro USB webcam detected.
pwc: Registered as video0.
input: PWC snapshot button as /class/input/input0
usbcore: registered new interface driver Philips webcam
vidcat -p y -s 640x480 -d /dev/video0 > /share/HDA_DATA/Public/blaat.jpg
Got your jpeg image? Yipee. Now for some real security cam stuff: Motion.
edit the file /opt/etc/motion.conf
nano /opt/etc/motion.conf
Search for videodevice, make sure it point to where the usb webcam driver is loaded, mine is loaded into /dev/video0
videodevice /dev/video0
Also search for target_dir so it can actually write some files.
target_dir /share/HDA_DATA/Public/cam
I also set some other stuff so it would create a different folder each month and within each month a different folder for every day. And functions as ipcam so i can watch it from my browser op port 8081
you can grab it here: http://www.jantino.nl/blog_files/qnap_webcam/motion.conf
wget http://www.jantino.nl/blog_files/qnap_webcam/motion.conf
cp ./motion.conf /opt/etc/
After this, start motion:
/opt/etc/init.d/S99motion start
Open your browser, goto http://your_nas_ip:8081 or go to your "cam" in your Public folder and see it fill up with moment avi files.
Have fun! if you have questions, or suggestions, or just happy, please don't hesitate and fill in the form below.
Special thanks goes to:
https://gist.github.com/668998
http://www.nslu2-linux.org/wiki/HowTo/AddUsbWebcam