Tweeting Data with NXT2WiFi Webserver Module

PDF24    Send article as PDF   
In this Tutorial we will go through the steps required to have your LEGO Mindstorms NXT Data sent to Twitter using the NXT2WiFi Miniature Web Server Module. In this Tutorial, the code used to program the LEGO Mindstorms NXT is [nxc]. You will also need a Twitter Account, if you don’t already have one.

NXT2WiFiTweetingRobots-01.jpg

To have LEGO Mindstorms NXT Data sent to Twitter, a third-party application Arduino-Tweet is needed as in interface between the [NXT2WiFi] and the Twitter website. To use the Arduino-Tweet  application we need to acquire Token (Password) to Authorize Arduino to use your Twitter account. Go to http://arduino-tweet.appspot.com/oauth/twitter/login to get a Token.

ArduinoTweet-01.jpg

You should see the above page in your browser window. Enter your Twitter Login details, and press ‘Authorise App‘. If all went to plan, you should see your Authorisation Token appear in your browser window like the one shown below.

ArduinoTweet-02.jpg

Copy your Token and save it for later, as we will need to use it in the [nxc] code used to program the LEGO Mindstorms NXT.

NXC Code: TweetBatteryLevel.nxc

 

Copy the following [nxc] into you programming IDE. Next copy your ‘Authorisation Token‘ into line 5 of the code. #define TOKEN "441999038-R1WQJ8xsp6zIrM6FSuA5eRruN0xhnnXGA8gtSvsL".

The WIFI_ArduinoTweet(string twitterMessage) routine is responsible for sending the actual Tweet to Twitter via the arduino-tweet.appspot.com website. The remaining code should be fairly straight forward.

[@NXT2WiFi]

That done, you can now Compile, Download and Run the code. If all went well, when you view your Twitter Account, you should see something similar to the following Tweets.

NXT2WiFiTweetingRobots-02.jpg

Notice:
  • The library uses this site as a proxy server for OAuth stuff. Your tweet may not be applied during maintenance of this site.
  • Please avoid sending more than 1 request per minute not to overload the server.
  • Twitter seems to reject repeated tweets with the same contenet (returns error 403).

 

Previous Post

Connecting the NXT2WiFi Webserver to a WLAN

The simplest way to connect to the NXT2WiFi Mini-Webserver Module is via an Ad-hoc Network, also called WiFi Direct network where devices communicate only peer to peer (P2P). There is ... Read more

Next Post

LEGO Mindstorms NXT: 1.5M Retractable Cable

Specifications:  High quality LEGO Mindstorms NXT Retractable Cable Weight: 30g Size(about): 5.5 x 3.5 x 1.8cm Pull out to any length to have up to 1.5 meter (5 Foot) of ... Read more

Short URL: http://tinyurl.com/jfqfeyy

Leave a Reply

Your email address will not be published. Required fields are marked *



Do NOT follow this link or you will be banned from the site!
error: Content is protected !!