Using SEGGER middleware to access Dropbox
- Connect your application quickly and secure with wellknown Dropbox
- Supports file upload & download
- Supports Dropbox API v2
- Simple to integrate
- Small footprint
- Secure data transmission through TLS encrytion
- No royalties
emDropbox is the easy and secure way to connect your application in the field (device) with your host, located at your factory site via a Dropbox folder.
SEGGER's Dropbox client emDropbox is a software library that allows your application to access easily to a Dropbox account using any TLS stack, like emSSL, and any TCP/IP stack, like emNet, that supports sockets.
This allows your application to share files between different devices or to publish files like updates to your devices using a Dropbox account.
Use cases for emDropbox
Dropbox allows you to synchronize and access files across multiple devices by cloud hosting your files. While Dropbox can be used to synchronize the complete content of an account, selective access to files is possible as well. This can be used to transfer files between multiple endpoints like a number of devices in the field (Clients) and a central management instance (Host).
Dropbox access in this example allows the host to publish files like firmware updates or control instructions to the clients by storing them in your Dropbox account. The clients can then fetch these files at any time they are available without the need for the host to be available at the same time.
In the same manner the clients are able to store files like log output onto the account that can be fetched by the host at any desired time without the clients being online all the time.
The SEGGER emDropbox evaluation package
A free Windows executable is available for evaluation purposes. It allows you to access your own Dropbox account and to execute commands like list files, rename, delete, upload/download of files from/to your Dropbox account.
The tool comes without any warranty and in binary form only. For a source code version, please contact us.
Getting started with the SEGGER emDropbox evaluation
The following is a step-by-step guide showing you the preparations necessary to use a third-party Dropbox application with your Dropbox account. These steps are common for unofficial applications using the Dropbox API to access your account and are required to restrict access to your account to what you permit.
To evaluate emDropbox you need a Dropbox account. If you do not already have an account you can register a free personal account here (https://www.dropbox.com).
Registering the third-party application with your Dropbox account
To grant the sample application access to your Dropbox account you need to supply it with an access token. For this please visit the following Dropbox developers page (https://www.dropbox.com/developers/apps) while you are logged in into your Dropbox account. Click the Create app button to register a new application.
You will be asked three questions about the application:
- 1. Choose an API
Select "Dropbox API".
- 2. Choose the type of access you need
You can grant the application full access to your Dropbox or access to a folder with the applications name only. emDropbox works with both.
- 3. Name your app
Use whatever name you would like to use. Note, there are some restrictions like not having "Dropbox" in the name.
Generating the access token
On the next page after clicking the "Create app" button you will be able to generate an "OAuth 2" access token. Please click the "Generate" button to create the token.
The token is based on your current login credentials and gets invalid once you change your credentials. You will therefore have to re-generate it if you change your password.
Using the access token with emDropbox
Using the access token with emDropbox Setting up the access token for use with the Dropbox sample can be done in two ways.
Using the "token" command
Start emDropbox and using the command "token xyz" where "xyz" has to be replaced by your access token.
Using the startup.cli file
You can enter commands to be executed during startup of emDropbox into the file "startup.cli" that resides in the same folder as emDropbox. You can open the file with your preferred text editor and exchange the "xyz" for your access token, resulting in the "token" command being executed automatically on each start of emDropbox.
emDropbox comes with several commands like listing the directory content, file management and upload/download, that allow you to operate on your Dropbox account.
You should be ale to confirm access to your Dropbox by using the "dir" command to list the contents of your Dropbox.
For a list of commands you can show an online help by executing the command "?".