Skip to content

Commit cb29f48

Browse files
author
Federico Fissore
committed
Bridge: Temboo examples update. Released version 1.0.7
1 parent 2e2e2f7 commit cb29f48

File tree

3 files changed

+88
-34
lines changed

3 files changed

+88
-34
lines changed

libraries/Bridge/examples/Temboo/SendAnEmail/SendAnEmail.ino

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,44 @@
33
44
Demonstrates sending an email via a Google Gmail account using Temboo from an Arduino Yún.
55
6-
Check out the latest Arduino & Temboo examples and support docs at http://www.temboo.com/arduino
6+
Check out the latest Arduino & Temboo examples and tutorials at http://www.temboo.com/arduino
77
88
A Temboo account and application key are necessary to run all Temboo examples.
99
If you don't already have one, you can register for a free Temboo account at
1010
http://www.temboo.com
1111
12-
Since this sketch uses Gmail to send the email, you'll also need a valid
13-
Google Gmail account. The sketch needs the username and password you use
14-
to log into your Gmail account - substitute the placeholders below for these values.
12+
Instructions:
13+
14+
1. Create a Temboo account: http://www.temboo.com
15+
16+
2. Retrieve your Temboo application details: http://www.temboo.com/account/applications
17+
18+
3. Replace the values in the TembooAccount.h tab with your Temboo application details
19+
20+
4. You'll also need a Gmail account. Update the placeholder Gmail address in the code
21+
below with your own details.
22+
23+
https://www.gmail.com
24+
25+
5. Once you have a Gmail account, turn on 2-step authentication, and create an application-specific
26+
password to allow Temboo to access your Google account: https://www.google.com/landing/2step/.
27+
28+
6. After you've enabled 2-Step authentication, you'll need to create an App Password:
29+
https://security.google.com/settings/security/apppasswords
30+
31+
7. In the "Select app" dropdown menu, choose "Other", and give your app a name (e.g., TembooApp).
32+
33+
8. Click "Generate". You'll be given a 16-digit passcode that can be used to access your Google Account from Temboo.
34+
35+
9. Copy and paste this password into the code below, updating the GMAIL_APP_PASSWORD variable
36+
37+
10. Upload the sketch to your Arduino Yún and open the serial monitor
38+
39+
NOTE: You can test this Choreo and find the latest instructions on our website:
40+
https://temboo.com/library/Library/Google/Gmail/SendEmail
41+
42+
You can also find an in-depth version of this example here:
43+
https://temboo.com/arduino/yun/send-an-email
1544
1645
This example assumes basic familiarity with Arduino sketches, and that your Yún is connected
1746
to the Internet.
@@ -34,8 +63,8 @@
3463
// your Gmail username, formatted as a complete email address, eg "[email protected]"
3564
const String GMAIL_USER_NAME = "xxxxxxxxxx";
3665

37-
// your Gmail password
38-
const String GMAIL_PASSWORD = "xxxxxxxxxx";
66+
// your application specific password (see instructions above)
67+
const String GMAIL_APP_PASSWORD = "xxxxxxxxxx";
3968

4069
// the email address you want to send the email to, eg "[email protected]"
4170
const String TO_EMAIL_ADDRESS = "xxxxxxxxxx";
@@ -82,8 +111,8 @@ void loop()
82111

83112
// the first input is your Gmail email address.
84113
SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
85-
// next is your Gmail password.
86-
SendEmailChoreo.addInput("Password", GMAIL_PASSWORD);
114+
// next is your application specific password
115+
SendEmailChoreo.addInput("Password", GMAIL_APP_PASSWORD);
87116
// who to send the email to
88117
SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
89118
// then a subject line

libraries/Bridge/examples/Temboo/SendDataToGoogleSpreadsheet/SendDataToGoogleSpreadsheet.ino

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,49 @@
33
44
Demonstrates appending a row of data to a Google spreadsheet using Temboo from an Arduino Yún.
55
6-
Check out the latest Arduino & Temboo examples and support docs at http://www.temboo.com/arduino
6+
Check out the latest Arduino & Temboo examples and tutorials at http://www.temboo.com/arduino
77
88
A Temboo account and application key are necessary to run all Temboo examples.
99
If you don't already have one, you can register for a free Temboo account at
1010
http://www.temboo.com
1111
12-
Since this sketch uses a Google spreadsheet, you'll also need a
13-
Google account: substitute the placeholders below for your Google account values.
14-
15-
This example assumes basic familiarity with Arduino sketches, and that your
16-
Yún is connected to the Internet.
17-
18-
The columns in your spreadsheet must have labels for the Choreo to
19-
work properly. It doesn't matter what the column labels actually are,
20-
but there must be text in the first row of each column. This example
21-
assumes there are two columns. The first column is the time (in milliseconds)
22-
that the row was appended, and the second column is a sensor value.
23-
In other words, your spreadsheet should look like:
12+
Instructions:
13+
14+
1. Create a Temboo account: http://www.temboo.com
15+
16+
2. Retrieve your Temboo application details: http://www.temboo.com/account/applications
17+
18+
3. Replace the values in the TembooAccount.h tab with your Temboo application details
2419
25-
Time | Sensor Value |
26-
------+-----------------
27-
| |
20+
4. You'll also need a Google Spreadsheet that includes a title in the first row
21+
of each column that data will be written to. This example assumes there are two columns.
22+
The first column is the time (in milliseconds) that the row was appended, and the second
23+
column is a sensor value. In other words, your spreadsheet should look like:
2824
29-
NOTE that the first time you run this sketch, you may receive a warning from
30-
Google, prompting you to authorize access from a 3rd party system.
25+
Time | Sensor Value |
26+
------+-----------------
27+
| |
28+
29+
5. Google Spreadsheets requires you to authenticate via OAuth. Follow the steps
30+
in the link below to find your ClientID, ClientSecret, and RefreshToken, and then
31+
use those values to overwrite the placeholders in the code below.
32+
33+
https://temboo.com/library/Library/Google/OAuth/
34+
35+
For the scope field, you need to use: https://spreadsheets.google.com/feeds/
36+
37+
Here's a video outlines how Temboo helps with the OAuth process:
38+
39+
https://www.temboo.com/videos#oauthchoreos
40+
41+
And here's a more in-depth version of this example on our website:
42+
43+
https://temboo.com/arduino/yun/update-google-spreadsheet
44+
45+
6. Next, upload the sketch to your Arduino Yún and open the serial monitor
46+
47+
Note: you can test this Choreo and find the latest instructions on our website:
48+
https://temboo.com/library/Library/Google/Spreadsheets/AppendRow/
3149
3250
Looking for another API to use with your Arduino Yún? We've got over 100 in our Library!
3351
@@ -46,8 +64,14 @@
4664
// Note that for additional security and reusability, you could
4765
// use #define statements to specify these values in a .h file.
4866

49-
const String GOOGLE_USERNAME = "your-google-username";
50-
const String GOOGLE_PASSWORD = "your-google-password";
67+
// the clientID found in Google's Developer Console under APIs & Auth > Credentials
68+
const String CLIENT_ID = "your-client-id";
69+
70+
// the clientSecret found in Google's Developer Console under APIs & Auth > Credentials
71+
const String CLIENT_SECRET = "your-client-secret";
72+
73+
// returned after running FinalizeOAuth
74+
const String REFRESH_TOKEN = "your-oauth-refresh-token";
5175

5276
// the title of the spreadsheet you want to send data to
5377
// (Note that this must actually be the title of a Google spreadsheet
@@ -112,11 +136,12 @@ void loop()
112136
// see https://www.temboo.com/library/Library/Google/Spreadsheets/AppendRow/
113137
// for complete details about the inputs for this Choreo
114138

115-
// your Google username (usually your email address)
116-
AppendRowChoreo.addInput("Username", GOOGLE_USERNAME);
117-
118-
// your Google account password
119-
AppendRowChoreo.addInput("Password", GOOGLE_PASSWORD);
139+
// your Google application client ID
140+
AppendRowChoreo.addInput("ClientID", CLIENT_ID);
141+
// your Google application client secert
142+
AppendRowChoreo.addInput("ClientSecret", CLIENT_SECRET);
143+
// your Google OAuth refresh token
144+
AppendRowChoreo.addInput("RefreshToken", REFRESH_TOKEN);
120145

121146
// the title of the spreadsheet you want to append to
122147
// NOTE: substitute your own value, retaining the "SpreadsheetTitle:" prefix.

libraries/Bridge/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Bridge
2-
version=1.0.6
2+
version=1.0.7
33
author=Arduino
44
maintainer=Arduino <[email protected]>
55
sentence=Enables the communication between the Linux processor and the AVR. For Arduino Yún and TRE only.

0 commit comments

Comments
 (0)