This was an old post that I made some time ago and got lost when I migrated my website to WordPress. I will try and dig out some of them if I deem them interesting enough. This tutorial will illustrate how to create an online data stream that will be able to receive Direct Messages from Twitter in order to stream data into Grasshopper and eventually set some parameters. It’s called an Internet of Things and it will eventually allow you to use your Twitter to control a small mock-up via Arduino Microcontroller.
First things first. In order to complete this tutorial you will need a few things:
1. Grasshopper for Rhino (download).
2. Firefly for Grasshopper (download).
3. Set up a Cosm account. Visit: www.cosm.com (I am not sure if this is still a valid service. Try Xively if Cosm no longer exists https://xively.com/)
4. Set up a Twitter account. Visit: www.twitter.com
5. Optionally instead of Firefly you can use an XML Read Component from gHowl plug in for Grasshopper (download).
Part one of the tutorial explains how to create the necessary geometry to create the pavilion.
Part two of the tutorial explains how to set up the Cosm server and subsequent feeds that we will need to control the Pavilion.
Below is a step by step on how to create a connection between your Twitter and Cosm so you can stream data to Grasshopper by Tweeting it.
1. Create a new account on Twitter or use your existing.
2. Create a new account on Cosm or use your existing.
3. Create a new Manual Feed in your Cosm.com account. Take note of your feed ID as you will need it later. Make sure that it is set to “public” and that you checked the option that “you will push data to Cosm”.
4. From your Twitter.com account, tweet the following message:
Just type it in your “Compose new Tweet” box. That will make you follow @pachtweet on Twitter. This is called sending a public tweet. The user pachtweet will now act as a courier delivering messages between you and your Cosm account.
5. Tweet this message:
5. Reply to pachtweet’s DM (Direct Message) with this text:
YOUR_COSM_KEY can be found if you click on the “Keys” tab on the right hand side of your Cosm.com main account window. Tutorial part two explains which API Key to use. This is a one time authentication process , allowing only your Twitter account to access the Cosm.com feed.
You are now ready to send commands to your Cosm feeds by using Direct Messages in Twitter.com.
6. To begin controlling your Grasshopper Kinetic Pavilion, send a DM to pachtweet that follows this format:
set 132222 255,666
This sets feed id: 132222 to values 255 and 666. This means there is two data streams.
7. There is also to send direct messages to Cosm via your cell phone. From your Twitter account click on “Settings” and then click “Devices”, and follow the on screen instructions to set up your cellphone. Note that updates should be sent to 40404 while in the United States. See the Twitter Phone FAQ for dialing Twitter from other countries:
Cell phone DMs follow a similar format when updating a Cosm feed:
All right, looks like you know how to model the geometry using Grasshopper, update Cosm feeds using Twitter, so you are ready to start using the real Internet of Things. I hope you enjoyed it.
You can watch a two part series on this workflow via my YouTube channel: