9 Replies Latest reply on Jan 6, 2014 10:21 AM by Clayton Hofrock

    Twitter.h on Intel Galileo

    franceslup

      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?

        • 1. Re: Twitter.h on Intel Galileo
          ado

          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

          • 2. Re: Twitter.h on Intel Galileo
            intel_jorge

            Dear Franceslup,

             

            Do you still need support with your question?

             

            Rgds,

            Jorge

            • 3. Re: Twitter.h on Intel Galileo
              Bcuriel

              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.

              • 4. Re: Twitter.h on Intel Galileo
                AlexT_Intel

                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

                 

                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;
                
                1 of 1 people found this helpful
                • 5. Re: Twitter.h on Intel Galileo
                  Intel_Jesus

                  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

                  • 6. Re: Twitter.h on Intel Galileo
                    Bcuriel

                    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

                    • 7. Re: Twitter.h on Intel Galileo
                      franceslup

                      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.

                      • 8. Re: Twitter.h on Intel Galileo
                        AlexT_Intel

                        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.

                        • 9. Re: Twitter.h on Intel Galileo
                          Clayton Hofrock

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

                          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 <avr\pgmspace.h>

                           

                          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: 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.