Archive for

August, 2013

...

Timelaps with the Raspberry Pi camera board

no comments

source:
http://www.raspberrypi-spy.co.uk/2013/05/creating-timelapse-videos-with-the-raspberry-pi-camera/

Step 1 – Taking the time-lapsed photos

This command will take a photo every 60 seconds (60000 milliseconds) for 2 hours (7200000 milliseconds) resulting in a sequence of 120 images.

raspistill -o timelapse_%04d.jpg -tl 60000 -t 7200000

The “%04d” will result in a four digit number appearing in each filename.

myimage_0001.jpg
myimage_0002.jpg

myimage_0119.jpg
myimage_0120.jpg

Step 2 – Combine images into MP4 video

Once you’ve got your image sequence you will need a method to stitch them together. I decided to use “avconv”. You can install this useful library with the following command :

sudo apt-get -y install libav-tools

To construct the video file from your image sequence you use the command shown below. Although it appears on multiple lines for readability it should be entered as a single line on the command line :

avconv -r 10 -i timelapse_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 timelapse.mp4

The video will be the full resolution of the default image size (2592×1944).

To crop the images and create a more standard 1280×720 resolution video you can use the following command :

avconv -r 10 -i timelapse_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 -vf crop=2592:1458,scale=1280:720 timelapse.mp4

The “vf” option defines a video filter. In this case two filters which crop the incoming image to 2592×1458 and then scale them to 1280×720.

The “r” option tells avconv to create a video with a frames per second of 10. It appears twice to prevent avconv dropping frames that it thinks are similar.

The “crf” option tells avconv to aim for a quality level of “20″ which is a good starting point. Lowers values are better but will increase the file size.

The “-g” option sets the GOP value. The YouTube Advanced Encoding Settings page recommends that the GOP should be set to half the frame rate so this is set to 15.

Gertboard ATmega IO vs. Arduino Pins

no comments

The printing on the Gertboard indicated the port and pin numbers internal to the Atmega microcontroller… However this is normally hidden from the user by the Arduino’s “wiring” library and rather than refer to (e.g.) Port B, bit 5, you’d normally refer to “pin 15″.

The mapping is fairly straightforward, but to help you connect wires to pins on the Gertboard, here is a handy table to let you see what the connections are:

See source:
https://projects.drogon.net/raspberry-pi/gertboard/gertboard-atmega-io-vs-arduino-pins/

Setup Arduino IDE serial monitor on the Raspberry Pi

no comments

The Arduino IDE does not understand names such as /dev/ttyAMA0.

One suggestion is to

sudo ln -s /dev/ttyAMA0 /dev/ttyUSB9

and restart the Arduino IDE.

This creates an alias to /dev/ttyAMA0 which the IDE may understand.

Source:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=42&t=28908

Mounting a network hd

no comments

Make the mount folder

sudo mkdir /mnt/nethdd

Add the network drive to fstab:


sudo nano /etc/fstab

//192.168.0.10/HDDShared /mnt/nethdd cifs auto,password= 0 0

Mount it

sudo mount /mnt/mynethdd

Ok that worked as long as you want to have it read only..
Tried some other things to get it read/write..

This seems to work for now:

sudo chown -R pi /mnt/nethdd/
sudo chmod a+rwx /mnt/nethdd/

fstab:
//192.168.1.254/HDDShared /mnt/nethdd cifs rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

remount withour rebooting:

sudo mount -a

OMXPlayer GUI on the Raspberry Pi

no comments

From this website:
http://stevenhickson.blogspot.nl/2012/08/setting-up-omxplayer-gui-on-raspberry-pi.html

Unfortunately omxplayer is a command line tool and that can get bothersome. To easily get around this and use it, install xterm by running:

Note: You don’t have to use xterm, you can use the built in lxterminal instead by replacing xterm with lxterminal in all the examples below. However, xterm allows for the nice fullscreen option that omxplayer messes up.

sudo apt-get install xterm

Then right click one of your avi files and select open with, then click custom command line tool, type in:

xterm -fullscreen -fg black -bg black -e omxplayer -o hdmi -r %f

and check the box saying always do this so you only have to double click on any avi file in the future and it will do the same thing.

This opens up omxplayer in a new terminal so the key presses, such as p (pause) and q (quit), work. It also opens it up in fullscreen (the -r flag and the -fullscreen flag for xterm). Note: The rest of the display goes to sleep after a while so if the screen is black when the movie quits, shake the mouse or press a key to wake it up.

Updating the Raspberry pi (and firmware)

no comments

First the normal update
sudo apt-get update && sudo apt-get upgrade

Upgrade your firmware:

sudo apt-get -y dist-upgrade

And:

sudo rpi-update

Getting sound on the Raspberry pi

no comments

To get sound out the headphone jack type:

sudo modprobe snd_bcm2835
sudo amixer cset numid=3 1

To get sound out the HDMI

sudo modprobe snd_bcm2835
sudo amixer cset numid=3 0

Trouble with omxplayer?

set the -o output for 3.5 audio jack

omxplayer -o local

set the -o output for hdmi

omxplayer -o hdmi

from: http://www.raspians.com/Knowledgebase/no-analog-sound-out-the-headphone-jack/

Synergy on raspberry pi

no comments

Some how I couldnt get the synergyc command te run at GUI startup.

This worked for me:

Created a script called “startsynergy.sh” in my /scripts/ folder

#!/bin/bash
#
# START SYNERGY CLIENT
#
synergyc 192.168.1.33

chmod it:
chmod +x startsynergy.sh

Edit autostart:
sudo nano /etc/xdg/lxsession/LXDE/autostart

And add it at the last line..

@bash /home/pi/scripts/startsynergy.sh

Thats is. There are many roads to Rome and I took this ride 🙂

Dropbox script for raspberry Pi

no comments

https://github.com/andreafabrizi/Dropbox-Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.

PiBang = Crunchbang for the Raspberry Pi

no comments

http://pibanglinux.org/

From the website:

This is PiBang Linux. A Linux distribution for the Raspberry Pi. It is inspired by Crunchbang Linux, and based on Raspbian.

PiBang

It is a very light Distro with openbox.

It give you that Crunchbang feeling when you run it on the Raspberry Pi.