Connect Twitter to IoT with thethings.iO

As you probably know, it is possible to combine social media tools, such as Twitter, Facebook or Instagram, with the Internet of Things. In this post we are going to make a quick view of how to use our IoT platform, thethings.iO, in order to allow your things tweet what they are doing or experiencing.

Twitter thethings.iO

Twitter thethings.iO

Just like all persons, your things live experiences. Imagine a plant. It needs to be watered, sun-exposed certain time, among other. What happens when you forget to do it? In a past, your plant may die in few days. Nowadays, the plant can talk to you if it’s connected. It can have a Twitter account and, in case it needs to be watered, it can post a tweet saying, for example, “Hey dear, my boss just forgot to water me!”. Other examples can be: “S.O.S. I need more sun!” or “I’m thirsty, please water me!”.

At thethings.iO your things can send tweets in 10 minutes and 20 lines of code. The only thing you need is: connect a plant, introduce your Twitter credentials! and make an easy trigger on thethings.iO cloud code. It is easy, right?

Step by step: How to make my thing that send tweets

Step 0: Create an account

In case you don’t have an account in our platform, register by clicking here. It will take you less than a minute! And if you already have one, just log in to thethings.iO.

Sign in

Step 1: Connect your plant

It does not matter what thing you want to receive tweets from. But you need to have your thing created and connected using our platform. Learn how to do it in less than a minute here.

We connected a plant to the Internet through Sigfox some weeks ago, so just copy and paste our example from thethings.iO Instructables.

thethingsio-connected-plant

Step 2: Code the Trigger

Once the plant is connected and sending data to thethings.iO IoT platform, let’s start coding the trigger on cloud code.

You need to introduce this piece of code and build some logics on your thing in order to allow it to send you tweets. In here, you will also need to introduce your Twitter credentials.


function trigger(params, callback){

if (params.action !== 'write') return callback();  // If the plant is writing something to thethings.iO, else don't send to twitter.

// Message to post
var inputTwitter = {
'status': 'A 140 character message :P'
}

// Your twitter API credentials
var twitter = new Twitter({
accessToken: '',
accessTokenSecret: '',
consumerKey: '',
consumerSecret: ''
});

// if something happens with your plant then
twitter.postTweet(inputTwitter, callback)

var values = {
values: params.values;
};

values.values[0].key = 'tweet';
values.values[0].value = inputTwitter.status;

// Each time a twitter is sent,the status is wrote to a resource called 'tweet'
thethingsAPI.thingWrite('your Thing token', values, function() { callback(null, 'ok'); } );

}

Step 3: Visualize your Tweets and Customize your dashboard (if you want to)

All the data your thing generates can be tracked and seen in your dashboard, so anytime your thing sends a tweet, it will be registered in the platform. Now its time to create a widget to display the tweets sent. Click Add Widget and create the widget that you want with the resource ‘tweet’ (specified in the trigger).

You can fully customize your dashboard. If you want to learn how, just click here.

thethingsio-dashboard-tweets

And that’s it. If you want to learn more about thethings.iO features then you cannot miss these posts about Twilio and Sigfox!

And make sure you follow us on Twitter to keep you posted about the Internet of Things world and thethings.iO latest news!

Webinar IoT: Learn how to optimize, monitor, and analyse data with thethings.iO

Today we recorded a webinar with our friends from BeMyApp about how to connect a device to the Internet. We tried to make a very hands-on workshop showcasing thethings.iO IoT platform. At the end, we demoed how to connect a Sigfox device or a WiFi device to each other, create a custom dashboard and build some business logics with Twilio and Twitter.

Nowadays everybody is talking about IoT and devices connected all around the world (connected cars, smart homes, industry 4.0, among other). During this workshop we are showcasing how to connect a device to the Internet (Arduino, Particle and Akery Sigfox device) with WiFi, Ethernet and Sigfox to the thethings.iO.

At thethings.iO we connect things, store real-time data, set up business logics on the top of the data and build dashboards to visualize these data.

Enjoy the webinar and start working with thethings.iO from now with a free account. Check our libraries at thethings.iO github account and follow us on Twitter at @thethingsiO.

Monitoring the sausages from Casa Tarradellas

Lately at thethings.iO, we have been working on several interesting projects. And finally we can announce one of our favourites and related to the science world! Keep reading if you want to know more…

DISCLAIMER: This is an April’s fools 2016 post. Hope to see this happen in the next 5 years 😛

Internet connected sausages

Spanish fuet sausages with green peppers on wooden table
The most well-known Spanish sausage company is called Casa Tarradellas, located 100km from Barcelona. We were approached by them to connect the Tarradellas’ fuets to the Internet with thethings.iO.

Problem that we solve

Casa Tarradellas approached us when they needed more information about their customers. Actually they don’t understand how they customers eat “fuet”, how fast the sausage is eaten, and how many have been never eaten. These questions only can be answered connecting to the Internet the proper sausages and sending the information to the Internet. After that, thethings.iO IoT dashboard was able to monitor and analyze all the parameters from customers behaviours.

IoT dashboard for Tarradellas

IoT dashboard for Tarradellas

First problem that we found is that we can find any kind of sensors in several places all around the world. Nevertheless we needed a biosensor that could fit in the sausages. The biosensors have became one of the most interesting improvements in the field of sensing. After getting one of them, we started thinking of all the amazing things we could track with it. And the answer came fast: the monitoring of how people eat the typical catalan well-known sausages “fuet”.

How it works

Partnering an American company (sorry but we have to still keep the secret of which one we are referring to) and Sigfox, together we were able to provide one of the smallest nano chips we have ever connected to the Internet via Sigfox with our Sigfox SDK. See what it looks like:

thethingsio-nano-robots
Placing several of these biosensors inside the “fuet” we were able to understand the behaviour of Tarradellas customers. We monitored the biochemical process of the digestion, in order to track how people consume this kind of sausages. And we obtained some really interesting analytics that could be really useful to a big brand such as Casa Tarradellas.

fuet-sensors
Unbelievable, right? See how the technology and biology worlds are changing the 1st of April!

6 steps to connect your first device to thethings.iO

Now it’s even easier to start with the Internet of Things with our platform, thethings.iO. In this post we are going to show you all the improvements we have made to make your first experience even better!

Follow our on-boarding process to start sending data from a device in just 6 easy steps:

Step 0: Create an account

In case you have never signed up in thethings.iO you have to do it. You will see it is so easy and quick. If you have already an account, you just need to log in to the platform.

thethings.iO registration

Step 1: What kind of experience are you waiting for?

Once you have entered our platform for the first time, you will receive a welcoming message from our IoT expert.

Screen Shot 2017-01-23 at 4.04.34 PM

After that, we want you to have the best experience using thethings.iO, so that’s why we ask you a few questions to understand a little bit more about your problem or what you are expecting to find here.

thethings.iO on-boarding form

Step 2: Getting Started

This is a new step we are just introducing to make it easier to connect and activate your first thing with thethings.iO. For the non-technical users you are able to view a real customer’s dashboard to see what all the platform monitors.

thethings.iO thing detail

And for the more technical users you are easily able to begin creating your product right away.

thethings.iO create a product

Step 3: Create a new IoT Product

In getting started, the first thing we help you do is to Create A New IoT Product.

thethings.iO create a new IoT product

In this field, you have to introduce which kind of product you want to connect and the hardware you are going to use to make it.

thethings.iO create a new IoT product

Once you have done all of this, you can accept and your product will automatically be created.

thethings.iO create Arduino product

Step 4: Activate your first thing

As you will see, after creating your first product, a box asking you to activate your thing will appear in your window. You just have to click on the Activate First Thing button!

thethings.iO product created

 

Step 5: Install thethings.iO in your device and send data

Right now you are in the middle of the whole process. Here we want to help you with some example code in order to facilitate the process to start sending us data. So at this point your screen will look like this:

thethings.io activation

You will now click on your thing and your product details will show up. At this point you will want to Activate More Things.

thethingsio activationthethingsio activation

The code you need to add to your thing will appear in the window, so the only thing you need to do is to copy and paste it (maybe re-code it a bit depending on your sensors, etc) in your thing’s code. In addition, if you cannot connect your device at that moment, you can also simulate and monitor it.

thethings.iO thing copy and paste

 

Step 6: Monitor your thing

If you go back to the Things Manager window you will be able to then access the Simulator which will send random values that will be useful to test your thing. You can do this by pressing details to whichever thing you are wanting to monitor.

thethings.iO thing detail

Then you can Start Sending Values to get real time data. It will start automatically and stop when you press Stop Sending Values.

thethingsio start sending values

thethingsio stop sending values

One of the latest things in the dashboard from now on is the capability to insert data. If you want to know how, you just have to click on the “Learn how to insert data” button that appears in the details window of a thing you have not yet sent values to.

thethingsio data entry

You can also go to Developers > Libraries to find more libraries and examples about how to send data to thethings.iO.

And that’s it! You should have your thing connected, activated and sending data to your dashboard. Now you can customize your IoT dashboard to make it more personalized to you.

Step By Step Video Tutorial

You can also check out our video that will walk you through the 6 steps we just showed you to connect your first device to thethings.iO.

Do not forget to follow us on Twitter in order to keep you posted about the IoT World and the latest news of thethings.iO.

Connect a thermostat with OpenMote and thethings.iO

thethings.iO + openmote

thethings.iO + openmote

During the last months we have seen dozens of amazing projects being connected at thethings.iO. Here we are going to show you how to connect a heating system and a thermostat for your house using thethings.iO as the IoT platform and OpenMote as a hardware.

connect-a-heating-system
This project was made by Roberto Romero Jotel as his final Master’s project for the Universitat Oberta de Catalunya this past 2015, so we are going to make a quick review to his one.

OpenMote and OpenWSN

During the project, the maker Roberto connected a heating system with a thermostat using the OpenMote with OpenWSN (IEEE 802.15.4e) and thethings.iO. On the project there is also a Raspberry Pi with Internet and the OpenBase and OpenMote-CC2538 modules connected by USB at the Raspberry Pi. The Raspberry Pi was converting the messages from the OpenWSN(802.15.4e) to Ethernet (HTTPS) to send the data to thethings.iO

The OpenMote platform consists on:

  • OpenMote-CC2538: which uses SoC TI format for Cortex-M3 and CC2520. This SoC can support Contiki, OpenWSN (which is also the protocol we are going to explain later in this post) and FreeRTOS.
  • OpenBase: a plate with different ports such as Ethernet, USB and JTAG.
  • OpenBattery: also a plate with 3 digital sensors and batteries. Its operation is autonomous.
Reliable Low Power Wireless OpenMote

Reliable Low Power Wireless OpenMote

The OpenWSN is a collection of different Internet of Things protocols. It counts on the OpenOs, which is a collaborative of OpenWSN, an OpenVisualizer, the visualization program and a Python CoAP library.

The IoT platform

thethings.iO is the IoT platform of the project. It also provides write and read methods. In the first case (ThingWrite), it allows users to collect data in JSON format with POST request at the URL through the CoAP API:

coap://coap.thethings.iO/v2/things/{{THING_TOKEN}}

In the case of the ThingRead, it allows the user to read the data from a resource (KEY) with GET request at the URL:

coap://coap.thethings.iO/v2/things/{{THING_TOKEN}}/resources/{{KEY}}

thethings-io-dashboard

How to make things work together

The real question in here is how to connect the OpenMote with thethings.iO?

Project's architecture

Project’s architecture

The key is the integration of thethings.iO API on the OpenMote implementation with the Raspberry Pi. Let’s explain the two basic functions of thethings.iO that enables the thermostat to read data and write sensor’s data from and to thethings.iO.

First of all, the thermostat wants to send new data from its sensors (temperature, humidity, etc). How do we do it? Remember that we have to consider that the OpenMote is connected to a Raspberry Pi through a TCP socket. That means that thethings.iO as the IoT platform receives the data through CoAP from the Raspberry Pi thread that listens the TCP socket from the OpenMote.

Once they are connected one to each other, the client sends the Raspberry Pi process the data. All this data collected is sent by the Raspberry Pi to thethings.iO IoT platform using a CoAP POST request. thethings.iO gives an answer which can be “Success” or “Error”. Finally, when the OpenMote receives the answer, the connection ends.

The reading operation from thethings.iO is similar, the OpenMote tries to establish a socket connection with the Raspberry Pi, and the Raspberry Pi sends a request of polling to thethings.iO. Once they are connected to eachother, the client sends a request to read its data to the server. All the data is requested to thethings.iO by the server using a CoAP GET request. Then, thethings.iO sends the answer to the Raspberry Pi, giving a “Success” with the JSON, which is translated in sending all the data requested, or an “Error”.

If you want to know more about Roberto Romero’s project (in catalan) and the public code on Roberto’s github account.

And if you want to start connecting things with thethings.iO you can register here.

thethings.iO at the MWC2016

mwc2016

This week we enjoyed the Mobile World Congress in Barcelona (February 22nd to 26th 2016), which represents one of the biggest technological events of the whole world. Since we are based in Barcelona, thethings.iO could not miss such an important event, full of big companies that showed their latest products in the mobile and technological field.

What did we see in the MWC?

Under the slogan “Mobile is everything”, huge companies such as Samsung, LG, Huawei, Sony and Epson, among others, introduced their latest products to the approximately 100,000 attendees from more than 200 different countries. There were lots of expectations and excitement to know all what was new and what’s going to be the next generation of mobile, virtual reality and technology.

MWC 2016

MWC 2016

The technological stars were virtual reality and the Internet of Things. The most interesting part was to find IoT examples in most of the hundreds of booths at the MWC. The Internet of Things is a reality and all the companies attending the event wanted to show that they are surfing the IoT wave. That’s exciting, and actually how we are visualizing the direction of the Internet of Things growth.

We are sure that the Internet of Things (IoT) is going to represent the next biggest revolution. As many people say, it is going to be bigger than the Mobile revolution and Internet itself. Maybe this is the reason why most companies are moving forward to implement the Internet of Things in their also technological products. And obviously, we saw it in Fira of Barcelona at the MWC2016.

This year for first time, the MWC placed just one pavilion for the Internet of Things companies. We could see Sigfox, LoRa, Libelium, ThingWorx and another interesting companies showcasing their uses cases. A lot of others companies have in mind the impact it is going to cause in the technological field. And thethings.iO is ready to help them.

IoT Events during the MWC: the IoT Stars and other

Besides MWC is held in Fira Barcelona, some other events take place in the city. Most people say that the most interesting events during the MWC are outside the MWC.

IoT Stars 2016

The fist one was the IoT Stars, sponsored by thethings.iO and presented by our CEO, Marc Pous. The second edition of the IoT Stars took place in Antiga Fàbrica Estrella Damm on Monday 22nd afternoon. The event gathered 12 really cool projects which competed to become the new best IoT Startup. The winners of the IoT Stars 2016 were Insulclock and Vayyar with amazing examples of what the Internet of Things will bring in our society in the next months and years.

We also attended an exclusive Samsung Artik workshop where we could learn about the new ARTIK shield and tools that Samsung is building for developers. Just amazing device built by the company from South Korea.

Another event we attended this week was the 4YFN exhibition. thethings.iO had a booth on Tuesday at the Telefonica space. 4YFN connected different Startups, so we also found some interesting projects not only from Barcelona, even from around the world. Our CEO, Marc Pous was interviewed by BTV (Barcelona TV).

If you missed the MWC 2016 and you need to connect your project to the Internet, contact us.

Connecting the SmartEverything to thethings.iO with Sigfox

In today’s post we are going to show you Step by Step how to connect the SmartEverything board to thethings.iO with SigFox technology. If you need to visualize Sigfox data through an IoT dashboard or analytics you can use thethings.iO.

During this tutorial you will need:

  • A SmartEverything board.
  • A button (optional)
Smart Everything shield

Smart Everything shield

Now, make sure you have an account at thethings.iO. If not, register quickly by clicking here.

Once you have done this, you can start with this Step by Step.

Step 1: Preparing the environment

First you need the Arduino software installed. After that, open the Arduino IDE and go to Tools > Boards Manager. On the search box, search and install the Arduino Zero core and the AMEL-Tech Boards.

Now, select the Smart Everything FOX (Native USB) board at Tools > Boards > Smart Everything FOX (Native USB).

 

Arduino-SmartEverything-Board

You will need to install 3 libraries, go to Sketch > Include Library > Manage Libraries and search and install the next libraries: SE868 (for the gps), HTS221 (for the temperature and humidity) and LSM9DS1 (for the 3d accelerometer).

If you want to use the other sensors, you can find the list of the libraries at https://github.com/ameltech.

 

Arduino-SmartEverythingLibrary

Step 2: Sending Values

Now, it is time to code the board! Go to our github example, copy the code and paste it into a new sketch.

arduino-ide

Then click on upload in order to install the code on the board.

Consider reading our previous post about connect Sigfox to the IoT platform thethings.iO before step 3-4. It contains a video showing those steps.

Step 3: Connecting Sigfox to thethings.iO

In order to receive the data from Sigfox, you’ll need to redirect all the messages using a callback from our Sigfox profile. You’ll need to configure our thethings.io profile for this:

    1. Navigate to Things Manager
    2. Create a new IoT product: Insert your product name, select the Smart Everything board and the Sigfox format.sigfox-new-product
    3. Go to the product page by clicking to the created product at the products list.
    4. At the top left, there is a details box with a Subscription URL that we will have to copy.subscription-url
    5. Navigate to the Sigfox backend webpage to activate the smarteverything board by selecting the smarteverything and the network. Next, fill out the form with the Sigfox ID and the PAC. You will find both at the back of your device. Last but not least, you will have to fill out the registration form so you will be able to access the Sigfox backend with your own email and password.
    6. Log in and go to Device. You will see a list of your devices. Select the one that you have just added, take a look at the sidebar and click on Callbacks.
    7. Click New (placed Top-Right)

sigfox-callbacks-list-thethings

  1. Choose the following configuration:
      1. Type: DATA UP-LINK.
      2. Channel: URL.
      3. Url pattern: Paste your previous subscription URL from thethings.iO.
      4. Use HTTP method: POST and click Ok.

    sigfox-callback-thethings

Step 4: Parsing data from Sigfox

Now go to thethings.iO IoT platform and you will need to specify how to parse the data that Sigfox forwards to thethings.iO, in order to display the correct values:

  1. Go to Cloud Code
  2. Navigate to Functions and Edit the parser with the name that you gave before.
  3. Parse your resources by splitting the string that Sigfox sends (An hexadecimal number containing all the sensor values, one after the other).
  4. In the preview input, copy the sigfox payload that you send from Sigfox and change “quote” to “data” to prove your function.

You can find the parser code here.

Step 5: Creating the dashboard Widgets

It’s time to create an IoT Dashboard with thethings.iO to show all the values of your sensors!

    1. Click on Add widget.
    2. Introduce a name for the widget.
    3. Select Thing Resource.
    4. Select Sigfox.
    5. Select your thing Token.

thethings-widget-sigfox

  1. Select the resource that you want to show.
  2. Select how you want to show your resource (Lines, bars, log…)

Repeat this process until you finish your awesome IoT Dashboard!

thethingsio-dashboard

 

And that’s it! Isn’t it easy? Connect Sigfox devices from now with thethings.iO and get cool customizable IoT Dashboards as the one we have shown you here.

And do not forget to follow us on Twitter in order to keep you posted about the IoT World and the latest news of thethings.iO.

4 Steps to Build Your IoT Dashboard

As you know, thethings.iO is the Internet of Things platform that allows you to connect things to the Internet quickly and easily. We allow you to monitor and manage your networked devices in real-time and get flexible analytics reports. And the product goes further, as you will see in this post about the IoT Dashboard that we deployed some weeks ago.

thethingsio-dashboard
This is a quick tutorial of how to build your IoT dashboard and also how to customize it in order to make it more “yours”.

Step 0: Sign Up or Log In at thethings.iO

The first thing you need to do is, in case you have not registered yet, create a new account and Sign Up to our platform. Otherwise, if you already have an account, you just need to Log In to move to your IoT Dashboard.

Primarily you’ll notice that when you first access to your IoT Dashboard, a new window appears to introduce yourself to the platform and specifically, to the IoT Dashboard. The message is the following one:

hello-dashboard
>

Step 1: Starting with thethings.iO IoT Dashboard

The IoT Dashboard is the place at thethings.iO where all the data generated by your things will be displayed. Depending on which kind of information you want to see you may prefer one widget or another. Before start building your IoT Dashboard you should have at least one thing connected using our platform. If you want to start connecting things fast, you should not miss this quick guide of how to connect your first thing in 1 minute! Why? Because you need data to display!

Once you have done that, we can move to the option “Edit Dashboard”, on the lower right section of your screen. The icon is yellow and this tool is the one we are going to use most during this post, so keep an eye on it!

Step 2: Create a Widget

Above the yellow “Edit Dashboard” there is a a blue “Add Widget” icon. So now we are going to click on it and a pop-up you will have to work with will appear. Your screen should look like this:

add-widget

The only thing you need to do now is to complete the fields that appear in this pop-up, such as we have done in the following example:

add-widget-2

At this point, you can choose the kind of widget you want your data to be displayed on your IoT Dashboard. You have different options, such as:

  • Map
  • Doughnut
  • Lines
  • Bars
  • Logs
  • Value
  • Pie
  • Polar Area

Depending on the option you choose in “Values Range” you’ll find one or the other.

Screen Shot 2017-01-25 at 3.30.56 PM

 

Finally, you can add your new widget to your IoT Dashboard.

Step 3: Customize your IoT Dashboard

One of the coolest things you can do with your IoT Dashboard is to add, remove and replace your widgets easily. To do it you just need to click on “Edit Dashboard” again and just touch one of the widgets. Now you can change its place just moving it, change its size, and also the kind of widget you want it to be!

Look the changes we have done in our example screen:

drag-drop-widgets

 

Once you finish editing your IoT Dashboard do not forget to save it!

Step 4: Create an Image

You may think that’s all we can offer, but right now we do offer more! Now you can add images to your IoT Dashboard. How?

  1. Go to Edit Dashboard button and Add Widget.
  2. Once you are in the pop-up window, in the “Data Source” field you have to choose the option “External Image”. Here you will be able to add images from your computer or directly from an URL.

widget.extrenalimage

3. Add your Widget to your IoT Dashboard.

Step By Step Video Tutorial

You can also check these 2 tutorials in which we explain how to build and customize your IoT dashboard. In this case we use a Thermostat we’ve recently connected to thethings.iO to show you how it works.

And that’s it. Isn’t it easy? Start connecting things now with thethings.iO and get cool customizable IoT Dashboards as the one we have shown you here.
And do not forget to follow us on Twitter in order to keep you posted about the IoT World and the latest news of thethings.iO.