0

So I'm trying to update a gooogle sheet through Temboo and an Arduino Yun. I can run the AppendValues choreo and AppendRow choreo from the Temboo site just fine and everything updates, but running the choreos through the arduino .ino shows no updates on the google sheet. I get a return code of 0 from running the choreo though. So I know Oauth is working and google and temboo are talking, so there must be a problem in my code?

I have double checked AccountName, Password, AppKey, refresh token, client secret, client id, spreadsheet id, spreadsheet name, etc in the Arduino code (tried AppendValuesChoreo and AppendRowChoreo).

AppendRow .ino:

// Include required libraries
#include <Bridge.h>
#include <Temboo.h>

// Debug mode ?
boolean debug_mode = true;

void setup() {

  //start serial
  Serial.begin(115200);
  delay(4000);
  while(!Serial);
  
  // Start bridge
  Bridge.begin();
  
  Serial.println("Setup complete. Waiting for sensor input...\n");
}

void loop() {

  Serial.println("\nCalling the /Library/Google/Spreadsheets/AppendRow Choreo...");
  
  // Append data to Google Docs sheet
  runAppendRow();
  
        
  // Repeat every 10 seconds
  delay(10000);
}

// Function to add data to Google Docs
void runAppendRow() {
  TembooChoreo AppendRowChoreo;

  // Invoke the Temboo client
  AppendRowChoreo.begin();

  // Set Temboo account credentials
  AppendRowChoreo.setAccountName("");
  AppendRowChoreo.setAppKeyName("myFirstApp");
  AppendRowChoreo.setAppKey("");
  
  // Identify the Choreo to run
  AppendRowChoreo.setChoreo("/Library/Google/Spreadsheets/AppendRow");

  // your Google username (usually your email address)
  AppendRowChoreo.addInput("Username", "");

  // your Google account password
  AppendRowChoreo.addInput("Password", "");
  
  // the title of the spreadsheet you want to append to
  AppendRowChoreo.addInput("SpreadsheetTitle", "Yun");
  
  // Format data
  String data = "123,921";

  // Set Choreo inputs
  AppendRowChoreo.addInput("RowData", data);

  // Run the Choreo
  unsigned int returnCode = AppendRowChoreo.run();

  // A return code of zero means everything worked
  if (returnCode == 0) {
    if (debug_mode == true){
      Serial.println("Completed execution of the /Library/Google/Spreadsheets/AppendRow Choreo.\n");
      Serial.println("Row added: " + data);
    }
  } else {
    // A non-zero return code means there was an error
    // Read and print the error message
    while (AppendRowChoreo.available()) {
      char c = AppendRowChoreo.read();
      if (debug_mode == true){ Serial.print(c); }
    }
    if (debug_mode == true){ Serial.println(); }
  }
  AppendRowChoreo.close();
}

AppendVValues .ino:

#include <Bridge.h>
#include <Temboo.h>

int calls = 1;   // Execution count, so this doesn't run forever
int maxCalls = 10;   // Maximum number of times the Choreo should be executed

void setup() {
  Serial.begin(9600);
  
  // For debugging, wait until the serial console is connected
  delay(4000);
  while(!Serial);
  Bridge.begin();
}

void loop() {
  if (calls <= maxCalls) {
    Serial.println("Running AppendValues - Run #" + String(calls++));
    
    TembooChoreo AppendValuesChoreo;

    // Invoke the Temboo client
    AppendValuesChoreo.begin();

    // Set Temboo account credentials
    AppendValuesChoreo.setAccountName("");
    AppendValuesChoreo.setAppKeyName("");
    AppendValuesChoreo.setAppKey("");
    
    // Set Choreo inputs
    AppendValuesChoreo.addInput("RefreshToken", "");
    AppendValuesChoreo.addInput("ClientSecret", "");
    AppendValuesChoreo.addInput("Values", "[[15,49]]");
    AppendValuesChoreo.addInput("ClientID", "");
    AppendValuesChoreo.addInput("SpreadsheetID", "");
    
    // Identify the Choreo to run
    AppendValuesChoreo.setChoreo("/Library/Google/Sheets/AppendValues");
    
    // Run the Choreo; when results are available, print them to serial
    AppendValuesChoreo.run();
    
    while(AppendValuesChoreo.available()) {
      char c = AppendValuesChoreo.read();
      Serial.print(c);
    }
    AppendValuesChoreo.close();
  }

  Serial.println("Waiting...");
  delay(30000); // wait 30 seconds between AppendValues calls
}
  • Anybody got anything? The only thing I can think of is that the google account I am logging in through is managed by another account. With that said, the google account I'm using has access to dev console, is a paid account, etc. – Ezra Underwood Sep 25 '22 at 16:02

1 Answers1

0

enter image description here

Looks like they only support rev1, and the original shields. Hopefully they'll update services for the rev2 boards soon.