Sie sind auf Seite 1von 21

let's make

Login (/account/login) Explore (/tag/type-id/) Publish (/about/create.jsp)


| Sign Up (/account/gopro?sourcea=header&sourceaUrl=%2Fid%2FRaspberry-Pi-Dropbox-Alternative%2F)

Featured: share what


Intelyou
IoT(/id/intel/)
make Laser Cutting(/tag/type-id/category-workshop/channel-laser-cutting/)
(/)
Life Hacks(/tag/type-id/category-home/channel-life-hacks/) Jewelry(/tag/type-id/category-craft/channel-jewelry/)

With Instructables you can share what you make


with the world, and tap into an ever-growing
Raspberry Pi DropCam Alternative community of creative experts.
by nochanceinhell3856 (/member/nochanceinhell3856/)

Download (/id/Raspberry-Pi-Dropbox-Alternative/?download=pdf)
How it Works (/about/create.jsp)
h (/id/Raspberry-Pi-Dropbox-Alternative/?ALLSTEPS) 8 Steps . (/id/Raspberry-Pi-Dropbox-Alternative/step2/Setting-Up-Your-Raspberry-Pi/)
New Instructable (/editInstructable/)
Collection I Made it! Favorite Share

About This Instructable

License:
8 121,425 views
268 favorites

nochanceinhell3856
(/member/nochanceinhell3856/)
(/file/FYPEB2DHP1Q2AQF/)
Follow 32
(/member/nochanceinhell3856/)
I was looking for a way to check in on my house while away as well as have any
motion captured and uploaded to the internet as a security camera. Doing a More by nochanceinhell3856:
little research online and realizing that I had a raspberry pi and a usb webcam
not being used for anything else, This is what I put together.
(/id/Cheap-and-Easy-
Please note, this is a brute force method and does not provide any type of
security to the webcams stream but its my first time working on something like
this.

Ad
Sheeld CCTV Company Fireplace-Heater/)
CCTV Maintenance & Repairs Free Surveys &
Quotes - 01142835825
www.eurocoms.co.uk
(/id/3D-Printed-Cake-Topper/)

(/id/Recovering-Files-

from-a-Snapped-US-Flash-Drive-Rep/)

Tags:
Step 1: Resources
Raspberry Pi (/tag/type-id/keyword-Raspberry%20Pi/)

I have to start with credit to the websites that I used for my research: DropCam (/tag/type-id/keyword-DropCam/)

DropBox (/tag/type-id/keyword-DropBox/)
http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome
Security (/tag/type-id/keyword-Security/)
(http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome) - The software I
used was called Motion, it handles the streaming of the webcam to the web as webcam (/tag/type-id/keyword-webcam/)

well as detecting motion and saving the movie files. surveillance (/tag/type-id/keyword-surveillance/)

https://github.com/andreafabrizi/Dropbox-Uploader
(https://github.com/andreafabrizi/Dropbox-Uploader) - This software allow you
to sync your files into a Dropbox Account Related

How to turn an USB camera


http://www.slblabs.com/2012/09/26/rpi-webcam-stream/
with Raspberry Pi into an
(http://www.slblabs.com/2012/09/26/rpi-webcam-stream/)- This site explains a Onvif IP Camera? (/id/How-
few dierent ways to setup the camera on the raspberry pi to set up a simple to-turn-an-USB-camera-
web stream of the image. (/id/How-to- with-Raspberry-Pi-into-a/)
Vader Box . Intergalactic
Raspberry Pi Battery
http://mogshade.wordpress.com/2012/12/23/simple-home-security-with- Powered Transmitter
raspberry-pi-and-dropbox/ Receiver BOT (/id/Vader-Box-
(http://mogshade.wordpress.com/2012/12/23/simple-home-security-with- Raspberry Pi as low-cost HD
raspberry-pi-and-dropbox/) - This site is where i started with for implementing surveillance camera
(/id/Raspberry-Pi-as-low-
the upload of the movie files to a Dropbox account
cost-HD-surveillance-
(/id/Raspberry-camera/)
http://www.instructables.com/id/Host-your-website-on-Raspberry-pi/ The BoBoBoT 5MP 1080 HD
(http://www.instructables.com/id/Host-your-website-on-Raspberry-pi/) - This SECURITY Camera
Raspberry Pi Security Robot
Instructable was used to set up a simple website to view your Web Stream
(/id/The-BoBoBoT-5MP-
from. 1080-HD-Camera-Raspberry-
(/id/The-
Raspberry Pi - SMS Garage
Door Butler (/id/Raspberry-
Pi-SMS-Garage-Door-Butler/)
by AkiraFist
(/id/Raspberry-(/member/AkiraFist/)

Previous

Next (/id/Raspberry-Pi-Dropbox-Alternative/step2/Setting-Up-Your-Raspberry-Pi/)

View All Steps (/id/Raspberry-Pi-Dropbox-Alternative/?ALLSTEPS)

Download (/id/Raspberry-Pi-Dropbox-Alternative/?download=pdf)
Ad
Sheeld CCTV Company
CCTV Maintenance & Repairs Free Surveys &
Quotes - 01142835825
www.eurocoms.co.uk

We have a be nice comment policy.


Please be positive and constructive. w I Made it! Add Images Post Comment

CdricV2 (/member/CdricV2) 10 months ago Reply

You can also use Kerberos.io (https://kerberos.io/), it's


also open-source and a lot more user friendly to install
and configure. You can find more information on the
website.

MegaD3 (/member/MegaD3) . CdricV2 (/member/CdricV2) Reply

a month ago
Thank you

HazwerN (/member/HazwerN) 2 months ago Reply

can't find "webcam_localhost" in motion.conf file

MegaD3 (/member/MegaD3) . HazwerN (/member/HazwerN)


it's "stream_localhost" - I had trouble too. It must've a month ago Reply

changed recently.

HazwerN (/member/HazwerN) 2 months ago Reply

can't find "webcam_localhost" in motion.conf file

jbennett38 (/member/jbennett38) 9 months ago Reply

Im pretty sure this is clear to some, but being new to


DropCam, I'm a little confused. Will this allow me to setup
and use my DropCam without having to pay for their
monthly service?

Im searching for a way to sync DropCam to Dropbox, if at


all possible.

ColmM1 (/member/ColmM1) . jbennett38 (/member/jbennett38) Reply

5 months ago
@jbennett38 (/member/jbennett38) - no, this is a DropCam
*alternative* solution, it does not integrate with an existing
DropCam camera. Here, you use a Camera designed to be
connected to your Raspberry Pi. There's some pretty good
ones out there with auto night-vision (WaveShare etc) for
around $30.

MikaelH1 (/member/MikaelH1) 8 months ago Reply

Thank u so much guy!

iminbali (/member/iminbali) a year ago Reply

For anyone having trouble getting the photos to upload to


dropbox use this script:
import os

path="/tmp/motion/"
dest="/( REPLACE WITH NAME OF APP FOLDER ON
DROPBOX..."

def upload_files():

if not os.path.exists(path):

return

dir_list = os.listdir(path)

for file_name in dir_list:

if "jpg" in file_name:

print"Upload Pending..."

cmd = "/home/pi/dropbox_uploader.sh upload " + path +


file_name + " " + dest

os.system(cmd)

if __name__ == "__main__":

upload_files()

Pay attention to indenting which was hard to do on this


comment...
Awesome article and very thorough.
Anyone have any advice on configuring passwords for web
server?

markbrooke (/member/markbrooke) . iminbali (/member/iminbali) Reply

11 months ago
Hi,
I've tried using your script but I get an indent error on line 6.
Any chance you can upload to github or something as I'm
not savvy enough with python to fix errors.
This is what I'm doing - I've edited it briefly for my own
situation (ie path of uploder, and where the
dropbox_uploader.sh script is located.
import os
path="/var/www/media/"
dest="/MBRPI"
def upload_files():
if not os.path.exists(path):
return
dir_list = os.listdir(path)
for file_name in dir_list:
if "jpg" in file_name:
print"Upload Pending..."
cmd = "/home/pi/Dropbox-Uploader/dropbox_uploader.sh
upload " + path + file_name + " " + dest
os.system(cmd)
if __name__ == "__main__":
upload_files()

(http://cdn.instructables.com/F6G/H7B4/I85QOPCV/F6GH7B4I85QOPCV.LARGE.jpg)

Zatara11 (/member/Zatara11) a year ago Reply

Getting stuck on step 5. Do i have to set my router to forward


port 8081 in order for the stream to be seen on the
webpage? This is what the page looks like right now.
(http://cdn.instructables.com/F48/FZIL/I7QPQSP4/F48FZILI7QPQSP4.LARGE.jpg)

HenrikH (/member/HenrikH) 2 years ago Reply

curl
"https://raw.githubusercontent.com/andreafabrizi/Dropbox-
Uploader/master/dropbox_uploader.sh" -o
dropbox_uploader.sh

ssrivastava14 (/member/ssrivastava14) . HenrikH (/member/HenrikH) Reply

a year ago
Yeah_ this was the correction which was to be done,i suppose
(this is what i checked).
I am sharing the screenshot i NOW get while running the .sh file.
The folder name corresponding to the app name i defined whil
following the instructions given in screenshot has been
successfully created but the pictures are still not being
uploaded.
both the .py files are properly indented and i have used
cmd = "/home/pi/Dropbox-Uploader/dropbox_uploader.sh
upload %s %s %s" %(path + file_name," ",path + file_name)
following a comment on this page (below).
any help is appreciated. :)

(http://cdn.instructables.com/FZP/O2HY/I6HSJDYB/FZPO2HYI6HSJDYB.LARGE.jpg)

luipez (/member/luipez) made it!


luipez (/member/luipez) made it! a year ago Reply

Ho seguito la tua guida fino al passo 5, ma ottengo quanto nella immagine


1.png
Il mio router settato cos come vedi nella immagine 2.png
Come mai non mi funziona?
Grazie
______________________________________________________
I followed your guide through step 5, but I get the image in 1.png
My router is set so as you see in the image 2.png

How come I do not work?

Thank You

(http://cdn.instructables.com/FC5/KI5X/I5MD0EIG/FC5KI5XI5MD0EIG.LARGE.jpg)

(http://cdn.instructables.com/FY8/25FU/I5MD0EK0/FY825FUI5MD0EK0.LARGE.jpg)

vidaa (/member/vidaa) a year ago Reply

Wonderfull! :-) I don't know if dropbox usage has changed or


if I did not read something correctly but I had trouble with the
shell wanting more info. I finally gave it the name of my
dropbox app and it worked! .... because I had put in "
myapp" it needed the " " then text...
cmd = "/home/pi/dropbox_uploader.sh upload " + path +
files + " " + file_name
the first files are copy _from_ . the second are copy _to_.
I decided that a prefix of something raspberry flavored was
actually a good thing :-)
best to you all
bob

gal-x-e (/member/gal-x-e) a year ago Reply

hi
i just did every thing you said. but it doesn't work.
i have raspberry pi model a, a wifi dongle & MD80 mini
camera, all connected to a usb hub. my uploader file
contains :
import os
path="/tmp/motion/"
def upload_files():
if not os.path.exists(path):
return
os.stdir(path)
for files in os.listdir("."):
if files.endswith(".avi"):
cmd = "/home/pi/dropbox_uploader.sh upload " + path +
files
os.system(cmd)
os.system("sudo rm /tmp/motion/" + files)

if _name_ == "_main_":
upload_files()
any Suggestions?

anggasaputra (/member/anggasaputra) a year ago Reply

still not working on step 7 , please T_T

TimB3 (/member/TimB3) a year ago Reply

Gday,
I have just completed Step 5 and can get the camera to
stream the video, however whenever there is movement
detected the streaming of the video stops. I can get back
onto the streaming eventually. Any ideas where this might be
falling apart?
Thank you in advance!

IvanR1 (/member/IvanR1) a year ago Reply

Thanks for this useful article!


If it's not working with the RasPi Cam (no /dev/video0) try:
sudo modprobe bcm2835-v4l2
and /dev/video0 should be there; then restart motion.

pengocha (/member/pengocha) 2 years ago Reply

My house got broken into last week so this got me to this


tutorial.
I'm the owner of a pi but not that experienced in
programming, all that i've done so far is running xbmc and
stu like that...
The tutorial seems pretty clear to me to construct but i have
some questions before i run to the store for a new sd
card&pi cam (replacing tv/laptop etc costs me enough
already :( ).
1) does the script auto start when turning on the pi and if
not how can i accomplish this?
2) when motion is detected is it possible to have a 60sec
delay before posting to dropbox and further actions?
3) when motion is detected how can i let the pi play a mp3
sound over the audio jack in an attempt to scare the
intruder?
4) when motion is detected can the pi contact me on my
smartphone over facebook
messenger/twitter/sms/mail/whatsapp and or others...?

mailto (/member/mailto) . pengocha (/member/pengocha) 2 years ago Reply


1) It should because of the file /etc/init.d/motion, but in case it doesn't...
Just edit rc.local file: sudo nano /etc/rc.local
And add these 2 lines before the exit statement:
# Start motion
motion

2) Modify the file uploader.py: sudo nano uploader.py


And add this line before "upload_files()": os.system(sleep 60)
3) First install a command line mp3 player: sudo apt-get -y install
mpg321
Then add this to /etc/motion/motion.conf: On_picture_save mpg321
whatever.mp3
4) To create a script file that sends emails using Gmail, check this link:
http://iqjar.com/jar/sending-emails-from-the-raspberry-pi/
(http://iqjar.com/jar/sending-emails-from-the-raspberry-pi/)
Then add this to /etc/motion/motion.conf: On_picture_save
send_email.sh
Hope it helps!

pengocha (/member/pengocha) . mailto (/member/mailto) 2 years ago Reply

wow, didn't expect that much detail. Thank you so much for that ! I'm
ordering the parts and will let you know !

StudioDubio (/member/StudioDubio) 2 years ago Reply

I've tested with the MD80 mini camera but it RPI doesn't
recognize it? Please help!

zolore (/member/zolore) 2 years ago Reply

Hi. Small typo above. The closing HTML tag is missing the /.
The code should be:
<html>
<body>
<h1> Raspberry Pi DropBox Camera Stream </h1>
<img src="http://Raspberry pi's IP:8081">
</body>
</html>

TheK1D (/member/TheK1D)

Help! i use the sudo python picamstreamer.py and sudo 2 years ago Reply

python picamstills-db.py but it keeps on shutting down my


pi.

TheK1D (/member/TheK1D) 2 years ago Reply

I used sudo apt-get install Motion instead of sudo apt-


get install motion that was silly of me...

traklikitporn (/member/traklikitporn) 2 years ago Reply

sudo service motion restart << for start motion

traklikitporn (/member/traklikitporn) 2 years ago Reply

sudo apt-get install motion << it's work for me

eccentricdyslexic (/member/eccentricdyslexic) 2 years ago Reply

Am I correct in thinking with dropbox uploader you have to


specify the destination folder as well as the local location
nowadays?

eccentricdyslexic (/member/eccentricdyslexic) . eccentricdyslexic


(/member/eccentricdyslexic) 2 years ago Reply

This works-
cmd = "/home/pi/Dropbox-
Uploader/dropbox_uploader.sh upload %s %s %s" %
(path + file_name," ",path + file_name)

tmv22 (/member/tmv22) 2 years ago Reply

uploader.py is not working. i get this error message


"Uploaded

Traceback (most recent call last):


File "/home/pi/uploader.py", line 15, in <module>
upload_files()
File "/home/pi/uploader.py", line 12, in upload_files
os.remove(path + file_name)
OSError: [Errno 13] Permission denied: '/tmp/motion/01-
20140316154001.avi'"

tmv22 (/member/tmv22) 2 years ago Reply

i followed all the steps! everything worked EXCEPT step 8.


when login to my dropbox, the folder is empty. what went
wrong?

8 nochanceinhell3856 (/member/nochanceinhell3856) (author) . tmv22


(/member/tmv22) 2 years ago Reply

Hmmmm I know I had trouble with the dropbox


upload at first. Did everything else seem to go well? Is
the basic web page streaming the image? Did you get
any errors when running through Step 6? I have to
update Step 7 but I believe the code in the image is
correct and the code in the text of step 7 is not.
Python is also indent driven so all of the indents needs
to be correct.
When it works properly, in your dropbox home folder
you will see a folder called Apps. and your videos will
be in there.
tmv22 (/member/tmv22) . nochanceinhell3856 (/member/nochanceinhell3856)
2 years ago Reply
everything is working EXCEPT:
1- i dont see anything in my dropbox APPs. i see the
files in tmp/motion though
2- the old files are not being deleted every hour as you
mentioned

basic web page streamed the image good. in step 5,


your forgot / for <html> but its ok!
no errors during step 6
in step 7, i have everything same as your image. with
indentation using TAB on my keyboard.
thanks for your help! i know everyone appreciates your
hard work

(http://cdn.instructables.com/FDQ/4ACY/HS3GV5FL/FDQ4ACYHS3GV5FL.LARGE.gif)

8 nochanceinhell3856 (/member/nochanceinhell3856) (author) . tmv22


(/member/tmv22) 2 years ago Reply

I need to think about why the temp directory isnt


clearing out every hour.
But for the Uploader, I think I see the issue stopping
the uploader from running.
See the image below, but i think you you make change
files_name to file_name to match the other references.
This should correct the uploader issue.
(http://cdn.instructables.com/FD2/IS7L/HS5Q8PFQ/FD2IS7LHS5Q8PFQ.LARGE.jpg)

tmv22 (/member/tmv22) . nochanceinhell3856 (/member/nochanceinhell3856)


2 years ago Reply

yes, i made changes as you mentioned but still not working. can you
share image of your uploader.py and cleartmp.py

8 nochanceinhell3856 (/member/nochanceinhell3856) (author) . tmv22


(/member/tmv22) 2 years ago Reply

I am not currently at staying at my house (part of the


reason I set this camera up) but I will try to stop by
and get these screen shots this weekend.

tmv22 (/member/tmv22) . nochanceinhell3856 (/member/nochanceinhell3856)


2 years ago Reply
oh yes please post image of your 2 python script!
also, do those 2 script automatically start doing the
upload? meaning, if i boot up the raspberry pi, motion
auto start...but what about the python scripts?

Guy_Moquet (/member/Guy_Moquet) 2 years ago Reply

Thanks - really useful.


Being very new to Python I got stuck at step 7 - I can't get
the code uploader.py to work. I noticed that the code in the
picture is slightly dierent from the text. Which one is the
correct version to use? Thanks
8 nochanceinhell3856 (/member/nochanceinhell3856) (author) . Guy_Moquet
(/member/Guy_Moquet) 2 years ago Reply

Sorry about the confusion. I believe that the Picture is


the correct code because that's a screen shot from
my running program. Unfortunately, I am away from
my home for the last few weeks and cant double
check the running system but I believe the code in the
picture is correct.

camblonie (/member/camblonie)

"Now follow the instructions in the README.txt file in order 2 years ago Reply
to link the Raspberry Pi to your DropBox account using
OAuth."
Could you link to this txt file please?
I had to download an updated driver for my camera from
one of your links but I dont know where i should be
unzipping it. I put it in the home folder but thats not
working.

Thanks for the instructable!

8 nochanceinhell3856 (/member/nochanceinhell3856) (author) . camblonie


(/member/camblonie) 2 years ago Reply

Sorry I realized I messed up step 6. I have updated it.


See my post above.

X mikestevens! (/member/mikestevens!) 2 years ago Reply


8
I second the OAuth command and readme.txt file. I have the
camera displaying a video feed that is extremely laggy (3 to
5 seconds delay time). Is this an issue still once you are
motion capturing and sending the video to dropbox?

8 nochanceinhell3856 (/member/nochanceinhell3856) (author) . mikestevens!


(/member/mikestevens!) 2 years ago Reply
After looking at these comments I realized that I
messed up step 6 and have updated it (See my post
above)
As for the extremely lag, that is actually going to be
common for this setup. This is meant to be used for a
home security type of setup where you can pop in
from your cell phone or work computer to see what is
going on in the house or in the case of something
horrible (like a break in) you can hopefully have a
picture of the bad person in your dropbox account. I
think the lag is because what the Motion software is
doing is taking a snapshot or still picture a few times
each second (you can change this setting in the config
file for motion). If you are looking to reduce the lag you

could try dropping the image quality (also in the config


for motion) or even update the frames per second. If
that doesnt work, there may be another setup that
may suit your needs.
I hope this helps.

8 nochanceinhell3856 (/member/nochanceinhell3856) (author) 2 years ago Reply

I am sorry about the confusion. I see that i messed up a bit


on Step 6. I have updated it but I will also put it here
What I should have said is:
Now run the script and follow its instructions
./dropbox_uploader.sh
The readme.txt file really just gives the same information I
gave above but here is the link to the readme.txt
https://github.com/andreafabrizi/Dropbox-
Uploader/blob/master/README.md
(https://github.com/andreafabrizi/Dropbox-
Uploader/blob/master/README.md)
I am still very new to working with linux and the command
prompt.
I just unzipped the files to my home directory.
I hope this helps
FEATURED CHANNELS

Home Repair Newsletter Knitting


(/tag/type- Survival Breakfast Minecraft (/tag/type- USB Comics
Join 2 million + to receive instant
id/category- (/tag/type- (/tag/type- (/tag/type- id/category- (/tag/type- (/tag/type-
inspiration in your inbox.
workshop/channel- id/category- id/category- id/category- craft/channel- id/category- id/category- Winter Drinks
home- outside/channel-
enter email food/channel-
I'm in! play/channel- knitting-and- technology/channel-
costumes/channel- (/id/Holiday- Weddings
improvement/) survival/) breakfast/) minecraft/) crocheting/) usb/) comics/) Drinks/) (/howto/weddings/)
Mobile
Download our apps!

Android (https://play.google.com/store/apps/details?id=com.adsk.instructables)
iOS (https://itunes.apple.com/app/instructables/id586765571)
Windows (http://apps.microsoft.com/windows/en-us/app/7afc8194-c771-441a-9590-54250d6a8300)
About Us Find Us
Who We Are (/about/) Facebook (http://www.facebook.com/instructables)
Advertise (/advertise/) Youtube (http://www.youtube.com/user/instructablestv)
Contact (/about/contact.jsp) Twitter (http://www.twitter.com/instructables)
Jobs (/community/Positions-available-at-Instructables/)
Pinterest (http://www.pinterest.com/instructables)
Help (/id/how-to-write-a-great-instructable/)
Google+ (https://plus.google.com/+instructables)
Tumblr (http://instructables.tumblr.com)
Resources
For Teachers (/teachers/)
Artists in Residence (/air)
Gift Pro Account (/account/give?sourcea=footer)
Forums (/community/)
Answers (/tag/type-question/?sort=RECENT)
Sitemap (/sitemap/)

Terms of Service (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |


Privacy Statement (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |
Legal Notices & Trademarks (http://usa.autodesk.com/legal-notices-trademarks/) | Mobile Site (http://m.instructables.com)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
2015 Autodesk, Inc.

Das könnte Ihnen auch gefallen