Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9868 Discussions

Twitter.h on Intel Galileo

FLupi
Novice
1,822 Views

After testing the ethernet library with a simple UDP communication, i tried to tweet with my Galileo but when i complie the sketch the IDE report a fatal error because the Twitter.h library (you can find it on the arduino forum) is for AVR.

There is a simple way to make it work with x86?

0 Kudos
9 Replies
ADRIAN_B_Intel
Employee
153 Views

hi,

you compiled File->Examples->Ethernet->TwitterClient and it didnt compile?

please included error log and exact info.

On my system it compiles for me?

thanks,

-a

Jorge_I_Intel
Employee
153 Views

Dear Franceslup,

Do you still need support with your question?

Rgds,

Jorge

BCuri
Beginner
153 Views

Hi Jorge,

Not sure if Franceslup does, but I need help with something similar. The TwitterClient example compiles, but doesn´t read any tweets. Help is very much appreciated.

AT9
Honored Contributor II
153 Views

Hi Bcuriel,

I've just tried that one out unmodified - it actually works, but the URL they're using is outdated and no longer returns a tweet in the expected format (only an error). You can try it yourself in your browser, the URL used in the example is:

http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=arduino&count=1 http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=arduino&count=1

You can add something like this line:

Serial.println(inChar);

After these two in the loop() function to see it actually receives the data:

// add incoming byte to end of line:

currentLine += inChar;

JesusE_Intel
Moderator
153 Views

Hi Bcuriel,

As AlexT_Intel mentioned the URL is outdated. If you do what he suggested you will see that it returns an invalid URL error. Were you able to get it to work?

Regards,

Intel_JEspinoza

BCuri
Beginner
153 Views

Hi Alex_T and JEspinoza. Thank you both for your reply.

I did confirm that the URL spits out an error. I learned the hard way that Twitter's new version of their API requires a lot of work with respect to authentication before being able to retrieve tweets. My workaround was to have a php script on a webserver that does all theauthentication and retrieves the tweets I'm interested in. I then use Galileo to access this info via a GET request to said script. Although I did modify the script, it is by no means my own work. I found a video on youtube that pointed me to someone else's work and it worked like a charm. My next step is to grab two tweets and store them in separate strings. Hitting some roadblocks there. Other than that, it's working pretty well.

Thanks again,

B

FLupi
Novice
153 Views

Yes i still need support because the library i want to use is an external library because the internal sketch is out of date.

But the Twitter.h is not a library for x86. You can find it on the arduino community.

AT9
Honored Contributor II
153 Views

It would help everyone to help you :-) if you would share more or less exact steps you're trying along with errors you get (in a form of logs, screenshots, screencasts, etc). One could go and find that Twitter.h for sure, then try to do something using it and then maybe the problem you face would exhibit itself (or maybe not) - but it's much easier and relevant (for you) if we immediately see the problem you face.

clayton_H_Intel
Employee
153 Views

I think what he is talking about is using the Twitter Library from the Arduino.cc site. You can download it from here:

/message/217909# 217909 https://communities.intel.com/message/217909# 217909

The examples from that library fail to compile because they make a call to avr\pgmspace.h which only exists for Arduino boards, not for x86. Note: this is a common problem for many of the existing Arduino libraries.

For this library, you can fix the problem by opening up the twitter.h file and commenting out the line:

// # include

The twitter library inlcudes the pgmspace library, but I could not find anyplace where it actually uses the PROGMEM command. More information on the PROGMEM library: http://arduino.cc/en/Reference/PROGMEM Arduino - PROGMEM

I was able to comment out the pgmspace and get the example to compile. I did not get a chance to test it, because I do not currently have an ethernet connection.

Reply