Page 1 of 1

How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Tue Oct 30, 2012 5:11 pm
by chteuchteu
Hello !

I has been searching all the week about how to use Dropbox on the Raspberry Pi. Actually, there isn't any officiel RaspberryPi - compatible client... (because of the ARM architecture).

So I created an article (writting in French, sorry) about how to get Dropbox on your Raspberry. There are only two solutions:
- Owncloud 4.5 (but it does not download the files on the SD card or any external drive, just make it accessible from the web interface)
- Bash Dropbox Uploader

Here is the entire article.
Please say it if you have any other way to use Dropbox on the Raspberry ! (or even any other way to sync files between two folders, excluding FTP, SFTP, ...)

Thanks ! :)

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Tue Oct 30, 2012 5:20 pm
by billb
chteuchteu wrote:Please say it if you have any other way to use Dropbox on the Raspberry !
http://mitchtech.net/dropbox-on-raspberry-pi-via-sshfs/
(This method requires a machine running Dropbox that is accessible to the Pi via SSH)

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Tue Oct 30, 2012 5:31 pm
by MattHawkinsUK
You can also use Python. Dropbox provide a Python SDK.

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Tue Oct 30, 2012 5:38 pm
by chteuchteu
billb wrote:
chteuchteu wrote:Please say it if you have any other way to use Dropbox on the Raspberry !
http://mitchtech.net/dropbox-on-raspberry-pi-via-sshfs/
(This method requires a machine running Dropbox that is accessible to the Pi via SSH)
Yeah I also read that... But I replaced my old server with my Raspberry, so I don't have any computer running Dropbox anymore...

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Tue Oct 30, 2012 7:25 pm
by meltwater
I've tended to use AllwaySync and Dropbox running on a pc and sync the raspberry pi folder shared via the network.

It is crude, but works well enough (and doesn't put the overhead on the Rpi).

A native client would be good though.

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Fri Jan 04, 2013 2:51 am
by dcosmin
Personally, I use a service that allows WebDav access to Dropbox (otixo.com) then: mount the webdav folder on my raspberry pi (davfs2 package is needed) and call a synchronization script from crontab, so the files are saved and sync-ed locally to a hard disk periodically.
Unfortunately the service is free only up to 2 gb monthly transfer, but the advantage is one can add almost any cloud storage account (gdrive, box etc.)

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Sun Jan 06, 2013 7:38 pm
by jurafxp
Hi,
I have found the bash script, which is using DropBox API to download/upload files, maybe it will be interesting to you. Its very easy to setup and use.

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

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Sun Jan 06, 2013 9:06 pm
by chteuchteu
Yes, this is one of the solutions I've put on the article (http://www.chteuchteu.com/2012/10/30/ra ... a-dropbox/) :)
Thanks anyway!
jurafxp wrote:Hi,
I have found the bash script, which is using DropBox API to download/upload files, maybe it will be interesting to you. Its very easy to setup and use.

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

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Mon Jan 07, 2013 9:57 am
by meltwater
Looks like a good solution, will try to find some time to try it out!

Would be worth featuring in the MagPi if it works well.

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Mon Jan 07, 2013 10:00 am
by advanced
I wrote a small tutorial for beginners to make a shared folder with ssh simulating dropbox. I hope it helps someone :!: http://pikiosk.tumblr.com/post/39853365 ... x-sftp-mac :!:

Image

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Wed Jan 23, 2013 3:17 am
by sheridan0309
The Pi is a perfect platform to leverage cloud storage. No port of the Dropbox client for ARM is currently planned (per the Dropbox website). I suggest logging into Dropbox via web browser and voting for that feature here:

https://www.dropbox.com/votebox/8029/ra ... i-arm-port

You are allowed 6 feature votes per month, so let's get the vote out!

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Wed Jan 23, 2013 3:26 am
by hadi

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Fri Feb 01, 2013 12:23 pm
by vaslabs
Create an app for your dropbox account and use this:
http://vaslabs.blogspot.co.uk/2013/01/a ... rrypi.html
Ideally you can contribute via sourceforge.net, so we can create a much better client for our raspberrys.
Thanks,
Vasilis

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Tue Feb 05, 2013 9:09 am
by RolandG
Hi,
found that "Dropbox Uploader" to access the Dropbox from Raspberry Pi.
http://www.webupd8.org/2013/01/dropbox- ... l-for.html
not tested yet..

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Wed Mar 06, 2013 7:04 pm
by chteuchteu
Interesting link. But those kind of scripts just allows a limited set of functions. Example:
- script.sh -upload file.jpg
- script.sh -downlod 'file.jpg' ./
...

I don't really know if there exists a script allowing to autosync a folder with your Dropbox account... :s

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Sat May 04, 2013 3:19 pm
by bullen
Basically this is the command to upload a file:

$CURL_BIN $CURL_ACCEPT_CERTIFICATES $CURL_PARAMETERS -i --globoff -o "$RESPONSE_FILE" --upload-file "$FILE_SRC" "$API_UPLOAD_URL/$ACCESS_LEVEL/$FILE_DST?
oauth_consumer_key=$APPKEY&
oauth_token=$OAUTH_ACCESS_TOKEN&
oauth_signature_method=PLAINTEXT&
oauth_signature=$APPSECRET%26$OAUTH_ACCESS_TOKEN_SECRET&
oauth_timestamp=$time&
oauth_nonce=$RANDOM"

I will decipher more it later, and share a simpler bash script...

CURL_BIN="curl"
CURL_ACCEPT_CERTIFICATES="-k"
CURL_PARAMETERS="--progress-bar"
CURL_PARAMETERS="-s --show-error"
TMP_DIR="/tmp"
RESPONSE_FILE="$TMP_DIR/du_resp_$RANDOM"

RANDOM = just random int...
FILE_SRC = well, the file...
FILE_DST = on the other end...

API_UPLOAD_URL="https://api-content.dropbox.com/1/files_put"
ACCESS_LEVEL="dropbox"

These I don't know yet where to fetch yet:

APPKEY = This is supplied by you...
APPSECRET = This is supplied by you...

These are tricky:

OAUTH_ACCESS_TOKEN_SECRET=
OAUTH_ACCESS_TOKEN=

Code below, don't know for how long these are valid, if they should be stored or fetched every time:

OAuth is such a tragic moment in web history!

Code: Select all

time=$(utime)
    $CURL_BIN $CURL_ACCEPT_CERTIFICATES -s --show-error --globoff -i -o $RESPONSE_FILE --data "oauth_consumer_key=$APPKEY&oauth_signature_method=PLAINTEXT&oauth_signature=$APPSECRET%26&oauth_timestamp=$time&oauth_nonce=$RANDOM" "$API_REQUEST_TOKEN_URL"
    OAUTH_TOKEN_SECRET=$(sed -n 's/oauth_token_secret=\([a-z A-Z 0-9]*\).*/\1/p' "$RESPONSE_FILE")
    OAUTH_TOKEN=$(sed -n 's/.*oauth_token=\([a-z A-Z 0-9]*\)/\1/p' "$RESPONSE_FILE")

    if [ -n "$OAUTH_TOKEN" -a -n "$OAUTH_TOKEN_SECRET" ]; then
        echo -ne "OK\n"
    else
        echo -ne " FAILED\n\n Please, check your App key and secret...\n\n"
        remove_temp_files
        exit 1
    fi

    while (true); do

        #USER AUTH
        echo -ne "\n Please visit this URL from your Browser, and allow Dropbox Uploader\n"
        echo -ne " to access your DropBox account:\n\n --> ${API_USER_AUTH_URL}?oauth_token=$OAUTH_TOKEN\n"
        echo -ne "\nPress enter when done...\n"
        read

        #API_ACCESS_TOKEN_URL
        echo -ne " > Access Token request... "
        time=$(utime)
        $CURL_BIN $CURL_ACCEPT_CERTIFICATES -s --show-error --globoff -i -o $RESPONSE_FILE --data "oauth_consumer_key=$APPKEY&oauth_token=$OAUTH_TOKEN&oauth_signature_method=PLAINTEXT&oauth_signature=$APPSECRET%26$OAUTH_TOKEN_SECRET&oauth_timestamp=$time&oauth_nonce=$RANDOM" "$API_ACCESS_TOKEN_URL"
        OAUTH_ACCESS_TOKEN_SECRET=$(sed -n 's/oauth_token_secret=\([a-z A-Z 0-9]*\)&.*/\1/p' "$RESPONSE_FILE")
        OAUTH_ACCESS_TOKEN=$(sed -n 's/.*oauth_token=\([a-z A-Z 0-9]*\)&.*/\1/p' "$RESPONSE_FILE")

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Thu May 30, 2013 8:16 pm
by dkylep
Java!!

Write a java program and use the dropbox sdk
https://www.dropbox.com/developers/core/sdk

Here is a good example using the dropbox java sdk
http://aaka.sh/patel/2011/12/20/authent ... -java-api/

I had to install java 7 on the Pi for it to compile properly. I had errors with 6.

I currently modify a text file on the Pi and every 15 minutes I upload the file to dropbox.

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Fri Jan 10, 2014 8:18 pm
by hagen
I installed SDK, created app, got app key and secret. I want to use Dropbox-Uploader from https://github.com/andreafabrizi/Dropbox-Uploader with that script:

Code: Select all

import os
path="/tmp/motion/"
def upload_files():
   if not os.path.exists(path):
       return
   dir_list = os.listdir(path)
   first_10 = dir_list[:10]
   for file_name in first_10:
       file_full_path = path + file_name
       cmd = "/home/pi/dropbox_uploader.sh upload " + file_full_path
       os.system(cmd)
       os.remove(file_full_path)

if __name__ == "__main__":
    upload_files()
and start it automatically from crontab

Code: Select all

*/5 * * * * python /home/pi/Dropbox_upload.py
But I can not understand how to make dropbox_uploader.sh work properly. Do I need to set any config for it?

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Tue Jul 15, 2014 7:40 am
by 1987
Hi,

Please check out my Dropbox app on GitHub @ https://github.com/JaredMHall/RaspberryCloud. It's called Raspberry Cloud. It's really simple to use and is fully featured.

You can download entire directories as zip files, view thumbnails, edit files directly in your local editor (nano, vim, emacs : P) without having to download and reupload, list files, make new directories, execute bash scripts and commands, and a whole lot more, all from within the app.

Also I wrote it as a console app with speed in mind so it performs great on the Raspberry Pi.

If like it, please leave me some feedback on my blog at http://blog.jaredmhall.com or by email at hall.jared.m@gmail.com

Thanks!

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Sat Nov 01, 2014 9:10 pm
by rocketchef
Hello all,

Many thanks to those who've written code to solve this, very helpful to my project.

Can I make a suggestion for the future? As well as upload / download, I need a script that syncs folders, i.e. list files, check for differences, delete / download as required.

I'm not holding my breath for an ARM version of dropbox, so a basic sync script (even if it wasn't fully featured) would be awesome.

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Thu Mar 05, 2015 4:47 am
by cubeofcheese
When trying to set up dropbox uploader it worked perfectly fine until the authentication in which it failed, telling me to check the api key, etc. even though they were right. Any solutions?

Re: How to use Dropbox on your Raspberry / Utiliser Dropbox

Posted: Wed Jun 03, 2015 3:04 am
by d3vbk
Finally got ownCloud running on my Pi...and did in under an hour. Did it using the apt-get command :D
http://projpi.com/diy-home-projects-wit ... box-clone/