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
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??????
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
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.
/*
SendATweet
Demonstrates sending a tweet via a Twitter account using Temboo from an Arduino Yun.
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!
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
// 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;
MyChoreoInstance.begin();
// set Temboo account credentials
MyChoreoInstance.setAccountName(TEMBOO_ACCOUNT);
MyChoreoInstance.setAppKeyName(TEMBOO_APP_KEY_NAME);
MyChoreoInstance.setAppKey(TEMBOO_APP_KEY);
// identify the Temboo Library choreo to run (Twitter > Tweets > StatusesUpdate)
MyChoreoInstance.setChoreo("/Library/Twitter/Tweets/StatusesUpdate");
// 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 >> ");
Serial.println(tweetText);
// 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.clear();
matrix.drawBitmap(0, 0, smile_bmp, 8, 8, LED_GREEN);
matrix.writeDisplay();
delay(500);
} else
{
// a non-zero return code means there was an error
// read and print the error message
matrix.clear();
matrix.drawBitmap(0, 0, frown_bmp, 8, 8, LED_RED);
matrix.writeDisplay();
delay(500);
while (MyChoreoInstance.available()) {
char c = MyChoreoInstance.read();
Serial.print(c);
} // while loop
} // else
MyChoreoInstance.close();
} // 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;
MyMentionChoreoInstance.begin();
// set Temboo account credentials
MyMentionChoreoInstance.setAccountName(TEMBOO_ACCOUNT);
MyMentionChoreoInstance.setAppKeyName(TEMBOO_APP_KEY_NAME);
MyMentionChoreoInstance.setAppKey(TEMBOO_APP_KEY);
// identify the Temboo Library choreo to run (Twitter > Tweets > Mentions)
MyMentionChoreoInstance.setChoreo("/Library/Twitter/Timelines/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
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(" ");
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!
Philippe