mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Bridge: Temboo examples update. Released version 1.0.7
This commit is contained in:
@ -3,15 +3,44 @@
|
|||||||
|
|
||||||
Demonstrates sending an email via a Google Gmail account using Temboo from an Arduino Yún.
|
Demonstrates sending an email via a Google Gmail account using Temboo from an Arduino Yún.
|
||||||
|
|
||||||
Check out the latest Arduino & Temboo examples and support docs at http://www.temboo.com/arduino
|
Check out the latest Arduino & Temboo examples and tutorials at http://www.temboo.com/arduino
|
||||||
|
|
||||||
A Temboo account and application key are necessary to run all Temboo examples.
|
A Temboo account and application key are necessary to run all Temboo examples.
|
||||||
If you don't already have one, you can register for a free Temboo account at
|
If you don't already have one, you can register for a free Temboo account at
|
||||||
http://www.temboo.com
|
http://www.temboo.com
|
||||||
|
|
||||||
Since this sketch uses Gmail to send the email, you'll also need a valid
|
Instructions:
|
||||||
Google Gmail account. The sketch needs the username and password you use
|
|
||||||
to log into your Gmail account - substitute the placeholders below for these values.
|
1. Create a Temboo account: http://www.temboo.com
|
||||||
|
|
||||||
|
2. Retrieve your Temboo application details: http://www.temboo.com/account/applications
|
||||||
|
|
||||||
|
3. Replace the values in the TembooAccount.h tab with your Temboo application details
|
||||||
|
|
||||||
|
4. You'll also need a Gmail account. Update the placeholder Gmail address in the code
|
||||||
|
below with your own details.
|
||||||
|
|
||||||
|
https://www.gmail.com
|
||||||
|
|
||||||
|
5. Once you have a Gmail account, turn on 2-step authentication, and create an application-specific
|
||||||
|
password to allow Temboo to access your Google account: https://www.google.com/landing/2step/.
|
||||||
|
|
||||||
|
6. After you've enabled 2-Step authentication, you'll need to create an App Password:
|
||||||
|
https://security.google.com/settings/security/apppasswords
|
||||||
|
|
||||||
|
7. In the "Select app" dropdown menu, choose "Other", and give your app a name (e.g., TembooApp).
|
||||||
|
|
||||||
|
8. Click "Generate". You'll be given a 16-digit passcode that can be used to access your Google Account from Temboo.
|
||||||
|
|
||||||
|
9. Copy and paste this password into the code below, updating the GMAIL_APP_PASSWORD variable
|
||||||
|
|
||||||
|
10. Upload the sketch to your Arduino Yún and open the serial monitor
|
||||||
|
|
||||||
|
NOTE: You can test this Choreo and find the latest instructions on our website:
|
||||||
|
https://temboo.com/library/Library/Google/Gmail/SendEmail
|
||||||
|
|
||||||
|
You can also find an in-depth version of this example here:
|
||||||
|
https://temboo.com/arduino/yun/send-an-email
|
||||||
|
|
||||||
This example assumes basic familiarity with Arduino sketches, and that your Yún is connected
|
This example assumes basic familiarity with Arduino sketches, and that your Yún is connected
|
||||||
to the Internet.
|
to the Internet.
|
||||||
@ -34,8 +63,8 @@
|
|||||||
// your Gmail username, formatted as a complete email address, eg "bob.smith@gmail.com"
|
// your Gmail username, formatted as a complete email address, eg "bob.smith@gmail.com"
|
||||||
const String GMAIL_USER_NAME = "xxxxxxxxxx";
|
const String GMAIL_USER_NAME = "xxxxxxxxxx";
|
||||||
|
|
||||||
// your Gmail password
|
// your application specific password (see instructions above)
|
||||||
const String GMAIL_PASSWORD = "xxxxxxxxxx";
|
const String GMAIL_APP_PASSWORD = "xxxxxxxxxx";
|
||||||
|
|
||||||
// the email address you want to send the email to, eg "jane.doe@temboo.com"
|
// the email address you want to send the email to, eg "jane.doe@temboo.com"
|
||||||
const String TO_EMAIL_ADDRESS = "xxxxxxxxxx";
|
const String TO_EMAIL_ADDRESS = "xxxxxxxxxx";
|
||||||
@ -82,8 +111,8 @@ void loop()
|
|||||||
|
|
||||||
// the first input is your Gmail email address.
|
// the first input is your Gmail email address.
|
||||||
SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
|
SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
|
||||||
// next is your Gmail password.
|
// next is your application specific password
|
||||||
SendEmailChoreo.addInput("Password", GMAIL_PASSWORD);
|
SendEmailChoreo.addInput("Password", GMAIL_APP_PASSWORD);
|
||||||
// who to send the email to
|
// who to send the email to
|
||||||
SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
|
SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
|
||||||
// then a subject line
|
// then a subject line
|
||||||
|
@ -3,31 +3,49 @@
|
|||||||
|
|
||||||
Demonstrates appending a row of data to a Google spreadsheet using Temboo from an Arduino Yún.
|
Demonstrates appending a row of data to a Google spreadsheet using Temboo from an Arduino Yún.
|
||||||
|
|
||||||
Check out the latest Arduino & Temboo examples and support docs at http://www.temboo.com/arduino
|
Check out the latest Arduino & Temboo examples and tutorials at http://www.temboo.com/arduino
|
||||||
|
|
||||||
A Temboo account and application key are necessary to run all Temboo examples.
|
A Temboo account and application key are necessary to run all Temboo examples.
|
||||||
If you don't already have one, you can register for a free Temboo account at
|
If you don't already have one, you can register for a free Temboo account at
|
||||||
http://www.temboo.com
|
http://www.temboo.com
|
||||||
|
|
||||||
Since this sketch uses a Google spreadsheet, you'll also need a
|
Instructions:
|
||||||
Google account: substitute the placeholders below for your Google account values.
|
|
||||||
|
|
||||||
This example assumes basic familiarity with Arduino sketches, and that your
|
1. Create a Temboo account: http://www.temboo.com
|
||||||
Yún is connected to the Internet.
|
|
||||||
|
|
||||||
The columns in your spreadsheet must have labels for the Choreo to
|
2. Retrieve your Temboo application details: http://www.temboo.com/account/applications
|
||||||
work properly. It doesn't matter what the column labels actually are,
|
|
||||||
but there must be text in the first row of each column. This example
|
3. Replace the values in the TembooAccount.h tab with your Temboo application details
|
||||||
assumes there are two columns. The first column is the time (in milliseconds)
|
|
||||||
that the row was appended, and the second column is a sensor value.
|
4. You'll also need a Google Spreadsheet that includes a title in the first row
|
||||||
In other words, your spreadsheet should look like:
|
of each column that data will be written to. This example assumes there are two columns.
|
||||||
|
The first column is the time (in milliseconds) that the row was appended, and the second
|
||||||
|
column is a sensor value. In other words, your spreadsheet should look like:
|
||||||
|
|
||||||
Time | Sensor Value |
|
Time | Sensor Value |
|
||||||
------+-----------------
|
------+-----------------
|
||||||
| |
|
| |
|
||||||
|
|
||||||
NOTE that the first time you run this sketch, you may receive a warning from
|
5. Google Spreadsheets requires you to authenticate via OAuth. Follow the steps
|
||||||
Google, prompting you to authorize access from a 3rd party system.
|
in the link below to find your ClientID, ClientSecret, and RefreshToken, and then
|
||||||
|
use those values to overwrite the placeholders in the code below.
|
||||||
|
|
||||||
|
https://temboo.com/library/Library/Google/OAuth/
|
||||||
|
|
||||||
|
For the scope field, you need to use: https://spreadsheets.google.com/feeds/
|
||||||
|
|
||||||
|
Here's a video outlines how Temboo helps with the OAuth process:
|
||||||
|
|
||||||
|
https://www.temboo.com/videos#oauthchoreos
|
||||||
|
|
||||||
|
And here's a more in-depth version of this example on our website:
|
||||||
|
|
||||||
|
https://temboo.com/arduino/yun/update-google-spreadsheet
|
||||||
|
|
||||||
|
6. Next, upload the sketch to your Arduino Yún and open the serial monitor
|
||||||
|
|
||||||
|
Note: you can test this Choreo and find the latest instructions on our website:
|
||||||
|
https://temboo.com/library/Library/Google/Spreadsheets/AppendRow/
|
||||||
|
|
||||||
Looking for another API to use with your Arduino Yún? We've got over 100 in our Library!
|
Looking for another API to use with your Arduino Yún? We've got over 100 in our Library!
|
||||||
|
|
||||||
@ -46,8 +64,14 @@
|
|||||||
// Note that for additional security and reusability, you could
|
// Note that for additional security and reusability, you could
|
||||||
// use #define statements to specify these values in a .h file.
|
// use #define statements to specify these values in a .h file.
|
||||||
|
|
||||||
const String GOOGLE_USERNAME = "your-google-username";
|
// the clientID found in Google's Developer Console under APIs & Auth > Credentials
|
||||||
const String GOOGLE_PASSWORD = "your-google-password";
|
const String CLIENT_ID = "your-client-id";
|
||||||
|
|
||||||
|
// the clientSecret found in Google's Developer Console under APIs & Auth > Credentials
|
||||||
|
const String CLIENT_SECRET = "your-client-secret";
|
||||||
|
|
||||||
|
// returned after running FinalizeOAuth
|
||||||
|
const String REFRESH_TOKEN = "your-oauth-refresh-token";
|
||||||
|
|
||||||
// the title of the spreadsheet you want to send data to
|
// the title of the spreadsheet you want to send data to
|
||||||
// (Note that this must actually be the title of a Google spreadsheet
|
// (Note that this must actually be the title of a Google spreadsheet
|
||||||
@ -112,11 +136,12 @@ void loop()
|
|||||||
// see https://www.temboo.com/library/Library/Google/Spreadsheets/AppendRow/
|
// see https://www.temboo.com/library/Library/Google/Spreadsheets/AppendRow/
|
||||||
// for complete details about the inputs for this Choreo
|
// for complete details about the inputs for this Choreo
|
||||||
|
|
||||||
// your Google username (usually your email address)
|
// your Google application client ID
|
||||||
AppendRowChoreo.addInput("Username", GOOGLE_USERNAME);
|
AppendRowChoreo.addInput("ClientID", CLIENT_ID);
|
||||||
|
// your Google application client secert
|
||||||
// your Google account password
|
AppendRowChoreo.addInput("ClientSecret", CLIENT_SECRET);
|
||||||
AppendRowChoreo.addInput("Password", GOOGLE_PASSWORD);
|
// your Google OAuth refresh token
|
||||||
|
AppendRowChoreo.addInput("RefreshToken", REFRESH_TOKEN);
|
||||||
|
|
||||||
// the title of the spreadsheet you want to append to
|
// the title of the spreadsheet you want to append to
|
||||||
// NOTE: substitute your own value, retaining the "SpreadsheetTitle:" prefix.
|
// NOTE: substitute your own value, retaining the "SpreadsheetTitle:" prefix.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=Bridge
|
name=Bridge
|
||||||
version=1.0.6
|
version=1.0.7
|
||||||
author=Arduino
|
author=Arduino
|
||||||
maintainer=Arduino <info@arduino.cc>
|
maintainer=Arduino <info@arduino.cc>
|
||||||
sentence=Enables the communication between the Linux processor and the AVR. For Arduino Yún and TRE only.
|
sentence=Enables the communication between the Linux processor and the AVR. For Arduino Yún and TRE only.
|
||||||
|
Reference in New Issue
Block a user