I'm working on a project that lights up a strand of neopixels in response to tweets sent from Twitter.
I have an app on IFTTT.com that sends specified tweets to Adafruit IO,
And then my microcontroller (it's a Huzzah Wifi, one of these https://www.adafruit.com/product/2821) reads the data from Adafruit IO and based on key words in the tweet, it lights up an animation on the neopixels.
The problem is that if I send a tweet that's over 52 characters, it'll either not be received at all or when it is received, it's truncated.
Is there a length to how long data can be? I can see in the monitor that the entire tweet is being received and stored in Adafruit IO... but my device either doesn't receive all the data or truncates it if it does.
Here are some examples:
I sent this tweet.
You can see it was received by the Adafruit IO
My monitor shows it's there. But as you can see in the image, my device disconnected when it got this tweet.
This is what the code is supposed to do:
- Code: Select all | TOGGLE FULL SIZE
void handleMessage(AdafruitIO_Data *data) {
Serial.println("A tweet came in!");
Serial.println(data->value());
tweettext = String(data->value());
tweettext.toLowerCase();
received_tweet = true;
}
Nothing actually gets written to the serial monitor when the tweet is received. If I send another, shorter tweet afterward, it is correctly written to the serial monitor - so the program is still looping, it didn't exit - what happened? Is there a max length for the data -> value() function? Can I do anything to read an entire tweet and not just the first 50 characters?
Thank you
Dawn DuPriest