Go Down

Topic: I2C (wire) devices and Temboo Twitter Choreos - SOLVED (Read 1 time) previous topic - next topic


Oct 15, 2013, 07:29 am Last Edit: Oct 21, 2013, 10:28 pm by PB7781 Reason: 1
Hey everyone!

I've made a sketch to send a tweet and read mentions to me with the temboo api and I would like to use the
wire library so that I can activate e led matrix when I receive a tweet for example.
But If I include the wire.h lib then I always get an error when trying to send a tweet.  Everything compiles ok but the
temboo StatusUpdateChoreo seems to have some trouble when I iclude the Wire.h library.
When I comment the iclusion line // include <Wire.h>   then everything works ok again...
I use a nightly build of the 1.5.4 beta on my Arduino Yun.

the error returned is:
A Step Error has occurred: "An input error has occurred. ConsumerKey, ConsumerSecret, AccessToken, AccessTokenSecret, and StatusUpdate are required.".  The error occurred in the Stop (Input error) step

Anyone experiencing the same problem??

kind regards,


it seems it is not the library itself, after hours of testing, I've found out that something with the adafruit ledbackpack library must be wrong, everytime I even declare the matrix, then I get this strange error from the choreo.

I am now trying with the LiquidCrystal_I2C.h lib and also that doesn't work, there must be something strange when using I2C libs in combination with Temboo, I have used the bridge lib in combination with I2C devices and that is no problem at all, so there must be a conflict somewhere between the temboo twitter choreos and someting with the I2C part???
anyone, any idea??????


Federico Fissore

Uhm that sounds strange as TembooChoreo is just an extension of Process
Can you post your wiring and sketch?

Federico Fissore

I have run your sketch https://gist.github.com/ffissore/cd046750f16a9c308360 and successfully published a tweet
It also started printing mentions


Yes but that's my point, the sketch WILL run but...

ONLY when NOT using any I2C device, try using a IIC (I2C) lcd display or a led matrix (adafruit or something)
and in the loop part, try to put something on the display or the led matrix,
just try to use the same sketch (that runs fine WITHOUT IIC devices) AND use a IIC device with it,
I am very very curious if it will work in that case!
Because the only thing I do is (uncomment the lcd related lines in my sketch) and it stops working ...
I still can not find out why but I assure you that when I do find it I will share it immediately with this forum

kind regards,


I believe I am on the right path to finding out how to get these things working, and
now I can send a tweet and put a smiley on my adafruit 8x8 bicolor matrix, BUT when I try
to use the temboo thing twice then it doesn't work, if I want to send a tweet AND get the mentions
then I get errors, there must be something I am doing wrong with the Temboo library but I don't know what
for the time being.


  Demonstrates sending a tweet via a Twitter account using Temboo from an Arduino Yun.

  Check out the latest Arduino & Temboo examples and support docs at http://www.temboo.com/arduino

  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

  In order to run this sketch, you'll need to register an application using
  the Twitter dev Serial at https://dev.twitter.com. Note that since this
  sketch creates a new tweet, your application will need to be configured with
  read+write permissions. After creating the app, you'll find OAuth credentials
  for that application under the "OAuth Tool" tab. Substitute these values for
  the placeholders below.

  This example assumes basic familiarity with Arduino sketches, and that your Yun is connected
  to the Internet.

  Want to use another social API with your Arduino Yun? We've got Facebook,
  Google+, Instagram, Tumblr and more in our Library!
  This example code is in the public domain.

#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_BicolorMatrix matrix = Adafruit_BicolorMatrix();
static const uint8_t PROGMEM
  smile_bmp[] =
  { B00111100,
    B00111100 },
  neutral_bmp[] =
  { B00111100,
    B00111100 },
  frown_bmp[] =
  { B00111100,
    B00111100 };

#include <Bridge.h>
#include <Serial.h>
#include <Temboo.h>
#include "TembooAccount.h"

// om te debuggen
#define dothisthing 0   // activate show mentions part
#define dothatthing 1   // activate send a tweet tomboo part

void setup() {

  while (!Serial);
  Serial.println("Yun is ready and awaiting your command! ");


const String TWITTER_ACCESS_TOKEN = "blablablabla";
const String TWITTER_ACCESS_TOKEN_SECRET = "blablablabla";
const String TWITTER_CONSUMER_KEY = "blablablabla";
const String TWITTER_CONSUMER_SECRET = "blablablabla";

int numRuns = 0;   // execution count, so this sketch doesn't run forever
int maxRuns = 1;  // the max number of times the Twitter Update Choreo should run

String tweetje="";
String command;
char karakter;

void loop()

    if (dothatthing) { 
          // only try to send the tweet if we haven't already sent it successfully
          if (numRuns <= maxRuns) {
                while (Serial.available()<=0) {};   
                command ="";   
                karakter = Serial.read();
                while (karakter != '\n') {
                  command += karakter;
                  karakter = Serial.read();
                } //while loop
              // define the text of the tweet we want to send
              tweetje = "@XHQRTS Device Tweeting (";
              tweetje += command;
              tweetje += ")";
              Serial.println("now sending tweettext:  ");
              String tweetText(tweetje);
              // TembooChoreo MyChoreoInstance;
              // invoke the Temboo client
              // NOTE that the client must be reinvoked, and repopulated with
              // appropriate arguments, each time its run() method is called.
              TembooChoreo MyChoreoInstance;
              // set Temboo account credentials
              // identify the Temboo Library choreo to run (Twitter > Tweets > StatusesUpdate)
              // set the required choreo inputs
              // see https://www.temboo.com/library/Library/Twitter/Tweets/StatusesUpdate/
              // for complete details about the inputs for this Choreo
              // add the Twitter account information
              MyChoreoInstance.addInput("AccessToken", TWITTER_ACCESS_TOKEN);
              MyChoreoInstance.addInput("AccessTokenSecret", TWITTER_ACCESS_TOKEN_SECRET);
              MyChoreoInstance.addInput("ConsumerKey", TWITTER_CONSUMER_KEY);   
              MyChoreoInstance.addInput("ConsumerSecret", TWITTER_CONSUMER_SECRET);
              MyChoreoInstance.addInput("StatusUpdate", tweetText);

              // for debugging
              Serial.print("following text will be tweeted >> ");
              // tell the Process 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 = MyChoreoInstance.run();
              // a return code of zero (0) means everything worked
              if (returnCode == 0) {
                  Serial.println("Success! Tweet sent!");
                  matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_GREEN);
                  } else
                      // a non-zero return code means there was an error
                      // read and print the error message
                      matrix.drawBitmap(0, 0, frown_bmp, 8, 8, LED_RED);
                      while (MyChoreoInstance.available()) {
                        char c = MyChoreoInstance.read();
                      } // while loop
                     } // else           
          } // number of runs   

   if (dothisthing) {   
        if (numRuns <= maxRuns) {
          // now show the mentions...
          Serial.println("showing mentions ");
          // invoke the Temboo client
          // NOTE that the client must be reinvoked, and repopulated with
          // appropriate arguments, each time its run() method is called.
          TembooChoreo MyMentionChoreoInstance;
          // set Temboo account credentials
          // identify the Temboo Library choreo to run (Twitter > Tweets > Mentions)
          // add the Twitter account information
          MyMentionChoreoInstance.addInput("AccessToken", TWITTER_ACCESS_TOKEN);
          MyMentionChoreoInstance.addInput("AccessTokenSecret", TWITTER_ACCESS_TOKEN_SECRET);
          MyMentionChoreoInstance.addInput("ConsumerKey", TWITTER_CONSUMER_KEY);   
          MyMentionChoreoInstance.addInput("ConsumerSecret", TWITTER_CONSUMER_SECRET);
          MyMentionChoreoInstance.addInput("Count", String(2)); // only show two
          // set the required choreo inputs
          // see https://www.temboo.com/library/Library/Twitter/Tweets/StatusesUpdate/
          // for complete details about the inputs for this Choreo
          Serial.println("after executing MENTIONS Choreo.");
          while(MyMentionChoreoInstance.available()) {
            char c = MyMentionChoreoInstance.read();
            // process JSON
            if (c=='[') Serial.println("    ");
            if (c=='{') Serial.println("   ");
            if (c==']') Serial.println("");
            if (c=='}') Serial.println("");
            if (c==':') Serial.println("  ");         

kind regards and thanx to Frederico Fissore for those quick replies!



I got an email from the Temboo team today, explaining that the ATmel in the Yun is very limited in ram size
and indeed, I used lots of libraries like the wire lib, the adafruit gfx and ledbackpack AND I did lots of printing to the
console and I'm afraid I just ate to much ram, so the Yun reacts strange and sometimes the sketch worked and sometimes
it didn't, I must say I didn't even think about the memory limits on the Yun but now that I am aware of this I can take it into account so I removed the adafruit libs and just use a tinkerkit led to do something and it works perfectly now.

So, the advice is, watch your ram when developing for the Yun, it is important!
I knew the days of the TRS80 so I should have been aware of it :-) but these days with the luxury of gigabytes everywhere
one tends to just forget these things...

kind regards and many thanks to the Temboo team!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131