Time Lapse Pi-tography

I know…I am hilarious and witty.  So here it is almost 2 months after the fact, but better late than never.  I have been playing with my camera rig making lots of time laps videos and playing with the setup.  One thing I haven’t played with much is the script itself.

=========================================================================

#!/bin/bash
# To take timelapse photos
TD=$(date +”%m-%d-%Y”)
SAVEDIR=/Pictures
HR=’date +%H’

mkdir -p $SAVEDIR

filename=img-$(date +”%Y%m%d%H%M%S”).jpg
echo "Shooting $filename"
fswebcam -r 960×720 $SAVEDIR/$filename
# sleep for 5 seconds
sleep 5

=========================================================================

The last 5 lines are repeated a few times after this so the camera will take a picture every 5 seconds.  I set the cronjob to run the script every minute….I know I got lazy.  I am sure there are much easier ways to set this repeating command to occur.  This script runs from 6am until 9pm everyday.  At 9:15pm I have a second script that runs and compress’ all of the pictures into a single video for the day.  Here is that script

=========================================================================

TD=$(date +”%m-%d-%Y”)

mencoder mf:///Pictures/*.jpg -mf w=800:h=600:fps=15:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o /home/pi/$TD-movie.avi

rm -fr /Pictures/*

=========================================================================

The Movie script does delete the pictures from that day, which is nice to keep the SD card clear of any unnecessary files.

One problem I have is keeping correct time on the RPi.  This is currently done via the network, when I am at home the Pi will connect to the network and update it’s time.  However when I am not near a “known” network it will not update the time, so it will go off the last time it knew about, which is usually a day or two behind.  This isn’t normally a big deal, but I am looking to deploy this setup out in the field or in nature to get some nice time lapse nature videos, and it will be important for the videos to be dated properly.  I don’t want to add a GPS to the system because I fear that might overload the power requirements.  I am currently looking at getting a solar panel and battery to keep this thing very portable/network independent.

Here is a photo of my current setup.

IMG_20150529_122631

The camera is a Logitech 720p Webcam, battery pack on the bottom, and of course my RPi in the middle with a few bands to keep it all together.

Back from the dead…..Not just for Jesus anymore.

Well I am back from the dead,  I guess.  I have been on a hiatus since my last post due to work issues.  I have been trying to come up with some new ideas for posts and things to do with my RPi.  I found a few articles on making a nature camera/stop time animation camera.  I unfortunately do not have the RPi camera module for my Pi’s.  I do however have a USB camera that works pretty well.  I have been playing with it on my Pi for a while and thought I would build my own nature Pi Camera.

So I started off with my basic Pi and then added the camera and battery pack.  So now my little system is portable and easy to setup.  Thankfully I have a good size battery so my camera will run for a number of hours on just the battery.  It typically runs over 8 hours when I am just doing wireless network sniffing with my GPS and Wi-Fi dongles attached.  So I should be okay for just as long with only my camera connected.  I will follow this article up with additional information about my new time lapse camera setup, including scripts.

Free Raspberry Pi

I was surprised earlier this year when I signed up for a trial to monitor some of my servers.  With this sign up I was told I would get a free t-shirt and Raspberry Pi.  I got the t-shirt within a few weeks, but I didn’t think anything about the Raspberry Pi.  I was amazed in July when I opened the mail to find a brand spanking new Raspberry Pi waiting for me.  Not only was it free but it was the latest and greatest Raspberry Pi Model B+.

Since I already had 2 Model B’s I hadn’t planned anything to do with this new one.  So now that I am starting to get some free time I thought I needed to figure out what to do with this new one.  So what to do with it…hmm….the possibilities are endless.  I could:

Why not try multiple options, cause they all sound really good. I have decided to start with the simplest one, making a wireless network range extender.  I have also added a Parallax 16×2 LCD so I can start teaching myself other things.

I have set-up one of my Raspberry Pi’s to be a War-Pi Sniffer.  More on that one later.

War-Pi

Ever since I first got my Raspberry Pi I knew I wanted to set-up a wireless sniffer.  My goal was to create a small sniffer that was able to be transported in my car so I could sniff wireless networks and map their locations.

I started by looking all over the web to find as much information as I could about others that had already done this.  I found a few sites, like this one and this one.  Although I found this paper to be the best as far as documenting the whole process.

Now that I have gotten my rig set-up it’s time for some testing…..so that’s what I did.  I hopped in my car turned on the WarPi and drove around sniffing for networks.

Yeah….I got some results.  Now how do I use this information???  I knew I wanted to view the finding on Google Earth.  So I used the netxml2kml.py script in the document.  Once I have converted the files I am able to view the networks in Google Earth.

One of the things I wanted to do was help automate the process of getting my Kismet logs to a Google Earth files.  I created the following script to transfer the files from my Raspberry Pi SD card to a more portable storage media.

==============================================================================

DEST=/media/USBDrive/
SOURCE=/media/WarPi_SD_Card/kismet
DATE=$(date ‘+%m-%d-%Y’)

if [ -f $$DEST/Kismet-$DATE ];
then
python /home/user/Scripts/netxml2kml.py –kmz –kml -o $DEST/Kismet-1-$DATE $SOURCE/*.netxml $DEST/
else
python /home/user/Scripts/netxml2kml.py –kmz –kml -o $DEST/Kismet-$DATE $SOURCE/*.netxml $DEST/
fi
rm -fr $SOURCE/*

==============================================================================

I was able to find a Polaroid phone charger for only $15.  This gives me the ability to walk around with the War-Pi running for over 8 hours.  Here is my rig.

War-Pi