Introduction: Connecting Arduino With Temboo and Read Email

About: I am a hardcore IoT developer, i develop IoT based projects as a hobbyist as well as professionally as my source of earning. Software part such as Android Apps or Website and Hardware both are designed by me. …

Hiii,

I am Pranav Sharma this is my 2nd instructable and Today I will Show How to connect your Arduino Board to Temboo and Read Emails coming from your Gmail Account.

THINGS WE NEED
1) Arduino Uno (or Any other Board will Work Fine)
2) Ethernet Shield
3) Gmail Account
4) Temboo Account

NOTE : There are Pictures posted with every Step giving you a visual description, you can refer to those also, it will help you to understand, what is happening at each step, or after every click.

Step 1: Creating Accounts

Step1) You'll need a Google account If you don't already have one, you can sign up here.

and a TEMBOO Account for Sign Up click here.

Step 2: Creating a Project

Click on this Link GOOGLE DEVELOPER to Create your Google App which will

Allow you to Read Emails and provide you many other services, by assigning you
a Client ID and a Client Secret

Ø Click on Create Project

Ø Name your Project (No need to Alter ProjectID)

Ø Click on APIs & Auth.

Ø Now under APIs we can select the Required APIs to Enable, but in this Instructable we are
Concentrating on Reading Email from Google Account, so we will Enable the GMAIL API.

Ø Todo the same , we will Select GMAIL API under Google Apps APIs and then Click on Enable API.

Ø Under API & Auth click on CREDENTIALS.

Ø Hit Create a new Client ID, Select WEB APPLICATIONS as the " Application Type " and hit Configure Consent Screen.

Ø Fill up all the Necessary Information and Save it.
Now it will provide you Some Important Credentials i.e ClientID, ClientSecret .

Ø Do one Change here… Click on EDIT SETTINGS
and Edit Authorized redirect URIs and copy this

https://{Your Temboo Account Name}.temboolive.com/callback/google

In brackets write your temboo user name, like I had wrote this

https://pranavinstructable.temboolive.com/callback...

And then click UPDATE.

Ø You can Check those under CREDENTIALS, be Sure not to CLOSE this TAB
because we will be Copying Info from this Page Later.

Step 3: IntialAuthorization

  • Goto TEMBOO HOMEPAGE and than hit on LIBRARY
  • Expand GOOGLE choreo by clicking on the ARROW Ahead Google.
    (Be sure to just Click the ARROW, Do Not Click on the NAME).
  • Than Expand “OAuth” by Clicking the Arrow Ahead of It.
  • After that Select “ InitialAuth ” (open it in a NEW Tab).

" Now we will Initialize our App and Here we will Also mention The services we will be using in the Scope block."

Now the first thing todo is to Select your Board and the Ethernet Shield .

No need to Select Shield for Arduino Yun, because it has Built-In Shield.

HERE we have two Blocks to Fill info in

1) Client ID – Goto to the Google Developer Page where we had just Created an APP and Copy the
Client ID provided there

2) SCOPE – On the InitialAuth page Scroll Down there you will find Various Scopes , these Scopes are
Basically the Services provided , you can choose the Service you want, just Copy that
above in the Scope Block, use Spaces in between for more than one Scope we will be using
the Gmail Inbox Feed scope used to read an Email on your Gmail Account.

Save your Profile by clicking SAVE PROFILE this will save your time by Auto-Filling the Info next time you use it.

Copy and paste the scope Above and Hit " RUN "

This will generate two things
1) AuthorizationURL
2) CallBackID
we will be needing both in the NEXT STEP.


Step 4: FinalAuth

Granting Access To temboo of your Google Application and Generating an Access Token

  • Follow the Instructions Generated in the Output, and Open that Link in a new TAB
  • Now Google will Ask for your permission, Click on ACCEPT.
  • Now if a Blank Page Shows Up, than it means Everything is Fine till Now and Temboo Have the rights to Read your Emails through your Created APP.

Output from the InitialAuth as Shown in the Image , will be used in FinalAuth Page

Goto FinaAuth page by clicking on the Link in the Output, there you will find 3 blocks to fill

1) Client ID ---- Provided on The Google’s App Developer page

2) Client Secret ---- Also on the Google’s App Developer page

3) CallBackID ---- Copy it from the InitialAuth page

Now hit “RUN”

It will generate a Access Token for the user that has granted access to your application, which we will be
using in our Final Step

Step 5: Generating Code for Arduino to Receive LatestUnreadEmail

Open a New tab... and Goto TEMBOO HOMEPAGE

Here on the left side goto Google Choreo and then Expand it like..

Google => Gmail => GetLatestUnreadEmail

After Selecting that a Page will Come, where We nedd to Fill 3 Blocks

1) ClientID Copy it From Google’s App Page

2) Clientsecret Copy it From Google’s App Page

3) Refreshtoken Generated on FinalAuth page, Copy it from there

NOW HIT RUN

The Code will be generated to be used in Arduino IDE

Now you can Simply Copy The Code in The Arduino IDE, But Before Uploading The Code be sure to Copy the “HEADER FILE” shown after the Code in a “NEW TAB”.
This Header File has your Credentials for the Gmail Account and The App Created by you.

Step 6: Running the Code in Arduino

Now Open Arduino IDE (Version 1.0 or Later) and just Copy paste The generated Code
and after that Open a NEW TAB, name the TAB as TembooAccount.h and Copy The Header File there.

now hit the Upload Button, and you are done
NOW YOU SHOULD BE ABLE TO READ ALL LATEST UNREAD EMAIL ON YOUR SERIAL MONITOR.

if you liked my Instructable and it helped you, Than do comment below, and make it one of your Favourite
Appreciation for your always makes Happy and Encourage. :-)

If having any Queries feel free to ask in the comments below or you can e-mail me at iot.pranav@yahoo.in