element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Forget Me Not Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Forget Me Not Design Challenge
  • More
  • Cancel
Forget Me Not Design Challenge
Blog [FMN#05] : Why tweet when you can dweet??
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: vish
  • Date Created: 29 Aug 2014 7:05 PM Date Created
  • Views 1851 views
  • Likes 0 likes
  • Comments 6 comments
  • forget_me_not
  • raspberry_pi_b+
  • openhab
  • dweet
  • raspberry_pi
  • raspberry-pi
  • twitter
  • iot_home_intelligent
  • openhab_mqtt
  • forget_me_not_challenge_2014
Related
Recommended

[FMN#05] : Why tweet when you can dweet??

vish
vish
29 Aug 2014

Everybody is tweeting!! I like that. It keeps me updated about whats happening around. Unlike big brother FB, i don't have to worry whether to Like or Share or Comment for a post or just do nothing. If I want to spread the word, just retweet. Simple, elegant! But what happens when all these devices started tweeting. Ohh...they are gonna flood the place. I noticed first the trend around some four years( or before that? ) when people started interfacing a moisture sensor to an arduino with wifi shield and put it with a plant -- plant starts tweeting its conditions! Wow??? Really?? I don't think so. When you have one plant, it's okay. What about all the ten plants on your roof top? What if you want to add your indoor temperature sensor to twitter? What about your kid's cradle? I know it's getting messy. The moment you open your twitter page, what you will be able to see is only 'tweets' from these devices. You can easily miss out an important tweet from your friend, or the author you follows. But when I say people these things, they say, "Dude, this is internet of things!". No. I don't think so. I believe that IoT is to help me, not to flood my home page. So let's keep the devices in their domain, and invite them only when you want them. Let's make a twitter especially for them.

     Seems like the guys in Bug Labs had done an appreciable job here. I think they figured out what's so hot about things tweeting and a created a super simple solution for the trend.


Enter dweet.io

image

from dweet.io home page


     dweet.io is a Ridiculously simple messaging (and alerts) for the Internet of Things. And the best part is it doesn't require you( or your device? ) to sign up. Just publish and go. It's machine-to-machine (M2M) for the Internet Of Things (IOT) the way it was meant to be.

image

Yes!! It is.image


     When they say ridiculously simple, they mean it - no cryptic APIs, no access tokens, no passkeys. Just send a normal http request and you are done! Your content is on air. Let me take you through an example. Suppose you have your room heater and it want to post the temperature reading to web. Just request this url from your device :


https://dweet.io/dweet/for/myRoomHeater?temperature=15C


and you are done. Your data is online now. So now how to access the data? It's this simple - request this url from any device which want to access the data :

 

https://dweet.io/get/latest/dweet/for/myRoomHeater

 

And you should get a json object which looks like :

{
     "this":"succeeded",
     "by":"dweeting",
     "the":"dweet",
     "with": {
          "thing":"myRoomHeater",
          "created":"2014-08-29T11:29:55.673Z",
          "content":{
               "temperature":"15C"
          }
     }
}


What if you want to see all the data from past 24 hrs. Again simple. Request this url


https://dweet.io/get/dweets/for/myRoomHeater


You will get a response like this :

{
     "this":"succeeded",
     "by":"getting",
     "the":"dweets",
     "with":[
          {
               "thing":"myRoomHeater",
               "created":"2014-08-29T11:41:31.164Z",
               "content":{
                    "temperature":"16.5C"
               }
          },
          {
               "thing":"myRoomHeater",
               "created":"2014-08-29T11:41:26.383Z",
               "content":{
                    "temperature":"15.8C"
               }
          },
          {
               "thing":"myRoomHeater",
               "created":"2014-08-29T11:41:21.173Z",
               "content":{
                    "temperature":"15.3C"
               }
          },
          {
               "thing":"myRoomHeater",
               "created":"2014-08-29T11:29:55.673Z",
               "content":{
                    "temperature":"15C"
               }
          }
     ]
}


You have a json object that you can parse to figure out what you want. Isn't it so simple?

You can go to https://dweet.io/play/  and play around with all those I just said and even more.


Cool, but are there any clients?

What is a great engine without a chasis? And what about a great solution with out any client libraries? But my question is do we really need one? Bug Labs have released two official clients in Node.js and Javascript. And they also lists unofficial python and ruby clients. I chose to walk the python way and tested both the clients : dweepy and pydweet. I liked dweepy more - it has support for real time streams which is very useful( or a must? ) when you are working in  project like this.


image


Let your Pi dweet

So much of theory. Let's get out hands dirty. Let the Pi dweet. But what to dweet? Pi don't have any sensors inbuilt image. No worries. We'll dweet some junk stufff to start with. First prepare your Pi. Installing dweepy in raspberry Pi is simple. Fire up your rPi terminal and type in

sudo apt-get install python-pip

pip install dweepy

wait till the installation finishes and your are done image. Now let's start dweeting. In your rPi, enter your python terminal and

>>> import dweepy

>>> dweepy.dweet_for('fmn2014_vish_raspberrypi', {'msg':'this is a test dweet' } )

where you replace 'fmn2014_vish_raspberrypi' with your thing id( anything, but keep it sufficiently long to avoid namespace collisions ). You will be able to see some thing similar to this as output :

imageIf you go to https://dweet.io/play/ and check for your  dweet, you can see like this :

image

That means you have successfully posted a dweet.

Now let's play with receiving dweets. Go to Dweet Play page and create a new dweet( like the one in the screenshot below ).

image

Now back in your python terminal, type :

>>> dweepy.get_latest_dweet_for('fmn2014_vish_raspberrypi')

and you will be able to see some thing similar to this :


image

Formatting is a little for the moment, but you can see that we got what we sent from our browser.

To get all the dweets from last 24 hours,

>>> dweepy.get_dweets_for('fmn2014_vish_raspberrypi')

and you will be able to get :

image

I'm having a few more dweets in this screenshot than I mentioned in this post.( I played a little more dweeting image )


You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image


That's it for now. In my next post, I'll explain how to wireup Enocean-Py, Dweet and raspberry Pi to create a fully functional IoT system.



<< Prev | Index | Next >>

  • Sign in to reply
Parents
  • ipv1
    ipv1 over 11 years ago

    Nicely done. Though I would prefer MQTT

    Plus what happens when every IOT device in the world starts dewting or even sending small packets around the net.

     

    I guess it depends if you want that temperature info on the net in the first place. image

    Like the alternative though.

    Cheers

    IP

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • ipv1
    ipv1 over 11 years ago

    Nicely done. Though I would prefer MQTT

    Plus what happens when every IOT device in the world starts dewting or even sending small packets around the net.

     

    I guess it depends if you want that temperature info on the net in the first place. image

    Like the alternative though.

    Cheers

    IP

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • vish
    vish over 11 years ago in reply to ipv1

    Hi IP,

    I'm a bit confused. How to calculate the efficiency of an MQTT packet and dweet packet w.r.t payload? For dweet packets, I just have to put the request length + HTTP header and can calculate. But how is it done for MQTT?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 11 years ago in reply to vish

    Good question. I guess we have to take a look at the specs. MQTT is known to have a small overhead and was designed for devices. I think it used to be called SCADA and was popular with industrial control.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • vish
    vish over 11 years ago in reply to ipv1

    Hi IP, SCADA as far as I know is an industrial control system architecture. There are various communication protocols in SCADA and I think MQTT may be one of them. Till now I was thinking SCADA works for local networks. Now it seems like it can be used over public networks. Thanks for the info image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube