Arduino yun using Temboo

Friends,
I am trying the example of sending a mail using Temboo. After compileing there is no error but while uploading it is showing some error. I have included the example code that i found in Temboo website and also included all the header file. Please help to overcome this error.
Thank you :slight_smile:

/*
  SendAnEmail

  Demonstrates sending an email via a Google Gmail account using the Temboo Arduino Yun SDK.

  This example code is in the public domain.
*/

#include <Bridge.h>
#include <Temboo.h>
#include "TembooAccount.h" // contains Temboo account information

/*** SUBSTITUTE YOUR VALUES BELOW: ***/

// Note that for additional security and reusability, you could
// use #define statements to specify these values in a .h file.

// your Gmail username, formatted as a complete email address, eg "bob.smith@gmail.com"
const String GMAIL_USER_NAME = "abcdef@gmail.com";

// your Gmail password
const String GMAIL_PASSWORD = "xxxxxxxxxxxx";

// the email address you want to send the email to, eg "jane.doe@temboo.com"
const String TO_EMAIL_ADDRESS = "sandy@temboo.com";


boolean success = false; // a flag to indicate whether we've sent the email yet or not

void setup() {
  Serial.begin(9600);

  // for debugging, wait until a serial console is connected
  delay(4000);
  while(!Serial);

  Bridge.begin();
}

void loop()
{
  // only try to send the email if we haven't already sent it successfully
  if (!success) {

    Serial.println("Running SendAnEmail...");
  
    TembooChoreo SendEmailChoreo;

    // invoke the Temboo client
    // NOTE that the client must be reinvoked, and repopulated with
    // appropriate arguments, each time its run() method is called.
    SendEmailChoreo.begin();
    
    // set Temboo account credentials
    SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);

    // identify the Temboo Library choreo to run (Google > Gmail > SendEmail)
    SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");
 

    // set the required choreo inputs
    // see https://www.temboo.com/library/Library/Google/Gmail/SendEmail/ 
    // for complete details about the inputs for this Choreo

    // the first input is your Gmail email address
    SendEmailChoreo.addInput("Username", GMAIL_USER_NAME);
    // next is your Gmail password.
    SendEmailChoreo.addInput("Password", GMAIL_PASSWORD);
    // who to send the email to
    SendEmailChoreo.addInput("ToAddress", TO_EMAIL_ADDRESS);
    // then a subject line
    SendEmailChoreo.addInput("Subject", "ALERT: Greenhouse Temperature");

     // next comes the message body, the main content of the email   
    SendEmailChoreo.addInput("MessageBody", "Hey! The greenhouse is too cold!");

    // tell the Choreo to run and wait for the results. The 
    // return code (returnCode) will tell us whether the Temboo client 
    // was able to send our request to the Temboo servers
    unsigned int returnCode = SendEmailChoreo.run();

    // a return code of zero (0) means everything worked
    if (returnCode == 0) {
        Serial.println("Success! Email sent!");
        success = true;
    } else {
      // a non-zero return code means there was an error
      // read and print the error message
      while (SendEmailChoreo.available()) {
        char c = SendEmailChoreo.read();
        Serial.print(c);
      }
    } 
    SendEmailChoreo.close();

    // do nothing for the next 60 seconds
    delay(60000);
  }
}

This is the error

Sketch uses 14,452 bytes (50%) of program storage space. Maximum is 28,672 bytes.
Global variables use 819 bytes (31%) of dynamic memory, leaving 1,741 bytes for local variables. Maximum is 2,560 bytes.
processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:96)
	at processing.app.Sketch.upload(Sketch.java:1719)
	at processing.app.Sketch.exportApplet(Sketch.java:1625)
	at processing.app.Sketch.exportApplet(Sketch.java:1597)
	at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
	at java.lang.Thread.run(Thread.java:744)
Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.
	at processing.app.Serial.touchPort(Serial.java:110)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:83)
	... 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.
	at jssc.SerialPort.openPort(SerialPort.java:170)
	at processing.app.Serial.touchPort(Serial.java:105)
	... 6 more

sandy06:

Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Permission denied.

Double check your permissions on device /dev/ttyACM0. If you using a debian based distro, your user should be in group "dialout". Once done, reboot and retry

After giving the permission to ttyACM0 i am getting this error.

java.io.IOException: Cannot run program "/home/sudhath/arduino-1.5.6-r2/hardware/tools/avrdude": error=13, Permission denied
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
	at java.lang.Runtime.exec(Runtime.java:617)
	at java.lang.Runtime.exec(Runtime.java:485)
	at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:12)
	at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:100)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:123)
	at processing.app.Sketch.upload(Sketch.java:1719)
	at processing.app.Sketch.exportApplet(Sketch.java:1625)
	at processing.app.Sketch.exportApplet(Sketch.java:1597)
	at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: error=13, Permission denied
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
	at java.lang.ProcessImpl.start(ProcessImpl.java:130)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
	... 10 more
java.io.IOException: Cannot run program "/home/sudhath/arduino-1.5.6-r2/hardware/tools/avrdude": error=13, Permission denied

It looks you have copied the unpacked IDE from another linux computer with different users/permissions and now you can't even run one of its executables

If you're logged in a "sudhath" user, issue a

sudo chown -R sudhath /home/sudhath/arduino-1.5.6-r2

and retry

Thank you its working fine now :slight_smile:
I am trying with this program Arduino Yún: Use your Arduino Yún to send emails via Gmail . Threre is no error and it is successfully uploaded to the Yun board. But there is no mail sent from my gmail to temboo account. If i open Serial monitor at 9600 baud rate there is no success message displayed. I have entered all the details into the program. can you tell me where i went wrong and why i cant send an email?

sonnyyu:
Send gmail from Yun the temboo is not required.

Yún and SSL - #12 by Erni - Arduino Yún - Arduino Forum

Send an email with Arduino Yun - #6 by Erni - Arduino Yún - Arduino Forum

[SOLVED] Arduino Yun: Sending email via gmail SMTP over WiFi - #2 by Erni - Arduino Yún - Arduino Forum