20Views3Replies

Author Options:

I would like to make a set of 20 pictures, each 30 seconds... ? Answered

How can I do that?

Discussions

0
None
JeffM15

5 months ago

I pasted some code from a couple years back.
Let me know if you need some help.
Jeff

0
None
JeffM15

5 months ago

***************************** REFERENCE ***************************************
* http://aryo.lecture.ub.ac.id/configure-timezone-settings-on-raspberry-pi-raspbian-wheezy/
* http://www.linuxreaders.com/2009/07/nconf-installation-configuration.html
* http://myliteraturetechlife.com/install-nconf-web-interface-for-nagios-on-debianubuntu/
* http://digitalcardboard.com/blog/2010/08/24/nagios-and-nconf-on-ubuntu-10-04-lucid-lynx/
* https://www.raspberrypi.org/documentation/linux/filesystem/backup.md
* http://vanheusden.com/java/ScanToNag/
*
*
*
*
*
***************************** REFERENCE *** WEBCAM PICTURE OPTIONS ************
* http://manpages.ubuntu.com/manpages/lucid/man1/fswebcam.1.html
* https://www.raspberrypi.org/learning/webcam-timelapse-setup/worksheet.md
* https://www.raspberrypi.org/documentation/usage/webcams/README.md
* https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=79508
*
***************************** REFERENCE ***************************************


lets start off and assume that we are running on a: 192.168.1.?
if you are not on 192.168.1.? then change all(ctrl-H) 192.168.1 to your network.

lets also assume all passwords will be: abc123!
if you do not want passwords of abc123! then change all(ctrl-H) abc123! to your password.


************ STEP 1 - initial setup, static local ip address, set time zone and load updates
101-Load Pi Image to SD Card
102-insert SD Card in to Pi and boot (turn it on)
(watch the boot up and see what ip is assigned for step 103 below)
go through initial config with all defaults
expand file system - reboot pi

103-ssh to ipaddress(from step 102 above) I use putty.exe available here:
****** http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
logon as pi / raspberry (or whatever you set it as in the setup step #102)

104-sudo passwd root
change to 'abc123!'

105-logout

106-ssh to ipaddress
logon as root / abc123!

107-apt-get update
108-apt-get upgrade

109-shutdown -r now

110-ssh to ipaddress
logon as root / abc123!

111-nano /etc/network/interfaces


change dhcp to static in the following line:
iface eth0 inet dhcp

add the following after the above line:

iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255

112-nano /etc/resolv.conf

make sure server is some public DNS server / if not change/add 8.8.8.8 (GOOGLE DNS)

113-sudo dpkg-reconfigure tzdata

114-shutdown -r now



************ STEP 2 - load perl, apache web server and core defaults
201-ssh to ipaddress
logon as root / abc123!

202-apt-get install apache2

203-apt-get install mysql-server mysql-client
set pasword: abc123!

204-apt-get install php5 php5-mysql perl python-mysqldb

205-apt-get install libdbi-perl libdbd-mysql-perl libapache2-mod-php5 gawk phpmyadmin
use: apache2
set paswords: abc123!

206-shutdown -r now




***************************************************************
*** ADD ONS ** ADD ONS ** ADD ONS ** ADD ONS ** ADD ONS **
***************************************************************
**** if you want ftp ability to send or receive files

301-sudo apt-get install ftp
***************************************************************
** bash script example
***************************************************************
USRID = change_this_to_ftp_user
USRPASS = change_this_to_ftp_password
FILNAME = change_this_to_file.extension
ftp -v -n www.????????.com < user $USRID $USRPASS
prompt off
binary
put /var/www/$FILNAME $FILNAME
bye
END_OF_SESSION
***************************************************************




***************************************************************
*** ADD ONS ** ADD ONS ** ADD ONS ** ADD ONS ** ADD ONS **
***************************************************************
**** if you want samba shares

401-sudo apt-get install samba samba-common samba-common-bin

402-nano /etc/samba/smb.conf
***************************************************************
** add the following at the bottom of the file, and save
***************************************************************

[WebFiles]
comment = Shared Files
path = /var/www
browseable = Yes
writeable = Yes
guest ok = yes
create mask = 0777
directory mask = 0777

403-sudo useradd webadmin

404-sudo passwd webadmin
set pasword: abc123!

406-sudo smbpasswd -a webadmin
set pasword: abc123!

407-sudo /etc/init.d/samba reload

408-service samba restart



***************************************************************
*** ADD ONS ** ADD ONS ** ADD ONS ** ADD ONS ** ADD ONS **
***************************************************************
******* if you want add webcam stuff that ftps picture every hh:mm:ss?
801-ssh to ipaddress
logon as root / abc123!

802-sudo apt-get install fswebcam

803-sudo apt-get install ftp

804-sudo dpkg-reconfigure tzdata

805-cd /usr

806-mkdir webcam

807-cd webcam

808-nano capture_and_ftp.sh



******************** highlight from here down to there and copy paste into webcam.sh
******************** REPLACE ???XXXXXXX??? WITH YOUR INFORMATION
#!/bin/bash
DATE=$(date +"%Y-%m-%d_%H%M%S")
FOLDERDATE=$(date +"%Y%m%d")
MYSITE=???SITENAME???
cd /usr/webcam/audit
mkdir $FOLDERDATE
fswebcam -r 800x600 /usr/webcam/audit/$FOLDERDATE/$DATE_$MYSITE.jpg
cp /usr/webcam/audit/$FOLDERDATE/$DATE_$MYSITE.jpg /webcam/$MYSITE.jpg

ftp -v -n www.???YOURWEBSITE???.com < user ???USERNAME??? ???USERPASSWORD???
prompt off
binary
put /usr/webcam/$MYSITE.jpg $MYSITE.jpg
bye
END_OF_SESSION
******************** highlight from here up to there and copy paste into webcam.sh

ctrl-x save = yes

809-sudo chmod +x capture_and_ftp.sh

810-crontab -e

##**************** pick your seconds for capture
# 5 seconds
#* * * * * sleep 10;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 15;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 20;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 25;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 30;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 35;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 40;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 45;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 50;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 55;bash /usr/webcam/capture_and_ftp.sh

# 6 seconds
* * * * * bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 6;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 12;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 18;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 24;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 30;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 36;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 42;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 48;bash /usr/webcam/capture_and_ftp.sh
* * * * * sleep 54;bash /usr/webcam/capture_and_ftp.sh

# 10 seconds
#* * * * * bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 10;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 20;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 30;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 40;bash /usr/webcam/capture_and_ftp.sh
#* * * * * sleep 50;bash /usr/webcam/capture_and_ftp.sh


811-sudo service cron restart

812-shutdown -r now

0
None
Pegasus37

6 months ago

Look here:
https://www.raspberrypi.org/documentation/usage/camera/raspicam/timelapse.md