FPT Software's Technology Community
  • Contact Us

Internet of things – Controls your devices from anywhere with Yaler-v2

Ting Hsuan Lin | September 28, 2016

A common problem in home automation and an internet of things applications is that it is difficult to reach embedded devices in hidden behind a firewall or NAT.

Overview

A common problem in home automation and an internet of things applications is that it is difficult to reach embedded devices in hidden behind a firewall or NAT.

Internet-connected devices face two principal challenges:

Firewall, NAT or mobile router prevents access.

  • Accessibility– Firewalls prevent incoming HTTP connections to the embedded system, especially if the administrator is not known or adding an exception to the firewall policy is not an option.
  • Addressability– To cope with the increasing shortage of free IPv4 addresses, embedded systems often can only be provided with dynamically changing IP addresses. NAT also mitigates the address depletion problem by hiding multiple connected devices behind a single public IP address.

There are different approaches to overcome this problem:

  • Port forwarding and static IP addresses. This solution requires the user of the connected device to know how to configure a router and have access to router administration which is not always possible.
  • Polling is a technique where the connected device at regular intervals checks with an external server if the device should take action. This solution requires no configuration of the router but it creates extra network traffic and response delays.
  • A third way is to use WebSockets which is a way of providing real time full-duplex communication over TCP.
  • Reverse HTTP is the solution that will be used in this tutorial. We will use Yaler which is an open source relay infrastructure that gives access to connected devices with very little configuration.Yaler relay provides addressability and accessibility.

Introducing a relay enables the device to establish an outbound HTTP connection on a standard port, which is usually allowed by firewalls. Yaler then serves as the public access point for connected devices routing all incoming traffic from clients to the device and back.

How it works

The core of the Yaler protocol consists of the following handshake:

The Yaler relay allows a device to publish itself under a unique name, e.g. device-id. Whenever a Web client tries to access a resource on the device, Yaler switches the connection to the device to Reverse HTTP, and forwards

the client request. After processing the request, the device responds and Yaler returns6 the response back to the client.

Summary

You can download Yaler Relay Server and Yaler Contrib for many platforms and languages at:https://yaler.net/download hoặc https://bitbucket.org/yaler/

Yaler is popular used in home automation, environmental monitoring, tele-medicine and more.

Author: Nguyen Ngoc Dinh – FTEL

Leave a Reply

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

Thanks for sharing this info! That’s really great advice. Check this review review or any other on our review site for looking for the best dating sites out there!

RELATED STORIES