Wednesday, October 3, 2012

DNS-323 based home security camera

Quite some time ago, I bought a wireless IP camera from Amazon UK, intending to set it up at home as a DIY security camera. Whilst it was great value for money, the web based user interface was quite limited and basically I wasn't able to do what I wanted.

After some googling, I found out about 'motion', motion detection software, seemingly designed for the job. I figured if I could run 'motion' on my DNS-323, I could make a workable solution.

EasyN FS-613A-M136 Wireless Pan & Tilt IP Camera
Motion

Recently I got around to trying it, and am pleased with the results so far, his how I did it -

Download and install development tools (thanks fonz) necessary to build motion using -

wget http://www.inreto.de/dns323/fun-plug/0.7/oabi/packages/
funpkg -i

for each of the packages below -

autoconf-2.68-oarm-2.txz
automake-1.11.3-oarm-1.txz
binutils-2.22-oarm-3.txz
gcc-4.5_20120202-oarm-1.txz
gcc-solibs-4.5_20120202-oarm-1.txz
libjpeg-8c-oarm-2.txz
linux-libc-headers-2.6.12.0-oarm-2.txz
make-3.81-oarm-2.txz
mpfr-3.1.0-oarm-2.txz
uClibc-0.9.30.3-oarm-1.txz
uClibc-solibs-0.9.30.3-oarm-1.txz

Download motion source, configure, and make -

motion-3.2.12.tar.gz
./configure --without-v4l
make

A small patch afterwards, to get it to link properly -

gcc  -o motion motion.o conf.o draw.o jpegutils.o video.o video2.o video_common.o netcam.o netcam_ftp.o netcam_jpeg.o netcam_wget.o track.o alg.o event.o picture.o rotate.o webhttpd.o webcam.o  -lm  -ljpeg -lpthread

root@dlink-EEF76A:/mnt/HD_b2/tmp/motion-3.2.12# cat motion.conf 
netcam_url http://192.168.0.111:81/videostream.cgi?showlength=1
netcam_userpass admin:password
locate on

framerate 2

And voila -


root@dlink-EEF76A:/mnt/HD_b2/tmp/motion-3.2.12# ./motion -c motion.conf 
[0] Processing thread 0 - config file motion.conf
[0] Motion 3.2.12 Started
[0] Thread 1 is from motion.conf
[1] Thread 1 started
[1] Resizing pre_capture buffer to 1 items


Works nicely!

Friday, September 21, 2012

Re-enabling autofs (aka automount) after Fedora 17 upgrade



$ sudo systemctl enable autofs.service
ln -s '/usr/lib/systemd/system/autofs.service' '/etc/systemd/system/multi-user.target.wants/autofs.service'
$ sudo systemctl start autofs.service

Modify auto.smb to avoid se-linux denial on root password request when auto-mounting smb shares

Change line ->
#opts="-fstype=cifs"
to ->
opts="-fstype=cifs,guest"

Upgrade Fedora 16 to 17 using pre-upgrade

The process was quite smooth, as described here -

https://fedoraproject.org/wiki/How_to_use_PreUpgrade

I then hit this (I think that it is expecting grub2)?

https://fedoraproject.org/wiki/How_to_use_PreUpgrade#Upgrade_does_not_install_upon_reboot

I then tried using -

Method 2: Edit the Grub menu.lst File

but hit this error -

dracut Warning: /dev/root does not exist.


and realised the solution was to copy the complete kernel line from the grub2 file /boot/grub2/grub.cfg 
into /boot/grub/grub.conf, as below -

title Fedora Upgrade
root (hd0,4)
kernel /upgrade/vmlinuz preupgrade repo=hd::/var/cache/yum/preupgrade ks=hd:UUID=f83bc73c-070b-4e9a-8f0e-c46b56ec8a5a:/upgrade/ks.cfg stage2=hd:UUID=f83bc73c-070b-4e9a-8f0e-c46b56ec8a5a:/upgrade/squashfs.img
initrd /upgrade/initrd.img
savedefault
boot

Having fixed this, the upgrade went smoothly, and F17 is looking great!

Wednesday, September 19, 2012

Boot Fedora 17 Live from partition on hard drive

'poor man's install', again for Fedora 17. (See my earlier post for Fedora 16)

Use fdisk to create a FAT32 partition large enough to hold the live distro, in my case /dev/sda8 below
Format it using mkfs or gparted.


Command (m for help): p


Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xaa9baa9b


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    24578047    12288000   27  Hidden NTFS WinRE
/dev/sda2   *    24578048    24782847      102400    7  HPFS/NTFS/exFAT
/dev/sda3        24782848   502260399   238738776    7  HPFS/NTFS/exFAT
/dev/sda4       502261760   625142447    61440344    5  Extended
/dev/sda5       502263808   503287807      512000   83  Linux
/dev/sda6       503289856   605689855    51200000   83  Linux
/dev/sda7       605691904   613883903     4096000   82  Linux swap / Solaris
/dev/sda8       613885952   625141759     5627904    b  W95 FAT32

Mount the iso image, and copy files from it 
su
cd /mnt/
mkdir iso live
mount -o loop -t iso9660 ~/Downloads/Fedora-Live.iso iso
mount -t vfat /dev/sda8 live
cp -r iso/* live/

Examine the grub conf on the live distro -
cat /mnt/live/EFI/boot/grub.conf
..
title Fedora-17-x86_64-Live-Desktop.is
  findiso
  kernel /isolinux/vmlinuz0 root=live:LABEL=Fedora-17-x86_64-Live-Desktop.is rootfstype=auto ro liveimg quiet  rhgb
  initrd /isolinux/initrd0.img
..

Find the UUID of your live partition -

[steve@aspireone753 ~]$ ls -lF /dev/disk/by-uuid
total 0
lrwxrwxrwx. 1 root root 10 Nov 13 11:33 B381-1423 ->; ../../sda8

Then edit the regular grub.conf on your main linux installation. Changes needed are shown in bold.

sudo vi /boot/grub/grub.conf

paste in a new entry, copied from the live distro -

title Fedora-17-x86_64-Live-Desktop.is
  root (hd0,7)
  kernel /isolinux/vmlinuz0 root=UUID=B381-1423 rootfstype=auto rw liveimg quiet  rhgb
  initrd /isolinux/initrd0.img
Reboot, and choose the live distro at the grub menu.

Wednesday, July 11, 2012

Windows 7 update stopped working

First I tried this - but it didn't seem to help.
http://windows.microsoft.com/en-US/windows7/What-is-the-System-Update-Readiness-Tool

This however did -
http://helpdeskgeek.com/windows-7/cannot-run-windows-update-on-a-windows-7-pc/

The updater then updated itself, and found 32 updates.

Ubuntu for my HTPC

As XBMC wasn't as well maintained for Fedora as for Ubuntu, I finally took the plunge and re-installed my HTPC with Ubuntu. The process was quite smooth, and I was able to quickly move to the latest XBMC.

However, I have had a few strange issues with audio.

The first issue seemed to relate to the wrong audio device being selected by default. However, as I tried workarounds, the problem disappeared - and rolling back the workarounds left the sound working.. so that is an unexplained mystery.

The next problem related to VLC. I downloaded VLC remote for my Samsung Galaxy S2, and tested controlling VLC on the HTPC remotely. It worked nicely. I then configured VLC to auto-start at login, with an HTTP interface (headless), such that whenever the HTPC is on, I can easily start playing media remotely from the phone.

With VLC auto-starting - I now had distorted audio. The solution I'm using for now is #23 in the post below -

https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/751265

Wednesday, February 29, 2012

DNS-323 Updates

As the drives are getting old in my DNS-323, I started to look at updating the oldest one to a 2TB drive. After some reading about Advanced Format Drives, I decided it was time to a firmware and ffp upgrade. This I did in steps.

Firmware from 1.06 -> 1.08
- minor issues related to ffp installation on USB
- otherwise smooth

FFP 0.5 -> 0.7
- smooth

transmission
- Smooth with ffp-0.7 (oabi)

Firmware from 1.08 -> 1.10
- smooth

NFS apkg install
- smooth