Posts

Geocoding location coordinates to addresses from GPS-trackers

Today we talk about geocoding. Geocoding is a very interesting art! Geocoding consist of converting addresses (e.g. streets) into geographic GPS coordinates (i.g. latitude and longitude). On the other hand, we have reverse geocoding that is the reverse process: transforming a pair of geographic GPS coordinates into an address (street with number and city).

You might be wondering what geocoding can be used for. From simple analysis to business and customer management to distribution techniques, there is a wide range of applications for which geocoding can be used. At thethings.iO we are helping companies for which is important to geocode the GPS coordinates into addresses for the fleet management, route planning, among others.

At thethings.iO we usually receive the location as geographic GPS coordinates (latitude and longitude). It is known that it is the best way if you want to represent your assets on a map. However, geographic coordinates are not meaningful if they are not represented on a map. That’s why some customers ask us for the possibility of the integration of geocoding services in thethings.iO IoT platform.

Thanks to the Cloud Code service, we help you to integrate third-party services that enable you to transform the data from your connected things into information that will be useful to your daily activities.

Here you can see an example. In the table, you can see the addresses where the devices are located in:

Geocoding services

Although there are many geocoding services, today we will talk about two of them:

  • OpenCage Geocoder
  • Google Maps Geocoding API

Both are free up to 2.500 requests per day. In the case of Google will charge us $0,5/1.000 requests up to 100k daily requests if we overlap the free limit. For OpenCage we have different plans, e.g the x-Small plan includes 10k requests per day and it cost $50 per month.

Some lines below you will find information on how to use it. The first step is to get the API key or token.

Obtaining the API key

OpenCage

OpenCage Geocode is a very simple geocoding service (as we like). You only have to sign-up and follow all the registrations steps. After that you will see your dashboard like this:

Copy and keep the API key. We will use later!

Google Maps Geocoding API

If you have decided to use the Google Maps Geocoding API you must follow these steps:

1. You have to sign in with your Google account and follow this link:

2. Click on ‘Get a Key’ button and follow the instructions.


3. You will obtain your API key. Keep it! We will need it later!

 

Using geocoding services at thethings.iO

Once you get your API key, you are ready to use the geocoding services on our platform. In the following link, you can find a repository with the functions and examples of how to use these services.

In the repository, you can find two folders and two files. The folders contain the code for the httpRequest with both the OpenCage and Google Maps API geocoding and inverse geocoding services.

With that code, we build two examples that could be useful for your business requirements. Anyway, do not hesitate to contact us if you have further questions regarding this topic. We can provide you with more examples!

       1. Example 1. Trigger (Inverse geocoding with Open Cage API)

With this code every time you send data to the platform that contain location information, the trigger will be executed and we will transform the coordinates from the resource $settings.geo into a physical address. Then we will save it into the resource address. You just have to create a new trigger in the cloud-code. Then copy and paste the following code.

      2. Example 2. Function (Inverse geocoding with Google Maps Geocoding API)

In this case, we transform all the addresses of all the things of one product just in one cloud-code execution. Create a new function, choose the product and copy and paste the code from the file. Finally, introduce “{}” in the Preview Params (Check the picture below). The function will calculate the address for all the devices that contain information in the resource $settings.geo and will be saved in the resource address of each thing.

We hope all this information will be helpful for you. If you want to know more about us, you can create an account by clicking here, sign up to receive our monthly newsletter or follow us on Twitter! Stay tuned and be the first in knowing the latest news of the IoT world and 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.

Keep IoT Simple, Stupid!

Innovation brings enthusiasm when you are making a product. Launching a connected device is hard and expensive. 2015 has been amazing at thethings.iO; we worked together with great projects and awesome people. The most valuable thing we discovered is that things must be more simple, from the UX to the most technological part of the projects.

Inspired by the KISS principle (“Keep It Simple, Stupid”), thethings.iO would like to advocate towards the “Keep IoT Simple, Stupid”!

The “Keep It Simple, Stupid” principle states that the most basic rule in every design is to make it simple rather than complex. That means that simplicity should be more important in design and unnecessary complexity should be avoided. The Internet of Things is a complex scenario and simplicity is much needed, so unnecessary complexity shouldn’t be made.

At thethings.iO IoT platform we have grasped this concept in the essence of our system. Among the connected product and the mobile application, there are hundreds of things to worry about: electronics, mechanicals, manufacturing, packaging, logistics, data security, cloud storage, mobile applications, interoperability with other things, among dozens more.

Simply put the “Keep IoT Simple, Stupid” principle in your project. We suggest that companies focus on what they do best. Some companies are very good at design, other very good with electronics and others with algorithms. How can they bring a connected device into the market faster? The answer is by looking for partners who can make the process less complex. The best projects we worked on 2015 were projects where the consortium of companies that joined the founder team was fantastic. Don’t waste your time and money reinventing the wheel! It’s 2016!

Everyday it becomes easier and easier to connect things to the Internet. This is the main reason why the number of companies building new connected devices in China, Europe, United States or Latam has been on the rise. So, “Keep IoT Simple, Stupid”!

What is thethings.iO’s main role here?

thethings.iO IoT platform

thethings.iO IoT platform

Under this concept of keeping things simple, thethings.iO IoT platform wants to offer a solution to all IoT and digital companies, helping them into the connection, storage, monitoring and data analysis of their cool new devices and products. Outsourcing IoT platform cloud service results in a faster implementation and reduced time to market for the new launches on the IoT landscape. Our advice is to consider taking the “simple, stupid” way to connect your product to IoT: it will be a smart choice.

Hardware companies should focus on building things. At the same time, thethings.iO makes the connectivity development from the prototyping phase until the certification and massive production. thethings.iO offers:

  • IoT Back-End solution to store data that can be accessible in real-time.
  • Customizable front-end user interface with your brand and under your URL.
  • Real-time data analysis with AI and data mining algorithms.
  • Security, Scalability and Data Privacy.
  • Interoperability with the majority of the IoT available.

Yes, it is better when you Keep IoT simple have you not seen it yet?

,

IKEA joins the IoT revolution

IKEA joins the IoT Revolution

IKEA joins the IoT Revolution

Internet of Things is now a reality, and lots of companies have to face it. Companies from many different fields (as we have seen: housing, decor, gardening…) have to improve their offers in order to survive in the new technological era. That’s why the famous Swedish company IKEA has decided to adapt things into the IoT’s world and also create new connected things to make our lives easier.

IKEA’s idea is to make a more sustainable life at home, so that is the reason why in the next decade the brand is going to create and develop new connected things, such as the whole kitchen. In a collaboration with IDEO, a global design company, and design students from Lund University (Sweden) and Eindhoven University of Technology (Netherland), IKEA has created the named Concept Kitchen, which was shown at the Milan Design Week.

Read more

How IoT will change our gardens

How IoT will change our gardens

How IoT will change our gardens

In this blog, we have had a quick look at different ways that Internet of Things is going to change our lives soon, like houses, cities, workplaces and even animals! As you see, Internet of Things is going to change absolutely everything, and your garden could not be less. In this post, we are going to know new connected garden equipment that will help you improve it.

It is commonly said that most people do not have many time to take care of their garden. Then, you need to ask yourself if you prefer to have a poor garden, or better hire a gardener who will care of it for you.

Firstly, you need to know that, as well as there are thermostats that can help you control your house temperature or humidity, there is also the garden version. Edyn Garden Sensor is an IoT device that tracks environmental conditions, such as light, humidity, temperature… and then recommends you which plants will thrive or the optimal time for planting, among others. You can see all the information just by using its app. Isn’t it easy?

Edyn Garden Sensor

Edyn Garden Sensor

Other IoT devices can also help you save lot of water, for example RainMachine, which is synchronized with NOAA (National Oceanic and Atmospheric Administration) and other international weather data sources, that sends information to the app about temperature, humidity, wind speed, solar radiation, amount of precipitation… This device also calculates daily evapotranspiration losses and, at the same time, auto-adjusts the watering duration depending on the needs of the plant. The main purpose of RainMachine is protect and nourish your garden to perfection.

Koubachi offers a new point of view in tracking and controlling your plants. It offers a plant sensor (there are the indoor and outdoor options) and measures vital plant parameters, like light level (sunlight or artificial), soil temperature, humidity… With it, your own plant will tell you when you should to water it or if you need to change its position. In your app you will have an inventory of your plants.

Koubachi Plant Sensor

Koubachi Plant Sensor

For all those that have tried to have a little vegetables’ garden at home, Click & Grow is the option they were looking for. Their first internet-connected device was Smartpot, a connected pot that allows you to watch how your plants grow. As they describe themselves, the process is simple: “plug it in, add a little water and let it take care everything else”. By using an innovative NASA-inspired technology, they make plants grow faster, but still 100% naturally, without pesticides, insecticides… Can you believe it?

Even the brand Parrot has been interested in the connected devices, specially with a garden product, so similar to Koubachi. It is called Flower Power, and measures the needs of your plants and sends it to your phone. Available indoor and outdoor, it controls fertility, humidity, temperature and light. When it detects a need, it advises you automatically, so you will know in real time when to water your plants, add fertilizer…

Even if you are a garden-lover or a garden-forgetful person, IoT is going to change the way you look at your garden for sure! Now, any excuse is going to be accepted.
thethings.iO connects all those devices to the Internet, as most of you know. Actually, some months ago we connected a Koubachi Plant Sensor here at thethings.iO’s office! If you want to know more about IoT world and thethings.iO stay tunned!

Discover how we can help you to connect wearables and devices to the Internet.

Try for free now

How IoT will change our animals

How IoT will change our animals

How IoT will change our animals

Could you ever imagine that Internet of Things is going to change our animals? Yes, this is possible, just keep reading and you will discover it!

Pets

Basically, the most common IoT devices for dogs or cats are the animal tracking-kind. Many companies have created a similar FitBit bracelet, but for dogs’ neck. It is commonly said that the dog is the best friend of the human, so why not start understanding it?

Some examples are WÜF or FitBark, which monitors the dog’s everyday activity and allows you to track its progress. By using FitBark, the dog’s master can understand its health, changes in behaviour, share experiences with friends and family, automatically share data to its vet, etc. It fits in all kind of dogs.

Read more

, ,

thethings.iO library for Electric Imp

We love Electric Imp, its simplicity and how it works. This is the reason why this is the very first tutorial explaining with detail how to connect Electric Imp with thethings.iO. The ElectricImp + thethings.iO library that we implemented let you read, write and activate things through the REST API from thethings.iO.

From now if you need to store data from your Electric Imps you will be able to use our Electric Imp class to access the thethings.iO services.

Electric Imp board

Electric Imp board

Keep reading if you want more information about the Electric Imp + thethings.iO library…

Read more

How IoT will change Sport

How IoT will change Sport

How IoT will change Sport

First, it was the Health app from Apple or Nike+, Nike + Running, Runtastic mobile apps…, and now lots of wearables and other devices are connected to the internet to measure, not only your steps, even more and more. From bracelets to t-shirts that control your movements. The inimaginable, has become real to change our lives. Do you want to know more? Keep reading, we are going to show you the latest news in the Internet of Sport Things field.

Fitness

To practise Fitness is in style. Everyone knows what fitness it, and most people around the world have added it to their lifestyles. The Internet of Things fitness devices’ main role is to help athletics practise it in a better way.

If we think about running, the first device that comes to our minds is FitBit. What is it? It is a brand of connected bracelets that allow the customers to track their day-to-day. Your daily steps, the distance you have walked, the calories you’ve burned… everything is tracked with one FitBit device. To monitor your sleep at night, to wake you up with a quiet vibration, act as a clock or ask at phone calls (yes, you can connect it to your smartphone) are some of other capabilities Fitbit offers to customers. But there’s even more! All the data generated can help you see your own personal progress and keep the control. There are other sport brands that offer a similar product as FitBit, for example, Nike, with its device called FuelBand.

Read more