Raspberry Pi with camera module - User Guide


Thing+ Integragtion Guide for Raspberry Pi

  1. Environment Setting
  2. Install Thing+ Embedded Package
  3. Integration with dropbox
  4. Gatway Registration

This guide will be explain for IOT with Raspberry Pi and Camera module. A Photo is a part of privacy. So in this guide, We will use private storage as the dropbox. Before you try to do as this guide. you must have account for dropbox.


1. Environment Setting

0) Go to shop to buy the Raspberry Pi Camera Module

1) Micro SD card(8GB+ storage) is required.

2) Download Raspbian image from below link.

  • In case of RaspberryPi 2
    • Raspbian Image Download Link - Raspbian Image
    • We recommend 2015-09-24-RASPBIAN JESSIE version one.
  • In case of RaspberryPi 3
    • Raspbian Image Download Link - Raspbian Image
    • We recommend 2016-05-27-RASPBIAN JESSIE version one.

3) Intall OS on the micro SD card with the donwloaded image. Please refer the below link for more deails about the OS installation.

  • It can take few minutes to install the Raspbian image to the Micro SD card
  • https://www.raspberrypi.org/documentation/installation/installing-images/

4) Telnet/SSH Client is required for controlling the Raspberry Pi from your PC.

  • If you are a Mac or Linux user, please use the default terminal utility.
  • If you are a Windows user, we recommend that you use the “Putty” client to access your Raspberry Pi.
  • Putty Download link - http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe

5) Insert the Micro SD card into the Micro SD card slot of the back panel of your Raspberry Pi. Raspberry Pi + Micro SD card

6) Connect Ethernet(LAN cable), and Power Cable to Raspberry Pi.

For stable Power supply, we recommend that you connect the power cable not USB hub.If the power supply is unstable, the file resource can be broken.

Raspberry Pi + Ethernet & power cable

7) Please wait your Raspberry Pi is booted up completely, and then Connect to it by using SSH Client(for Windows, the Putty)

  • When you can NOT get the IP Address of your device, please refer the Troubleshooting section.

  • ID: pi
  • Password: raspberry

    $ ssh pi@<IP Address>
    pi@<IP Address>'s password: raspberry
    
  • Example for Mac & Linux

    $ ssh pi@192.168.1.XXX
    pi@<IP Address>'s password: raspberry
    
  • Example for Windows

    • Run the putty, and Insert your IP Address, and then, Click the button Open and Enter a password. Raspberry Pi putty login Raspberry Pi putty login

Notice: In case of Windows, you have to re-launch putty, when Raspberry Pi is rebooted.

8) Update time of Raspberry Pi.

  • While installing an application, please Enter y for installation questions.

    @Pi:$ sudo su
    @Pi:$ apt-get update
    @Pi:$ apt-get install -y --force-yes ntp ntpdate
    @Pi:$ ntpdate -u ntp.ubuntu.com
    
  • If you failed to update the time, Update it directly.

    • UTC Time zone (Link): ex) 2015/01/01 00:00:00 => 2015-01-01 00:00:00

      @Pi:$ date --set '20XX-XX-XX XX:XX:XX'
      

9) To distinguish your Raspberry Pi, you need to modify the hostname of it.

Notice: You MUST use arrow buttons on your keyboard, when you want to move a cursor

  • Modify /etc/hostname.

    @Pi:$ sudo nano /etc/hostname
    
  • Change the raspberrypi in the file to your own name(letter, number and hyphen(-) allowed only) like the below image. Raspberry Pi Modify hostname

    • Press CTRL-O and press ENTER to save the changes and press CTRL-X to close the current file you opened and modified.
  • Modify /etc/hosts.

    @Pi:$ sudo nano /etc/hosts
    
  • Change the raspberrypi in the file to the same name you changed at before step. Raspberry Pi Modify hosts

    • Press CTRL-O and press ENTER to save the changes and press CTRL-X to close the current file you opened and modified.
  • To apply your modification, please reboot your Raspberry Pi.

    @Pi:$ sudo reboot
    

10) Re-connect to your Raspberry Pi. (Refer #7 step)

11) For configration of Environments for Raspberry, Run the raspi-config

@Pi:$ sudo su
@Pi:$ raspi-config
  • To use micro SD card which has storage bigger than 4GB, Choose 1. Expand Filesystem. Raspberry Pi + Grove Pi

  • To Use Camera module, Choose 5. Enable Camera Raspberry Pi Setting Enable camera Raspberry Pi Setting confirm

  • Press Tab key on your keyboard and choose Finish, and then please Select Yes for the question about Rebooting the device. Raspberry Pi Choose Finish Raspberry Pi Choose Finish


2. Install Thing+ Embedded Package

1) Connect Camera module on Raspberry Pi

Raspberry Pi + Camera

Raspberry Pi + Camera

2) Connect Ethernet(LAN cable), and Power Cable to Raspberry Pi.

3) Connect to your Raspberry Pi.

4) Download a install script file.

@Pi:$ wget http://support.thingplus.net/download/install/thingplus_embedded_sdk_pi_install.sh

5) Grant a run permission to the script you downloaded and Install the Thing+ Embedded Package.

  • It can take few minutes to install the Thing+ Embedded Package.

    @Pi:$ sudo su
    @Pi:$ chmod 755 thingplus_embedded_sdk_pi_install.sh
    @Pi:$ ./thingplus_embedded_sdk_pi_install.sh
    

6) Reboot Raspberry Pi

@Pi:$ sudo reboot

3. Integration with dropbox

To interation with dropbox, please set up as the following.

1) Create app key

@Pi:$ cd /usr/local/bin
@Pi:$ ./dropbox_uploader.sh
  • Create app key as the following. uploader.sh

  • Connect dropbox and lon-in
  • Press Create App button. dropbox

  • Press Create app after input some configration factor. dropbox config

  • app key and app secret is created dropbox key

  • Authorization through OAth. please input the created app key and app secrete

    # App key: xxxxxxxx 
    # App secret: yyyyyyyy
        
    Permission type:
    App folder [a]: If you choose that the app only needs access to files it creates
    Full Dropbox [f]: If you choose that the app needs access to files already on Dropbox
        
    # Permission type [a/f]: a
    
    > App key is xxxxxxxx, App secret is yyyyyyyy and Access level is App Folder. Looks ok? [y/n]: y
    > Token request... OK
    
    Please open the following URL in your browser, and allow Dropbox Uploader
    to access your DropBox folder:
    
    --> https://www.dropbox.com/1/oauth/authorize?oauth_token=zzzzxxxxyyyy
    
    Press enter when done...
    
  • Confirm OAuth Ahthorization prompt dropbox
    dropbox

3. Gateway Registration

Plesase refer Gateway Registration